eve_parser.hppGo to the documentation of this file.00001 /* 00002 Copyright 2005-2007 Adobe Systems Incorporated 00003 Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt 00004 or a copy at http://stlab.adobe.com/licenses.html) 00005 */ 00006 00007 /*************************************************************************************************/ 00008 00009 #ifndef ADOBE_EVE_PARSER_HPP 00010 #define ADOBE_EVE_PARSER_HPP 00011 00012 #include <adobe/config.hpp> 00013 00014 #include <string> 00015 00016 #include <boost/any.hpp> 00017 #include <boost/function.hpp> 00018 00019 #include <adobe/array_fwd.hpp> 00020 #include <adobe/istream.hpp> 00021 #include <adobe/name_fwd.hpp> 00022 00023 /*************************************************************************************************/ 00024 00025 /* 00026 Eve Grammer: 00027 ---------------------------------------- 00028 00029 layout_specifier = [lead_comment] "layout" identifier "{" { qualified_cell_decl } 00030 "view" view_definition "}" [trail_comment]. 00031 00032 qualified_cell_decl = interface_set_decl | constant_set_decl. 00033 00034 interface_set_decl = "interface" ":" { cell_decl }. 00035 constant_set_decl = "constant" ":" { cell_decl }. 00036 00037 cell_decl = [lead_comment] identifier initializer end_statement. 00038 initializer = ":" expression. 00039 00040 view_definition = [lead_comment] view_class_decl ((";" [trail_comment]) 00041 | ([trail_comment] view_statement_list)). 00042 view_statment_sequence = { view_definition }. 00043 view_class_decl = ident "(" [ named_argument_list ] ")". 00044 view_statment_list = "{" view_statement_sequence "}". 00045 00046 end_statement = ";" [trail_comment]. 00047 */ 00048 00049 /*************************************************************************************************/ 00050 00051 namespace adobe { 00052 00053 /*************************************************************************************************/ 00054 00055 struct eve_callback_suite_t 00056 { 00057 enum cell_type_t 00058 { 00059 constant_k, 00060 interface_k 00061 }; 00062 00063 typedef boost::any position_t; 00064 00065 typedef boost::function<position_t ( const position_t& parent, 00066 const line_position_t& parse_location, 00067 name_t name, 00068 const array_t& parameters, 00069 const std::string& brief, 00070 const std::string& detailed)> add_view_proc_t; 00071 00072 typedef boost::function<void ( cell_type_t type, 00073 name_t name, 00074 const line_position_t& position, 00075 const array_t& initializer, 00076 const std::string& brief, 00077 const std::string& detailed)> add_cell_proc_t; 00078 00079 00080 add_view_proc_t add_view_proc_m; 00081 add_cell_proc_t add_cell_proc_m; 00082 }; 00083 00084 line_position_t parse(std::istream& in, const line_position_t&, 00085 const eve_callback_suite_t::position_t&, const eve_callback_suite_t&); 00086 00087 /*************************************************************************************************/ 00088 00089 } // namespace adobe 00090 00091 /*************************************************************************************************/ 00092 00093 #endif // ADOBE_EVE_PARSER_HPP 00094 00095 /*************************************************************************************************/ | ||||

