From d510f2c0d548b1142d96e731eba2736b5a0feeee Mon Sep 17 00:00:00 2001 From: dengg Date: Thu, 26 Oct 2006 16:42:42 +0000 Subject: Merged from CIAO-events-3 branch. --- modules/CIAO/CCF/CCF/CIDL/Parser.cpp | 165 +- modules/CIAO/CCF/CCF/CIDL/Parser.hpp | 3 + .../CCF/CCF/CIDL/SemanticAction/Composition.hpp | 6 - modules/CIAO/CCF/CCF/IDL2/Parser.cpp | 1742 +++++--------------- modules/CIAO/CCF/CCF/IDL2/Parser.hpp | 6 +- modules/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp | 37 - .../CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp | 4 +- modules/CIAO/CCF/CCF/IDL3/Parser.cpp | 1001 +++-------- modules/CIAO/CCF/CCF/IDL3/Parser.hpp | 4 + .../CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp | 6 - .../CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp | 6 - modules/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp | 6 - .../CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp | 2 +- .../CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp | 2 +- 14 files changed, 691 insertions(+), 2299 deletions(-) diff --git a/modules/CIAO/CCF/CCF/CIDL/Parser.cpp b/modules/CIAO/CCF/CCF/CIDL/Parser.cpp index 790410f3921..ae99e2428b0 100644 --- a/modules/CIAO/CCF/CCF/CIDL/Parser.cpp +++ b/modules/CIAO/CCF/CCF/CIDL/Parser.cpp @@ -13,9 +13,6 @@ namespace CCF { namespace CIDL { - using IDL2::Parsing::DiagnosticType; - using IDL2::Parsing::RecoveryMethod; - Parser:: Parser (CompilerElements::Context& context, Diagnostic::Stream& dout, @@ -73,61 +70,16 @@ namespace CCF // Composition // composition_decl = + composition_header + >> LCBRACE[act_composition_open_scope] + >> home_executor_decl + >> RCBRACE[act_composition_close_scope] + >> SEMI[act_composition_end] + ; + + composition_header = COMPOSITION - >> guard - ( - ( - assertion ("composition category expected", - DiagnosticType::BEFORE) - ( - composition_category - ) - >> assertion ("composition name expected", - DiagnosticType::BEFORE) - ( - simple_identifier - ) - )[act_composition_begin] - - >> assertion ("'{' expected", - f.composition (), - &SemanticAction::Composition::end) - ( - LCBRACE[act_composition_open_scope] - ) - - >> assertion ("home executor declaration expected", - f.composition (), - &SemanticAction::Composition::close_scope, - &SemanticAction::Composition::end, - DiagnosticType::BEFORE) - ( - hood (home_executor_decl) - [ - handler (f.composition (), - &SemanticAction::Composition::close_scope, - &SemanticAction::Composition::end) - ] - ) - - >> assertion ("'}' expected", - f.composition (), - &SemanticAction::Composition::close_scope, - &SemanticAction::Composition::end, - DiagnosticType::BEFORE) - ( - RCBRACE[act_composition_close_scope] - ) - - >> assertion ("';' expected", - f.composition (), - &SemanticAction::Composition::end, - RecoveryMethod::NONE) - ( - SEMI[act_composition_end] - ) - - )[error_handler] + >> (composition_category >> simple_identifier)[act_composition_begin] ; composition_category = @@ -137,105 +89,34 @@ namespace CCF | SESSION ; - // // Home executor // home_executor_decl = + home_executor_header + >> LCBRACE + >> home_executor_home_impl_decl + >> home_executor_executor_decl + >> RCBRACE + >> SEMI[act_home_executor_end] + ; + + home_executor_header = HOME >> EXECUTOR - >> guard - ( - assertion ("home executor name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_home_executor_begin] - ) - - >> assertion ("'{' expected", - f.home_executor (), - &SemanticAction::HomeExecutor::end) - ( - LCBRACE - ) - - >> assertion ("implements declaration expected", - f.home_executor (), - &SemanticAction::HomeExecutor::end, - DiagnosticType::BEFORE) - ( - hood (home_executor_home_impl_decl) - [ - handler (f.home_executor (), - &SemanticAction::HomeExecutor::end) - ] - ) - - >> assertion ("manages declaration expected", - f.home_executor (), - &SemanticAction::HomeExecutor::end, - DiagnosticType::BEFORE) - ( - hood (home_executor_executor_decl) - [ - handler (f.home_executor (), - &SemanticAction::HomeExecutor::end) - ] - ) - - >> assertion ("'}' expected", - f.home_executor (), - &SemanticAction::HomeExecutor::end, - DiagnosticType::BEFORE) - ( - RCBRACE - ) - - >> assertion ("';' expected", - f.home_executor (), - &SemanticAction::HomeExecutor::end, - RecoveryMethod::NONE) - ( - SEMI[act_home_executor_end] - ) - - )[error_handler] + >> simple_identifier[act_home_executor_begin] ; - home_executor_home_impl_decl = IMPLEMENTS - >> guard - ( - assertion ("home name expected", - DiagnosticType::BEFORE) - ( - identifier[act_home_executor_implements] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> identifier[act_home_executor_implements] + >> SEMI ; - home_executor_executor_decl = MANAGES - >> guard - ( - assertion ("executor name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_home_executor_manages] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> simple_identifier[act_home_executor_manages] + >> SEMI ; } } diff --git a/modules/CIAO/CCF/CCF/CIDL/Parser.hpp b/modules/CIAO/CCF/CCF/CIDL/Parser.hpp index 719f97f184d..565057a4461 100644 --- a/modules/CIAO/CCF/CCF/CIDL/Parser.hpp +++ b/modules/CIAO/CCF/CCF/CIDL/Parser.hpp @@ -47,10 +47,13 @@ namespace CCF // Composition Rule composition_decl; + Rule composition_header; Rule composition_category; // Home executor Rule home_executor_decl; + Rule home_executor_header; + Rule home_executor_body; Rule home_executor_home_impl_decl; Rule home_executor_executor_decl; diff --git a/modules/CIAO/CCF/CCF/CIDL/SemanticAction/Composition.hpp b/modules/CIAO/CCF/CCF/CIDL/SemanticAction/Composition.hpp index 8c46b83326c..71cfc22a108 100644 --- a/modules/CIAO/CCF/CCF/CIDL/SemanticAction/Composition.hpp +++ b/modules/CIAO/CCF/CCF/CIDL/SemanticAction/Composition.hpp @@ -28,12 +28,6 @@ namespace CCF virtual void begin (SimpleIdentifierPtr const& id, Category::Value category) = 0; - virtual void - open_scope () = 0; - - virtual void - close_scope () = 0; - virtual void end () = 0; }; diff --git a/modules/CIAO/CCF/CCF/IDL2/Parser.cpp b/modules/CIAO/CCF/CCF/IDL2/Parser.cpp index c368ad2b5d7..50f6a2e6071 100644 --- a/modules/CIAO/CCF/CCF/IDL2/Parser.cpp +++ b/modules/CIAO/CCF/CCF/IDL2/Parser.cpp @@ -502,12 +502,14 @@ namespace CCF guard ( assertion ("declaration or include directive expected", + RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( (+import >> *declaration) | +declaration ) >> assertion ("declaration or include directive expected", + RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( EOS @@ -516,6 +518,16 @@ namespace CCF )[root_error_handler] // Stops bailing out (rethrowing). ; + + /* + language = + guard + ( + +(*import >> (+declaration)) >> EOS + ) + ; + */ + import = include_decl ; @@ -527,10 +539,10 @@ namespace CCF >> SEMI[act_include_end] ; - // There are two classes of types: The first class includes - // interface and valuetype. The second class includes all - // other types like struct, etc. I wonder how I can represent - // it in the grammar. + // There are two classes of types: First class include + // interface and valuetype. Seond class include all other + // types like struct, etc. I wonder how I can represent it + // in the grammar. // declaration = @@ -557,54 +569,20 @@ namespace CCF type_id_decl = TYPEID - >> guard - ( - ( - assertion ("type name expected") - ( - identifier - ) - >> assertion ("string literal expected", - DiagnosticType::BEFORE) - ( - string_literal - ) - )[act_type_id_begin] - - >> assertion ("';' expected", - f.type_id (), - &SemanticAction::TypeId::end, - RecoveryMethod::NONE) - ( - SEMI[act_type_id_end] - ) - )[error_handler] + >> ( + identifier + >> string_literal + )[act_type_id_begin] + >> SEMI[act_type_id_end] ; type_prefix_decl = TYPEPREFIX - >> guard - ( - ( - assertion ("type name expected") - ( - identifier - ) - >> assertion ("string literal expected", - DiagnosticType::BEFORE) - ( - string_literal - ) - )[act_type_prefix_begin] - - >> assertion ("';' expected", - f.type_prefix (), - &SemanticAction::TypePrefix::end, - RecoveryMethod::NONE) - ( - SEMI[act_type_prefix_end] - ) - )[error_handler] + >> ( + identifier + >> string_literal + )[act_type_prefix_begin] + >> SEMI[act_type_prefix_end] ; abstract_type_decl = @@ -613,9 +591,9 @@ namespace CCF ( assertion ("interface or valuetype declaration expected") ( - (INTERFACE >> abstract_interface_decl) + (INTERFACE >> assertion ()(abstract_interface_decl)) | - (VALUETYPE >> abstract_value_type_decl) + (VALUETYPE >> assertion ()(abstract_value_type_decl)) ) )[error_handler] ; @@ -626,7 +604,7 @@ namespace CCF ( assertion ("interface declaration expected") ( - INTERFACE >> local_interface_decl + INTERFACE >> assertion ()(local_interface_decl) ) )[error_handler] ; @@ -639,7 +617,7 @@ namespace CCF ( simple_identifier[act_module_begin] ) - >> assertion ("'{' expected", + >> assertion ("\'{\' expected", f.module (), &SemanticAction::Module::end) ( @@ -649,6 +627,7 @@ namespace CCF f.module (), &SemanticAction::Module::close_scope, &SemanticAction::Module::end, + RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( hood (+declaration) @@ -658,15 +637,16 @@ namespace CCF &SemanticAction::Module::end) ] ) - >> assertion ("declaration or '}' expected", + >> assertion ("declaration or \'}\' expected", f.module (), &SemanticAction::Module::close_scope, &SemanticAction::Module::end, + RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( RCBRACE[act_module_close_scope] ) - >> assertion ("';' expected", + >> assertion ("\';\' is missing", f.module (), &SemanticAction::Module::end, RecoveryMethod::NONE) @@ -681,33 +661,10 @@ namespace CCF // const_decl = CONST - >> guard - ( - ( - assertion ("type name expected") - ( - identifier - ) - >> assertion ("const name expected", - DiagnosticType::BEFORE) - ( - simple_identifier - ) - )[act_const_begin] - >> assertion ("'=' expected") - ( - EQ[act_const_expr_flush] // flush expression stacks - ) - >> assertion ("const expression expected") - ( - const_expr[act_const_expr] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> (identifier >> simple_identifier)[act_const_begin] + >> EQ[act_const_expr_flush] // flush expression stacks + >> const_expr[act_const_expr] + >> SEMI ; @@ -726,26 +683,16 @@ namespace CCF character_const_expr = character_literal; - string_const_expr = string_literal; - // // - numeric_const_expr = - guard - ( - numeric_or_expr - )[error_handler] - ; + numeric_const_expr = numeric_or_expr; numeric_or_expr = numeric_xor_expr >> *( OR[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_xor_expr - ) + >> numeric_xor_expr )[act_numeric_expression_or] ; @@ -753,10 +700,7 @@ namespace CCF numeric_and_expr >> *( XOR[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_and_expr - ) + >> numeric_and_expr )[act_numeric_expression_xor] ; @@ -765,10 +709,7 @@ namespace CCF numeric_shift_expr >> *( AND[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_shift_expr - ) + >> numeric_shift_expr )[act_numeric_expression_and] ; @@ -777,18 +718,12 @@ namespace CCF >> *( ( RSH[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_add_expr - ) + >> numeric_add_expr )[act_numeric_expression_rsh] | ( LSH[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_add_expr - ) + >> numeric_add_expr )[act_numeric_expression_lsh] ) ; @@ -797,18 +732,12 @@ namespace CCF numeric_mul_expr >> *( ( ADD[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_mul_expr - ) + >> numeric_mul_expr )[act_numeric_expression_add] | ( SUB[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_mul_expr - ) + >> numeric_mul_expr )[act_numeric_expression_sub] ) ; @@ -817,26 +746,17 @@ namespace CCF numeric_unary_expr >> *( ( MUL[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_unary_expr - ) + >> numeric_unary_expr )[act_numeric_expression_mul] | ( DIV[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_unary_expr - ) + >> numeric_unary_expr )[act_numeric_expression_div] | ( REM[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_unary_expr - ) + >> numeric_unary_expr )[act_numeric_expression_rem] ) ; @@ -845,84 +765,40 @@ namespace CCF numeric_primary_expr | ADD[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_primary_expr[act_numeric_expression_pos] - ) + >> numeric_primary_expr[act_numeric_expression_pos] | SUB[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_primary_expr[act_numeric_expression_neg] - ) + >> numeric_primary_expr[act_numeric_expression_neg] | COM[act_numeric_expression_pre] - >> assertion ("expression expected") - ( - numeric_primary_expr[act_numeric_expression_com] - ) + >> numeric_primary_expr[act_numeric_expression_com] ; numeric_primary_expr = identifier[act_numeric_expression_const] | integer_literal[act_numeric_expression_integer_literal] - | LPAREN - >> assertion ("expression expected") - ( - numeric_const_expr - ) - >> assertion ("')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) + | LPAREN >> numeric_const_expr >> RPAREN ; + // + // + string_const_expr = string_literal; + + // enum // // enum_decl = ENUM - >> guard - ( - assertion ("enum name expected") - ( - simple_identifier[act_enum_begin] - ) - >> hood - ( - assertion ("'{' expected") - ( - LCBRACE - ) - >> enumerator_decl >> *(COMMA >> enumerator_decl) - >> assertion ("',' or '}' expected", - DiagnosticType::BEFORE) - ( - RCBRACE - ) - ) - [ - handler (f.enum_ (), - &SemanticAction::Enum::end) - ] - >> assertion ("';' expected", - f.enum_ (), - &SemanticAction::Enum::end, - RecoveryMethod::NONE) - ( - SEMI[act_enum_end] - ) - )[error_handler] + >> simple_identifier[act_enum_begin] + >> LCBRACE + >> enumerator_decl >> *(COMMA >> enumerator_decl) + >> RCBRACE + >> SEMI[act_enum_end] ; - enumerator_decl = - assertion ("enumerator name expected") - ( - simple_identifier[act_enum_enumerator] - ) - ; + enumerator_decl = identifier[act_enum_enumerator]; // interface @@ -931,231 +807,84 @@ namespace CCF abstract_interface_decl = guard ( - assertion ("abstract interface declaration expected", - DiagnosticType::BEFORE) - ( - ( + ( + simple_identifier + >> SEMI + )[act_interface_begin_abstract_fwd][act_interface_end] + | + ( + ( simple_identifier - >> SEMI - )[act_interface_begin_abstract_fwd][act_interface_end] - | - ( - ( - simple_identifier - >> COLON - )[act_interface_begin_abstract_def] + >> COLON + )[act_interface_begin_abstract_def] - >> hood - ( - interface_inheritance_spec - >> assertion ("'{' expected") - ( - LCBRACE[act_interface_open_scope] - ) - >> hood (interface_body) - [ - handler (f.interface (), - &SemanticAction::Interface::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.interface (), - &SemanticAction::Interface::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_interface_close_scope] - ) - ) - [ - handler (f.interface (), - &SemanticAction::Interface::end) - ] - - >> assertion ("';' expected", - f.interface (), - &SemanticAction::Interface::end, - RecoveryMethod::NONE) - ( - SEMI[act_interface_end] - ) - ) - | - ( - ( - simple_identifier - >> LCBRACE - )[act_interface_begin_abstract_def][act_interface_open_scope] + >> interface_inheritance_spec + >> LCBRACE[act_interface_open_scope] + >> interface_def_trailer + ) + | + ( + ( + simple_identifier + >> LCBRACE + )[act_interface_begin_abstract_def][act_interface_open_scope] - >> hood - ( - hood (interface_body) - [ - handler (f.interface (), - &SemanticAction::Interface::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.interface (), - &SemanticAction::Interface::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_interface_close_scope] - ) - ) - [ - handler (f.interface (), - &SemanticAction::Interface::end) - ] - - >> assertion ("';' expected", - f.interface (), - &SemanticAction::Interface::end, - RecoveryMethod::NONE) - ( - SEMI[act_interface_end] - ) - ) - ) + >> interface_def_trailer + ) )[error_handler] ; + local_interface_decl = guard ( - assertion ("local interface declaration expected", - DiagnosticType::BEFORE) - ( - ( + ( + simple_identifier + >> SEMI + )[act_interface_begin_local_fwd][act_interface_end] + | + ( + ( simple_identifier - >> SEMI - )[act_interface_begin_local_fwd][act_interface_end] - | - ( - ( - simple_identifier - >> COLON - )[act_interface_begin_local_def] + >> COLON + )[act_interface_begin_local_def] - >> hood - ( - interface_inheritance_spec - >> assertion ("'{' expected") - ( - LCBRACE[act_interface_open_scope] - ) - >> hood (interface_body) - [ - handler (f.interface (), - &SemanticAction::Interface::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.interface (), - &SemanticAction::Interface::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_interface_close_scope] - ) - ) - [ - handler (f.interface (), - &SemanticAction::Interface::end) - ] - - >> assertion ("';' expected", - f.interface (), - &SemanticAction::Interface::end, - RecoveryMethod::NONE) - ( - SEMI[act_interface_end] - ) - ) - | - ( - ( - simple_identifier - >> LCBRACE - )[act_interface_begin_local_def][act_interface_open_scope] + >> interface_inheritance_spec + >> LCBRACE[act_interface_open_scope] + >> interface_def_trailer + ) + | + ( + ( + simple_identifier + >> LCBRACE + )[act_interface_begin_local_def][act_interface_open_scope] - >> hood - ( - hood (interface_body) - [ - handler (f.interface (), - &SemanticAction::Interface::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.interface (), - &SemanticAction::Interface::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_interface_close_scope] - ) - ) - [ - handler (f.interface (), - &SemanticAction::Interface::end) - ] - - >> assertion ("';' expected", - f.interface (), - &SemanticAction::Interface::end, - RecoveryMethod::NONE) - ( - SEMI[act_interface_end] - ) - ) - ) + >> interface_def_trailer + ) )[error_handler] ; + unconstrained_interface_decl = - INTERFACE - >> guard - ( - assertion ("interface declaration expected", - DiagnosticType::BEFORE) - ( + guard + ( + INTERFACE + >> ( ( - simple_identifier - >> SEMI + simple_identifier + >> SEMI )[act_interface_begin_unconstrained_fwd][act_interface_end] | ( ( - simple_identifier - >> COLON + simple_identifier + >> COLON )[act_interface_begin_unconstrained_def] - >> hood - ( - interface_inheritance_spec - >> assertion ("'{' expected") - ( - LCBRACE[act_interface_open_scope] - ) - >> hood (interface_body) - [ - handler (f.interface (), - &SemanticAction::Interface::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.interface (), - &SemanticAction::Interface::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_interface_close_scope] - ) - ) - [ - handler (f.interface (), - &SemanticAction::Interface::end) - ] - - >> assertion ("';' expected", - f.interface (), - &SemanticAction::Interface::end, - RecoveryMethod::NONE) - ( - SEMI[act_interface_end] - ) + >> interface_inheritance_spec + >> LCBRACE[act_interface_open_scope] + >> interface_def_trailer ) | ( @@ -1164,54 +893,83 @@ namespace CCF >> LCBRACE )[act_interface_begin_unconstrained_def][act_interface_open_scope] - >> hood - ( - hood (interface_body) - [ - handler (f.interface (), - &SemanticAction::Interface::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.interface (), - &SemanticAction::Interface::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_interface_close_scope] - ) - ) - [ - handler (f.interface (), - &SemanticAction::Interface::end) - ] - - >> assertion ("';' expected", - f.interface (), - &SemanticAction::Interface::end, - RecoveryMethod::NONE) - ( - SEMI[act_interface_end] - ) + >> interface_def_trailer ) ) - )[error_handler] + )[error_handler] ; interface_inheritance_spec = - guard + assertion ("interface name expected", + f.interface (), + &SemanticAction::Interface::end) + ( + identifier[act_interface_inherits] + ) + >> *( + COMMA + >> assertion ("interface name expected", + f.interface (), + &SemanticAction::Interface::end) + ( + identifier[act_interface_inherits] + ) + ) + ; + + interface_def_trailer = + interface_body + >> assertion ("declaration or \'}\' expected", + f.interface (), + &SemanticAction::Interface::close_scope, + &SemanticAction::Interface::end, + RecoveryMethod::STANDARD, + DiagnosticType::BEFORE) + ( + RCBRACE[act_interface_close_scope] + ) + >> assertion ("\';\' is missing", + f.interface (), + &SemanticAction::Interface::end, + RecoveryMethod::NONE) + ( + SEMI[act_interface_end] + ) + ; + + /* + + interface_decl_trailer = + assertion ("\';\', \'{\' or inheritance specification expected", + f.interface (), + &SemanticAction::Interface::end) ( - assertion ("base interface name expected") - ( - identifier[act_interface_inherits] - ) - >> *( - COMMA - >> assertion ("base eventtype name expected") - ( - identifier[act_interface_inherits] - ) - ) - )[error_handler] + SEMI[act_interface_end] + | + ( + !(COLON >> interface_inheritance_spec) + >> LCBRACE[act_interface_open_scope] + >> interface_body + >> assertion ("declaration or \'}\' expected", + f.interface (), + &SemanticAction::Interface::close_scope, + &SemanticAction::Interface::end, + RecoveryMethod::STANDARD, + DiagnosticType::BEFORE) + ( + RCBRACE[act_interface_close_scope] + ) + >> assertion ("\';\' is missing", + f.interface (), + &SemanticAction::Interface::end, + RecoveryMethod::NONE) + ( + SEMI[act_interface_end] + ) + ) + ) ; + */ interface_body = *( @@ -1230,154 +988,58 @@ namespace CCF // // attribute_decl = - guard - ( - ( - ( - READONLY - >> assertion ("'attribute' expected") - ( - ATTRIBUTE - ) - )[act_attribute_begin_ro] - - >> hood (attribute_ro_decl_trailer) - [ - handler (f.attribute (), - &SemanticAction::Attribute::end) - ] - >> assertion ("';' expected", - f.attribute (), - &SemanticAction::Attribute::end, - RecoveryMethod::NONE) - ( - SEMI[act_attribute_end] - ) - ) - | - ( - ATTRIBUTE[act_attribute_begin_rw] - >> hood (attribute_rw_decl_trailer) - [ - handler (f.attribute (), - &SemanticAction::Attribute::end) - ] - >> assertion ("';' expected", - f.attribute (), - &SemanticAction::Attribute::end, - RecoveryMethod::NONE) - ( - SEMI[act_attribute_end] - ) - ) - )[error_handler] + ( + (READONLY >> ATTRIBUTE)[act_attribute_begin_ro] + >> attribute_ro_decl_trailer + ) + | + ( + ATTRIBUTE[act_attribute_begin_rw] + >> attribute_rw_decl_trailer + ) ; attribute_ro_decl_trailer = - assertion ("attribute type name expected") - ( - identifier[act_attribute_type] - ) - >> assertion ("attribute name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_attribute_name] - ) + identifier[act_attribute_type] + >> simple_identifier[act_attribute_name] >> !( - attribute_ro_raises_spec + (RAISES >> LPAREN >> attribute_get_raises_list >> RPAREN) | - +( - COMMA - >> assertion ("attribute name expected") - ( - simple_identifier[act_attribute_name] - ) - ) + +(COMMA >> simple_identifier[act_attribute_name]) ) + >> SEMI[act_attribute_end] ; attribute_rw_decl_trailer = - assertion ("attribute type name expected") - ( - identifier[act_attribute_type] - ) - >> assertion ("attribute name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_attribute_name] - ) + identifier[act_attribute_type] + >> simple_identifier[act_attribute_name] >> !( attribute_rw_raises_spec | - +( - COMMA - >> assertion ("attribute name expected") - ( - simple_identifier[act_attribute_name] - ) - ) + +(COMMA >> simple_identifier[act_attribute_name]) ) + >> SEMI[act_attribute_end] ; - attribute_ro_raises_spec = - RAISES - >> attribute_get_raises_list; - - attribute_rw_raises_spec = ( - (GETRAISES >> attribute_get_raises_list) - >> !(SETRAISES >> attribute_set_raises_list) + (GETRAISES >> LPAREN >> attribute_get_raises_list >> RPAREN) + >> !(SETRAISES >> LPAREN >> attribute_set_raises_list >> RPAREN) ) | - (SETRAISES >> attribute_set_raises_list) + (SETRAISES >> LPAREN >> attribute_set_raises_list >> RPAREN) ; attribute_get_raises_list = - assertion ("'(' expected") - ( - LPAREN - ) - >> assertion ("exception name expected") - ( - identifier[act_attribute_get_raises] - ) - >> *( - COMMA - >> assertion ("exception name expected") - ( - identifier[act_attribute_get_raises] - ) - ) - >> assertion ("',' or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) + identifier[act_attribute_get_raises] + >> *(COMMA >> identifier[act_attribute_get_raises]) ; + attribute_set_raises_list = - assertion ("'(' expected") - ( - LPAREN - ) - >> assertion ("exception name expected") - ( - identifier[act_attribute_set_raises] - ) - >> *( - COMMA - >> assertion ("exception name expected") - ( - identifier[act_attribute_set_raises] - ) - ) - >> assertion ("',' or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) + identifier[act_attribute_set_raises] + >> *(COMMA >> identifier[act_attribute_set_raises]) ; @@ -1386,43 +1048,11 @@ namespace CCF // exception_decl = EXCEPTION - >> guard - ( - assertion ("exception name expected") - ( - simple_identifier[act_exception_begin] - ) - >> hood - ( - assertion ("'{' expected") - ( - LCBRACE[act_exception_open_scope] - ) - >> hood (exception_body) - [ - handler (f.exception (), - &SemanticAction::Exception::close_scope) - ] - >> assertion ("member declaration or '}' expected", - f.exception (), - &SemanticAction::Exception::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_exception_close_scope] - ) - ) - [ - handler (f.exception (), - &SemanticAction::Exception::end) - ] - >> assertion ("';' expected", - f.exception (), - &SemanticAction::Exception::end, - RecoveryMethod::NONE) - ( - SEMI[act_exception_end] - ) - )[error_handler] + >> simple_identifier[act_exception_begin] + >> LCBRACE[act_exception_open_scope] + >> exception_body + >> RCBRACE[act_exception_close_scope] + >> SEMI[act_exception_end] ; exception_body = @@ -1445,34 +1075,9 @@ namespace CCF // member_decl = identifier[act_member_type] - >> guard - ( - hood - ( - assertion ("member name expected") - ( - simple_identifier[act_member_name] - ) - >> *( - COMMA - >> assertion ("member name expected") - ( - simple_identifier[act_member_name] - ) - ) - ) - [ - handler (f.member (), - &SemanticAction::Member::end) - ] - >> assertion ("';' expected", - f.member (), - &SemanticAction::Member::end, - RecoveryMethod::NONE) - ( - SEMI[act_member_end] - ) - )[error_handler] + >> simple_identifier[act_member_name] + >> *(COMMA >> simple_identifier[act_member_name]) + >> SEMI[act_member_end] ; // native @@ -1480,20 +1085,8 @@ namespace CCF // native_decl = NATIVE - >> guard - ( - assertion ("native name expected") - ( - simple_identifier[act_native_name] - ) - >> assertion ("';' expected", - f.native (), - &SemanticAction::Native::end, - RecoveryMethod::NONE) - ( - SEMI[act_native_end] - ) - )[error_handler] + >> simple_identifier[act_native_name] + >> SEMI[act_native_end] ; @@ -1501,102 +1094,47 @@ namespace CCF // // operation_decl = - guard - ( - ( - ( - ONEWAY[act_operation_one_way] - >> assertion ("operation return type name expected") - ( - identifier[act_operation_type] - ) - ) - | - ( - identifier[act_operation_two_way][act_operation_type] - ) - ) - >> operation_decl_trailer - )[error_handler] + ( + ( + ONEWAY[act_operation_one_way] + >> identifier[act_operation_type] + ) + | + ( + identifier[act_operation_two_way][act_operation_type] + ) + ) + >> operation_decl_trailer ; operation_decl_trailer = - assertion ("operation name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_operation_name] - ) - >> assertion ("'(' expected") - ( - LPAREN - ) + simple_identifier[act_operation_name] + >> LPAREN >> operation_parameter_list - >> assertion ("parameter declaration or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - >> !( - RAISES - >> assertion ("'(' expected") - ( - LPAREN - ) - >> operation_raises_list - >> assertion ("',' or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) + >> RPAREN + >> !(RAISES >> LPAREN >> operation_raises_list >> RPAREN) + >> SEMI ; operation_parameter_list = *( operation_parameter - >> *( - COMMA - >> assertion ("parameter declaration expected") - ( - operation_parameter - ) - ) + >> *(COMMA >> operation_parameter) ) ; operation_parameter = ( direction_specifier - >> assertion ("parameter type name expected") - ( - identifier - ) - >> assertion ("parameter name expected", - DiagnosticType::BEFORE) - ( - simple_identifier - ) + >> identifier + >> simple_identifier )[act_operation_parameter] ; operation_raises_list = - assertion ("exception name expected") - ( - identifier[act_operation_raises] - ) - >> *( - COMMA - >> assertion ("exception name expected") - ( - identifier[act_operation_raises] - ) - ) + identifier[act_operation_raises] + >> *(COMMA >> identifier[act_operation_raises]) ; @@ -1604,60 +1142,59 @@ namespace CCF // // struct_decl = - STRUCT - >> guard - ( - assertion ("struct declaration expected", - DiagnosticType::BEFORE) - ( + guard + ( + STRUCT + >> ( ( simple_identifier >> SEMI )[act_struct_begin_fwd][act_struct_end] | ( - ( - simple_identifier - >> LCBRACE - )[act_struct_begin_def][act_struct_open_scope] - >> hood - ( - hood - ( - assertion ("member declaration expected", - DiagnosticType::BEFORE) - ( - struct_body - ) - ) - [ - handler (f.struct_ (), - &SemanticAction::Struct::close_scope) - ] - >> assertion ("member declaration or '}' expected", - f.struct_ (), - &SemanticAction::Struct::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_struct_close_scope] - ) - ) - [ - handler (f.struct_ (), - &SemanticAction::Struct::end) - ] - >> assertion ("';' expected", - f.struct_ (), - &SemanticAction::Struct::end, - RecoveryMethod::NONE) - ( - SEMI[act_struct_end] - ) + ( + simple_identifier + >> LCBRACE + )[act_struct_begin_def][act_struct_open_scope] + >> struct_def_trailer ) ) - )[error_handler] + )[error_handler] + ; + + /* + struct_decl = + STRUCT + >> simple_identifier + >> LCBRACE + >> struct_body + >> RCBRACE + >> SEMI + ; + */ + + + struct_def_trailer = + struct_body + >> assertion ("member or \'}\' expected", + f.struct_ (), + &SemanticAction::Struct::close_scope, + &SemanticAction::Struct::end, + RecoveryMethod::STANDARD, + DiagnosticType::BEFORE) + ( + RCBRACE[act_struct_close_scope] + ) + >> assertion ("\';\' is missing", + f.struct_ (), + &SemanticAction::Struct::end, + RecoveryMethod::NONE) + ( + SEMI[act_struct_end] + ) ; + struct_body = +member_decl ; @@ -1669,59 +1206,21 @@ namespace CCF typedef_decl = TYPEDEF[act_typedef_pre] - >> guard - ( - assertion ("type name expected") - ( - typedef_type_spec - ) - >> typedef_declarator - >> *(COMMA >> typedef_declarator) - >> assertion ("';' expected", - f.typedef_ (), - &SemanticAction::Typedef::end, - RecoveryMethod::NONE) - ( - SEMI[act_typedef_end] - ) - )[error_handler] + >> typedef_type_spec + >> typedef_declarator + >> *(COMMA >> typedef_declarator) + >> SEMI[act_typedef_end] ; typedef_declarator = - ( - assertion ("typedef name expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - simple_identifier - ) + ( simple_identifier >> !( LSBRACE[act_typedef_begin_array][act_const_expr_flush] - >> assertion ("const expression expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - numeric_const_expr[act_typedef_bound] - ) - >> assertion ("']' expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - RSBRACE - ) + >> numeric_const_expr[act_typedef_bound] + >> RSBRACE ) >> *( LSBRACE[act_const_expr_flush] - >> assertion ("const expression expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - numeric_const_expr[act_typedef_bound] - ) - >> assertion ("']' expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - RSBRACE - ) + >> numeric_const_expr[act_typedef_bound] + >> RSBRACE ) )[act_typedef_declarator] ; @@ -1731,88 +1230,43 @@ namespace CCF | ( SEQUENCE - >> assertion ("'<' expected") + >> LT + >> ( - LT - ) - >> ( (identifier >> GT)[act_typedef_begin_unbounded_seq] | ( - assertion ("sequence type name expected") - ( - identifier[act_typedef_begin_bounded_seq] - ) - >> assertion ("'>' or ',' expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - COMMA[act_const_expr_flush] // flush expression stacks - ) - >> assertion ("const expression expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - numeric_const_expr[act_typedef_bound] - ) - >> assertion ("'>' expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - GT - ) + identifier[act_typedef_begin_bounded_seq] + >> COMMA[act_const_expr_flush] // flush expression stacks + >> numeric_const_expr[act_typedef_bound] + >> GT ) ) ) | ( STRING - >> assertion ("'<' expected") - ( - LT[act_const_expr_flush] // flush expression stacks - ) - >> assertion ("const expression expected") - ( - numeric_const_expr[act_typedef_begin_bounded_string] - ) - >> assertion ("'>' expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - GT - ) + >> LT[act_const_expr_flush] // flush expression stacks + >> numeric_const_expr[act_typedef_begin_bounded_string] + >> GT ) | ( WSTRING - >> assertion ("'<' expected") - ( - LT[act_const_expr_flush] // flush expression stacks - ) - >> assertion ("const expression expected") - ( - numeric_const_expr[act_typedef_begin_bounded_wstring] - ) - >> assertion ("'>' expected", - f.typedef_ (), - &SemanticAction::Typedef::end) - ( - GT - ) + >> LT[act_const_expr_flush] // flush expression stacks + >> numeric_const_expr[act_typedef_begin_bounded_wstring] + >> GT ) ; // union // // - union_decl = - UNION - >> guard - ( - assertion ("union declaration expected", - DiagnosticType::BEFORE) - ( + guard + ( + UNION + >> ( ( simple_identifier >> SEMI @@ -1823,403 +1277,167 @@ namespace CCF simple_identifier >> SWITCH )[act_union_begin_def] - - >> hood (union_def_trailer) - [ - handler (f.union_ (), - &SemanticAction::Union::end) - ] - >> assertion ("';' expected", - f.union_ (), - &SemanticAction::Union::end, - RecoveryMethod::NONE) - ( - SEMI[act_union_end] - ) + >> union_def_trailer ) ) - )[error_handler] + )[error_handler] ; union_def_trailer = - assertion ("'(' expected") - ( - LPAREN - ) - >> assertion ("discriminator type name expected") - ( - identifier[act_union_type] - ) - >> assertion ("')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - >> assertion ("'{' expected") - ( - LCBRACE[act_union_open_scope] - ) - >> hood - ( - assertion ("case statement expected") - ( - union_body - ) - ) - [ - handler (f.union_ (), - &SemanticAction::Union::close_scope) - ] - >> assertion ("case statement or \'}\' expected", + LPAREN + >> identifier[act_union_type] + >> RPAREN + >> LCBRACE[act_union_open_scope] + >> union_body + >> assertion ("member or \'}\' expected", f.union_ (), &SemanticAction::Union::close_scope, + &SemanticAction::Union::end, + RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( RCBRACE[act_union_close_scope] ) + >> assertion ("\';\' is missing", + f.union_ (), + &SemanticAction::Union::end, + RecoveryMethod::NONE) + ( + SEMI[act_union_end] + ) ; union_body = - +guard - ( + +( +union_case_label - >> assertion ("type name expected", - DiagnosticType::BEFORE) - ( - identifier[act_union_member_type] - ) - >> assertion ("member name expected") - ( - simple_identifier[act_union_member_name] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> identifier[act_union_member_type] + >> simple_identifier[act_union_member_name] + >> SEMI + ) ; union_case_label = ( CASE[act_const_expr_flush] // flush expression stacks - >> assertion ("const expression expected") - ( - const_expr - ) - >> assertion ("':' expected") - ( - COLON - ) + >> const_expr + >> COLON ) | - ( DEFAULT - >> assertion ("':' expected") - ( - COLON - ) - ) + (DEFAULT >> COLON) ; - // valuetype // // abstract_value_type_decl = guard ( - assertion ("abstract valuetype declaration expected", - DiagnosticType::BEFORE) - ( - ( + ( + simple_identifier + >> SEMI + )[act_value_type_begin_abstract_fwd][act_value_type_end] + | + ( + ( simple_identifier - >> SEMI - )[act_value_type_begin_abstract_fwd][act_value_type_end] - | - ( - ( - simple_identifier - >> COLON - )[act_value_type_begin_abstract_def] + >> COLON + )[act_value_type_begin_abstract_def] - >> hood - ( - value_type_inheritance_spec - >> !(SUPPORTS >> value_type_supports_spec) - >> assertion ("'{' expected") - ( - LCBRACE[act_value_type_open_scope] - ) - >> hood (value_type_body) - [ - handler (f.value_type (), - &SemanticAction::ValueType::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.value_type (), - &SemanticAction::ValueType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_value_type_close_scope] - ) - ) - [ - handler (f.value_type (), - &SemanticAction::ValueType::end) - ] - - >> assertion ("';' expected", - f.value_type (), - &SemanticAction::ValueType::end, - RecoveryMethod::NONE) - ( - SEMI[act_value_type_end] - ) - ) - | - ( - ( - simple_identifier - >> SUPPORTS - )[act_value_type_begin_abstract_def] + >> value_type_inheritance_spec + >> !(SUPPORTS >> value_type_supports_spec) + >> LCBRACE[act_value_type_open_scope] + >> value_type_def_trailer + ) + | + ( + ( + simple_identifier + >> SUPPORTS + )[act_value_type_begin_abstract_def] - >> hood - ( - value_type_supports_spec - >> assertion ("'{' expected") - ( - LCBRACE[act_value_type_open_scope] - ) - >> hood (value_type_body) - [ - handler (f.value_type (), - &SemanticAction::ValueType::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.value_type (), - &SemanticAction::ValueType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_value_type_close_scope] - ) - ) - [ - handler (f.value_type (), - &SemanticAction::ValueType::end) - ] - - >> assertion ("';' expected", - f.value_type (), - &SemanticAction::ValueType::end, - RecoveryMethod::NONE) - ( - SEMI[act_value_type_end] - ) - ) - | - ( - ( - simple_identifier - >> LCBRACE - )[act_value_type_begin_abstract_def][act_value_type_open_scope] + >> value_type_supports_spec + >> LCBRACE[act_value_type_open_scope] + >> value_type_def_trailer + ) + | + ( + ( + simple_identifier + >> LCBRACE + )[act_value_type_begin_abstract_def][act_value_type_open_scope] - >> hood - ( - hood (value_type_body) - [ - handler (f.value_type (), - &SemanticAction::ValueType::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.value_type (), - &SemanticAction::ValueType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_value_type_close_scope] - ) - ) - [ - handler (f.value_type (), - &SemanticAction::ValueType::end) - ] - - >> assertion ("';' expected", - f.value_type (), - &SemanticAction::ValueType::end, - RecoveryMethod::NONE) - ( - SEMI[act_value_type_end] - ) - ) - ) + >> value_type_def_trailer + ) )[error_handler] ; - concrete_value_type_decl = - VALUETYPE - >> guard - ( - assertion ("valuetype declaration expected", - DiagnosticType::BEFORE) - ( - ( - simple_identifier - >> SEMI - )[act_value_type_begin_concrete_fwd][act_value_type_end] - | - ( - ( - simple_identifier - >> COLON - )[act_value_type_begin_concrete_def] - - >> hood - ( - value_type_inheritance_spec - >> !(SUPPORTS >> value_type_supports_spec) - >> assertion ("'{' expected") - ( - LCBRACE[act_value_type_open_scope] - ) - >> hood (value_type_body) - [ - handler (f.value_type (), - &SemanticAction::ValueType::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.value_type (), - &SemanticAction::ValueType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_value_type_close_scope] - ) - ) - [ - handler (f.value_type (), - &SemanticAction::ValueType::end) - ] - - >> assertion ("';' expected", - f.value_type (), - &SemanticAction::ValueType::end, - RecoveryMethod::NONE) - ( - SEMI[act_value_type_end] - ) - ) - | - ( - ( - simple_identifier - >> SUPPORTS - )[act_value_type_begin_concrete_def] - - >> hood - ( - value_type_supports_spec - >> assertion ("'{' expected") - ( - LCBRACE[act_value_type_open_scope] - ) - >> hood (value_type_body) - [ - handler (f.value_type (), - &SemanticAction::ValueType::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.value_type (), - &SemanticAction::ValueType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_value_type_close_scope] - ) - ) - [ - handler (f.value_type (), - &SemanticAction::ValueType::end) - ] - - >> assertion ("';' expected", - f.value_type (), - &SemanticAction::ValueType::end, - RecoveryMethod::NONE) - ( - SEMI[act_value_type_end] - ) - ) - | - ( - ( - simple_identifier - >> LCBRACE - )[act_value_type_begin_concrete_def][act_value_type_open_scope] - - >> hood - ( - hood (value_type_body) - [ - handler (f.value_type (), - &SemanticAction::ValueType::close_scope) - ] - >> assertion ("declaration or '}' expected", - f.value_type (), - &SemanticAction::ValueType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_value_type_close_scope] - ) - ) - [ - handler (f.value_type (), - &SemanticAction::ValueType::end) - ] - - >> assertion ("';' expected", - f.value_type (), - &SemanticAction::ValueType::end, - RecoveryMethod::NONE) - ( - SEMI[act_value_type_end] - ) - ) - ) - )[error_handler] - ; - - value_type_inheritance_spec = guard ( - assertion ("base valuetype name expected") - ( - identifier[act_value_type_inherits] - ) - >> *( - COMMA - >> assertion ("base valuetype name expected") - ( - identifier[act_value_type_inherits] - ) - ) + VALUETYPE + >> ( + ( + simple_identifier + >> SEMI + )[act_value_type_begin_concrete_fwd][act_value_type_end] + | + ( + ( + simple_identifier + >> COLON + )[act_value_type_begin_concrete_def] + + >> value_type_inheritance_spec + >> !(SUPPORTS >> value_type_supports_spec) + >> LCBRACE[act_value_type_open_scope] + >> value_type_def_trailer + ) + | + ( + ( + simple_identifier + >> SUPPORTS + )[act_value_type_begin_concrete_def] + + >> value_type_supports_spec + >> LCBRACE[act_value_type_open_scope] + >> value_type_def_trailer + ) + | + ( + ( + simple_identifier + >> LCBRACE + )[act_value_type_begin_concrete_def][act_value_type_open_scope] + + >> value_type_def_trailer + ) + ) )[error_handler] ; + + value_type_inheritance_spec = + identifier[act_value_type_inherits] + >> *( + COMMA + >> identifier[act_value_type_inherits] + ) + ; + value_type_supports_spec = - guard - ( - assertion ("supported interface name expected") - ( - identifier[act_value_type_supports] - ) - >> *( - COMMA - >> assertion ("supported interface name expected") - ( - identifier[act_value_type_supports] - ) - ) - )[error_handler] + identifier[act_value_type_supports] + >> *( + COMMA + >> identifier[act_value_type_supports] + ) + ; + + value_type_def_trailer = + value_type_body + >> RCBRACE[act_value_type_close_scope] + >> SEMI[act_value_type_end] ; value_type_body = @@ -2242,41 +1460,12 @@ namespace CCF // value_type_factory_decl = FACTORY - >> guard - ( - assertion ("factory name expected") - ( - simple_identifier[act_value_type_factory_name] - ) - >> assertion ("'(' expected") - ( - LPAREN - ) - >> value_type_factory_parameter_list - >> assertion ("parameter declaration or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - >> !( - RAISES - >> assertion ("'(' expected") - ( - LPAREN - ) - >> value_type_factory_raises_list - >> assertion ("',' or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> simple_identifier[act_value_type_factory_name] + >> LPAREN + >> value_type_factory_parameter_list + >> RPAREN + >> !(RAISES >> LPAREN >> value_type_factory_raises_list >> RPAREN) + >> SEMI ; value_type_factory_parameter_list = @@ -2288,37 +1477,12 @@ namespace CCF value_type_factory_parameter = IN - >> guard - ( - ( - assertion ("type name expected") - ( - identifier - ) - >> assertion ("parameter name expected", - DiagnosticType::BEFORE) - ( - simple_identifier - ) - )[act_value_type_factory_parameter] - )[error_handler] + >> (identifier >> simple_identifier)[act_value_type_factory_parameter] ; value_type_factory_raises_list = - guard - ( - assertion ("exception name expected") - ( - identifier[act_value_type_factory_raises] - ) - >> *( - COMMA - >> assertion ("exception name expected") - ( - identifier[act_value_type_factory_raises] - ) - ) - )[error_handler] + identifier[act_value_type_factory_raises] + >> *(COMMA >> identifier[act_value_type_factory_raises]) ; @@ -2330,30 +1494,10 @@ namespace CCF PUBLIC[act_value_type_member_begin_public] | PRIVATE[act_value_type_member_begin_private] ) - >> guard - ( - assertion ("type name expected") - ( - identifier[act_value_type_member_type] - ) - >> assertion ("member name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_value_type_member_name] - ) - >> *( - COMMA - >> assertion ("member name expected") - ( - simple_identifier[act_value_type_member_name] - ) - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> identifier[act_value_type_member_type] + >> simple_identifier[act_value_type_member_name] + >> *(COMMA >> simple_identifier[act_value_type_member_name]) + >> SEMI[act_value_type_member_end] ; } } diff --git a/modules/CIAO/CCF/CCF/IDL2/Parser.hpp b/modules/CIAO/CCF/CCF/IDL2/Parser.hpp index 2a6e6b92b01..f614c2e998b 100644 --- a/modules/CIAO/CCF/CCF/IDL2/Parser.hpp +++ b/modules/CIAO/CCF/CCF/IDL2/Parser.hpp @@ -287,12 +287,10 @@ namespace CCF RecoveryStatus operator() (Parsing::Scanner const&, Parsing::Error e) const { - /* assert ( e.descriptor->diagnostic_ == Parsing::DiagnosticType::NONE && e.descriptor->recovery_ == Parsing::RecoveryMethod::BAIL_OUT ); - */ if (action_one_.get ()) action_one_->execute (); if (action_two_.get ()) action_two_->execute (); @@ -437,12 +435,12 @@ namespace CCF Rule local_interface_decl; Rule unconstrained_interface_decl; Rule interface_inheritance_spec; + Rule interface_def_trailer; Rule interface_body; Rule attribute_decl; Rule attribute_ro_decl_trailer; Rule attribute_rw_decl_trailer; - Rule attribute_ro_raises_spec; Rule attribute_rw_raises_spec; Rule attribute_get_raises_list; Rule attribute_set_raises_list; @@ -463,6 +461,7 @@ namespace CCF Rule operation_raises_list; Rule struct_decl; + Rule struct_def_trailer; Rule struct_body; Rule typedef_decl; @@ -481,6 +480,7 @@ namespace CCF Rule concrete_value_type_decl; Rule value_type_inheritance_spec; Rule value_type_supports_spec; + Rule value_type_def_trailer; Rule value_type_body; Rule value_type_factory_decl; diff --git a/modules/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp b/modules/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp index d8b3739b335..f9024f77f72 100644 --- a/modules/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp +++ b/modules/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp @@ -213,16 +213,6 @@ namespace CCF new RecoveryDescriptor (d, recovery, diagnostic))); } - AssertionImpl - operator () (std::string d, - DiagnosticType::Value diagnostic) - { - return AssertionImpl ( - RecoveryDescriptorPtr ( - new RecoveryDescriptor ( - d, RecoveryMethod::STANDARD, diagnostic))); - } - template AssertionImpl operator () (std::string d, @@ -237,19 +227,6 @@ namespace CCF d, recovery, diagnostic, obj, action_one))); } - template - AssertionImpl - operator () (std::string d, - Object& obj, - void (Object::*action_one)(), - DiagnosticType::Value diagnostic) - { - return AssertionImpl ( - RecoveryDescriptorPtr ( - new RecoveryDescriptor ( - d, RecoveryMethod::STANDARD, diagnostic, obj, action_one))); - } - template AssertionImpl operator () (Object& obj, @@ -277,20 +254,6 @@ namespace CCF d, recovery, diagnostic, obj, action_one, action_two))); } - template - AssertionImpl - operator () (std::string d, - Object& obj, - void (Object::*action_one)(), - void (Object::*action_two)(), - DiagnosticType::Value diagnostic) - { - return AssertionImpl ( - RecoveryDescriptorPtr ( - new RecoveryDescriptor ( - d, RecoveryMethod::STANDARD, diagnostic, obj, action_one, action_two))); - } - template AssertionImpl diff --git a/modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp b/modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp index 9685d0874ee..385702af462 100644 --- a/modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp +++ b/modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp @@ -81,13 +81,13 @@ namespace CCF catch (NotFound const&) { cerr << ctx.file () << ":" << type_id->line () << ": error: " - << "no type with name \'" << type_name + << "no type with name \'" << name << "\' visible from scope \'" << from << "\'" << endl; } catch (WrongType const&) { cerr << ctx.file () << ":" << type_id->line () << ": error: " - << "declaration with name \'" << type_name + << "declaration with name \'" << name << "\' visible from scope \'" << from << "\' is not a type declaration" << endl; diff --git a/modules/CIAO/CCF/CCF/IDL3/Parser.cpp b/modules/CIAO/CCF/CCF/IDL3/Parser.cpp index acb791f92c4..38eeeb087df 100644 --- a/modules/CIAO/CCF/CCF/IDL3/Parser.cpp +++ b/modules/CIAO/CCF/CCF/IDL3/Parser.cpp @@ -13,9 +13,6 @@ namespace CCF { namespace IDL3 { - using IDL2::Parsing::DiagnosticType; - using IDL2::Parsing::RecoveryMethod; - Parser:: Parser (CompilerElements::Context& context, Diagnostic::Stream& dout, @@ -51,10 +48,10 @@ namespace CCF f.component (), &SemanticAction::Component::supports), act_component_open_scope ( - f.component (), &SemanticAction::Scope::open_scope), + f.component (), &SemanticAction::Component::open_scope), act_component_close_scope ( - f.component (), &SemanticAction::Scope::close_scope), + f.component (), &SemanticAction::Component::close_scope), act_component_end ( f.component (), &SemanticAction::Component::end), @@ -115,10 +112,10 @@ namespace CCF f.event_type (), &SemanticAction::EventType::supports), act_event_type_open_scope ( - f.event_type (), &SemanticAction::Scope::open_scope), + f.event_type (), &SemanticAction::EventType::open_scope), act_event_type_close_scope ( - f.event_type (), &SemanticAction::Scope::close_scope), + f.event_type (), &SemanticAction::EventType::close_scope), act_event_type_end ( f.event_type (), &SemanticAction::EventType::end), @@ -150,10 +147,10 @@ namespace CCF f.home (), &SemanticAction::Home::manages), act_home_open_scope ( - f.home (), &SemanticAction::Scope::open_scope), + f.home (), &SemanticAction::Home::open_scope), act_home_close_scope ( - f.home (), &SemanticAction::Scope::close_scope), + f.home (), &SemanticAction::Home::close_scope), act_home_end ( f.home (), &SemanticAction::Home::end), @@ -196,11 +193,11 @@ namespace CCF ( assertion ("interface, valuetype or eventtype declaration expected") ( - (INTERFACE >> abstract_interface_decl) + (INTERFACE >> assertion ()(abstract_interface_decl)) | - (VALUETYPE >> abstract_value_type_decl) + (VALUETYPE >> assertion ()(abstract_value_type_decl)) | - (EVENTTYPE >> abstract_event_type_decl) + (EVENTTYPE >> assertion ()(abstract_event_type_decl)) ) )[error_handler] ; @@ -211,169 +208,65 @@ namespace CCF component_decl = COMPONENT - >> guard - ( - assertion ("component declaration expected", - DiagnosticType::BEFORE) - ( - ( - simple_identifier - >> SEMI - )[act_component_begin_fwd][act_component_end] - | - ( - ( - simple_identifier - >> COLON - )[act_component_begin_def] - - >> hood - ( - component_inheritance_spec - >> !(SUPPORTS >> component_support_spec) - >> assertion ("'{' expected") - ( - LCBRACE[act_component_open_scope] - ) - >> hood (component_body) - [ - handler (f.component (), - &SemanticAction::Component::close_scope) - ] - >> assertion ("'}' expected", - f.component (), - &SemanticAction::Component::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_component_close_scope] - ) - ) - [ - handler (f.component (), - &SemanticAction::Component::end) - ] - - >> assertion ("';' expected", - f.component (), - &SemanticAction::Component::end, - RecoveryMethod::NONE) - ( - SEMI[act_component_end] - ) - ) - | - ( - ( - simple_identifier - >> SUPPORTS - )[act_component_begin_def] + >> ( + ( + simple_identifier + >> SEMI + )[act_component_begin_fwd][act_component_end] + | + ( + ( + simple_identifier + >> COLON + )[act_component_begin_def] + >> component_inheritance_spec + >> !(SUPPORTS >> component_support_spec) + >> LCBRACE[act_component_open_scope] + >> component_def_trailer + ) + | + ( + ( + simple_identifier + >> SUPPORTS + )[act_component_begin_def] + >> component_support_spec + >> LCBRACE[act_component_open_scope] + >> component_def_trailer + ) + | + ( + ( + simple_identifier + >> LCBRACE + )[act_component_begin_def][act_component_open_scope] + >> component_def_trailer + ) - >> hood - ( - component_support_spec - >> assertion ("'{' expected") - ( - LCBRACE[act_component_open_scope] - ) - >> hood (component_body) - [ - handler (f.component (), - &SemanticAction::Component::close_scope) - ] - >> assertion ("'}' expected", - f.component (), - &SemanticAction::Component::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_component_close_scope] - ) - ) - [ - handler (f.component (), - &SemanticAction::Component::end) - ] - - >> assertion ("';' expected", - f.component (), - &SemanticAction::Component::end, - RecoveryMethod::NONE) - ( - SEMI[act_component_end] - ) - ) - | - ( - ( - simple_identifier - >> LCBRACE - )[act_component_begin_def][act_component_open_scope] + ) + ; - >> hood - ( - hood (component_body) - [ - handler (f.component (), - &SemanticAction::Component::close_scope) - ] - >> assertion ("'}' expected", - f.component (), - &SemanticAction::Component::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_component_close_scope] - ) - ) - [ - handler (f.component (), - &SemanticAction::Component::end) - ] - - >> assertion ("';' expected", - f.component (), - &SemanticAction::Component::end, - RecoveryMethod::NONE) - ( - SEMI[act_component_end] - ) - ) - ) - )[error_handler] + component_def_trailer = + component_body + >> RCBRACE[act_component_close_scope] + >> SEMI[act_component_end] ; - component_inheritance_spec = - guard - ( - assertion ("base component name expected") - ( - identifier[act_component_inherits] - ) - )[error_handler] + component_inheritance_spec = identifier[act_component_inherits] ; component_support_spec = - guard - ( - assertion ("supported interface name expected") - ( - identifier[act_component_supports] - ) - >> *( - COMMA - >> assertion ("supported interface name expected") - ( - identifier[act_component_supports] - ) - ) - )[error_handler] + identifier[act_component_supports] + >> *(COMMA >> identifier[act_component_supports]) ; component_body = - *( provides_decl - | uses_decl - | emits_decl - | publishes_decl - | consumes_decl - | attribute_decl + *( provides_decl + | uses_decl + | emits_decl + | publishes_decl + | consumes_decl + | attribute_decl ) ; @@ -382,108 +275,38 @@ namespace CCF // provides_decl = PROVIDES - >> guard - ( - assertion ("interface name expected") - ( - identifier[act_provides_type] - ) - >> assertion ("provides name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_provides_name] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> identifier[act_provides_type] + >> simple_identifier[act_provides_name] + >> SEMI ; uses_decl = USES - >> guard - ( - !(MULTIPLE[act_uses_multiple]) - >> assertion ("interface name expected") - ( - identifier[act_uses_type] - ) - >> assertion ("uses name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_uses_name] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> !(MULTIPLE[act_uses_multiple]) + >> identifier[act_uses_type] + >> simple_identifier[act_uses_name] + >> SEMI ; emits_decl = EMITS - >> guard - ( - assertion ("eventtype name expected") - ( - identifier[act_emits_type] - ) - >> assertion ("emits name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_emits_name] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> identifier[act_emits_type] + >> simple_identifier[act_emits_name] + >> SEMI ; publishes_decl = PUBLISHES - >> guard - ( - assertion ("eventtype name expected") - ( - identifier[act_publishes_type] - ) - >> assertion ("publishes name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_publishes_name] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> identifier[act_publishes_type] + >> simple_identifier[act_publishes_name] + >> SEMI ; consumes_decl = CONSUMES - >> guard - ( - assertion ("eventtype name expected") - ( - identifier[act_consumes_type] - ) - >> assertion ("consumes name expected", - DiagnosticType::BEFORE) - ( - simple_identifier[act_consumes_name] - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> identifier[act_consumes_type] + >> simple_identifier[act_consumes_name] + >> SEMI ; @@ -493,297 +316,111 @@ namespace CCF abstract_event_type_decl = guard ( - assertion ("abstract eventtype declaration expected", - DiagnosticType::BEFORE) - ( - ( + ( + simple_identifier + >> SEMI + )[act_event_type_begin_abstract_fwd][act_event_type_end] + | + ( + ( simple_identifier - >> SEMI - )[act_event_type_begin_abstract_fwd][act_event_type_end] - | - ( - ( - simple_identifier - >> COLON - )[act_event_type_begin_abstract_def] - - >> hood - ( - event_type_inheritance_spec - >> !(SUPPORTS >> event_type_supports_spec) - >> assertion ("'{' expected") - ( - LCBRACE[act_event_type_open_scope] - ) - >> hood (event_type_body) - [ - handler (f.event_type (), - &SemanticAction::EventType::close_scope) - ] - >> assertion ("'}' expected", - f.event_type (), - &SemanticAction::EventType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_event_type_close_scope] - ) - ) - [ - handler (f.event_type (), - &SemanticAction::EventType::end) - ] - - >> assertion ("';' expected", - f.event_type (), - &SemanticAction::EventType::end, - RecoveryMethod::NONE) - ( - SEMI[act_event_type_end] - ) - ) - | - ( - ( - simple_identifier - >> SUPPORTS - )[act_event_type_begin_abstract_def] - - >> hood - ( - event_type_supports_spec - >> assertion ("'{' expected") - ( - LCBRACE[act_event_type_open_scope] - ) - >> hood (event_type_body) - [ - handler (f.event_type (), - &SemanticAction::EventType::close_scope) - ] - >> assertion ("'}' expected", - f.event_type (), - &SemanticAction::EventType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_event_type_close_scope] - ) - ) - [ - handler (f.event_type (), - &SemanticAction::EventType::end) - ] - - >> assertion ("';' expected", - f.event_type (), - &SemanticAction::EventType::end, - RecoveryMethod::NONE) - ( - SEMI[act_event_type_end] - ) - ) - | - ( - ( - simple_identifier - >> LCBRACE - )[act_event_type_begin_abstract_def][act_event_type_open_scope] - - >> hood - ( - hood (event_type_body) - [ - handler (f.event_type (), - &SemanticAction::EventType::close_scope) - ] - >> assertion ("'}' expected", - f.event_type (), - &SemanticAction::EventType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_event_type_close_scope] - ) - ) - [ - handler (f.event_type (), - &SemanticAction::EventType::end) - ] - - >> assertion ("';' expected", - f.event_type (), - &SemanticAction::EventType::end, - RecoveryMethod::NONE) - ( - SEMI[act_event_type_end] - ) - ) - ) - )[error_handler] - ; + >> COLON + )[act_event_type_begin_abstract_def] + >> event_type_inheritance_spec + >> !(SUPPORTS >> event_type_supports_spec) + >> LCBRACE[act_event_type_open_scope] + >> event_type_def_trailer + ) + | + ( + ( + simple_identifier + >> SUPPORTS + )[act_event_type_begin_abstract_def] - concrete_event_type_decl = - EVENTTYPE - >> guard - ( - assertion ("eventtype declaration expected", - DiagnosticType::BEFORE) - ( - ( - simple_identifier - >> SEMI - )[act_event_type_begin_concrete_fwd][act_event_type_end] - | - ( - ( - simple_identifier - >> COLON - )[act_event_type_begin_concrete_def] - - >> hood - ( - event_type_inheritance_spec - >> !(SUPPORTS >> event_type_supports_spec) - >> assertion ("'{' expected") - ( - LCBRACE[act_event_type_open_scope] - ) - >> hood (event_type_body) - [ - handler (f.event_type (), - &SemanticAction::EventType::close_scope) - ] - >> assertion ("'}' expected", - f.event_type (), - &SemanticAction::EventType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_event_type_close_scope] - ) - ) - [ - handler (f.event_type (), - &SemanticAction::EventType::end) - ] - - >> assertion ("';' expected", - f.event_type (), - &SemanticAction::EventType::end, - RecoveryMethod::NONE) - ( - SEMI[act_event_type_end] - ) - ) - | - ( - ( - simple_identifier - >> SUPPORTS - )[act_event_type_begin_concrete_def] - - >> hood - ( - event_type_supports_spec - >> assertion ("'{' expected") - ( - LCBRACE[act_event_type_open_scope] - ) - >> hood (event_type_body) - [ - handler (f.event_type (), - &SemanticAction::EventType::close_scope) - ] - >> assertion ("'}' expected", - f.event_type (), - &SemanticAction::EventType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_event_type_close_scope] - ) - ) - [ - handler (f.event_type (), - &SemanticAction::EventType::end) - ] - - >> assertion ("';' expected", - f.event_type (), - &SemanticAction::EventType::end, - RecoveryMethod::NONE) - ( - SEMI[act_event_type_end] - ) - ) - | - ( - ( - simple_identifier - >> LCBRACE - )[act_event_type_begin_concrete_def][act_event_type_open_scope] - - >> hood - ( - hood (event_type_body) - [ - handler (f.event_type (), - &SemanticAction::EventType::close_scope) - ] - >> assertion ("'}' expected", - f.event_type (), - &SemanticAction::EventType::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_event_type_close_scope] - ) - ) - [ - handler (f.event_type (), - &SemanticAction::EventType::end) - ] - - >> assertion ("';' expected", - f.event_type (), - &SemanticAction::EventType::end, - RecoveryMethod::NONE) - ( - SEMI[act_event_type_end] - ) - ) + >> event_type_supports_spec + >> LCBRACE[act_event_type_open_scope] + >> event_type_def_trailer ) - )[error_handler] + | + ( + ( + simple_identifier + >> LCBRACE + )[act_event_type_begin_abstract_def][act_event_type_open_scope] + + >> event_type_def_trailer + ) + )[error_handler] ; - event_type_inheritance_spec = + concrete_event_type_decl = guard ( - assertion ("base eventtype name expected") - ( - identifier[act_event_type_inherits] - ) - >> *( - COMMA - >> assertion ("base eventtype name expected") - ( - identifier[act_event_type_inherits] - ) - ) + EVENTTYPE + >> ( + ( + simple_identifier + >> SEMI + )[act_event_type_begin_concrete_fwd][act_event_type_end] + | + ( + ( + simple_identifier + >> COLON + )[act_event_type_begin_concrete_def] + + >> event_type_inheritance_spec + >> !(SUPPORTS >> event_type_supports_spec) + >> LCBRACE[act_event_type_open_scope] + >> event_type_def_trailer + ) + | + ( + ( + simple_identifier + >> SUPPORTS + )[act_event_type_begin_concrete_def] + + >> event_type_supports_spec + >> LCBRACE[act_event_type_open_scope] + >> event_type_def_trailer + ) + | + ( + ( + simple_identifier + >> LCBRACE + )[act_event_type_begin_concrete_def][act_event_type_open_scope] + + >> event_type_def_trailer + ) + ) )[error_handler] ; + + event_type_inheritance_spec = + identifier[act_event_type_inherits] + >> *( + COMMA + >> identifier[act_event_type_inherits] + ) + ; + event_type_supports_spec = - guard - ( - assertion ("supported interface name expected") - ( - identifier[act_event_type_supports] - ) - >> *( - COMMA - >> assertion ("supported interface name expected") - ( - identifier[act_event_type_supports] - ) - ) - )[error_handler] + identifier[act_event_type_supports] + >> *( + COMMA + >> identifier[act_event_type_supports] + ) + ; + + event_type_def_trailer = + event_type_body + >> RCBRACE[act_event_type_close_scope] + >> SEMI[act_event_type_end] ; event_type_body = @@ -806,41 +443,12 @@ namespace CCF // event_type_factory_decl = FACTORY - >> guard - ( - assertion ("factory name expected") - ( - simple_identifier[act_event_type_factory_name] - ) - >> assertion ("'(' expected") - ( - LPAREN - ) - >> event_type_factory_parameter_list - >> assertion ("parameter declaration or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - >> !( - RAISES - >> assertion ("'(' expected") - ( - LPAREN - ) - >> event_type_factory_raises_list - >> assertion ("',' or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> simple_identifier[act_event_type_factory_name] + >> LPAREN + >> event_type_factory_parameter_list + >> RPAREN + >> !(RAISES >> LPAREN >> event_type_factory_raises_list >> RPAREN) + >> SEMI ; event_type_factory_parameter_list = @@ -852,119 +460,40 @@ namespace CCF event_type_factory_parameter = IN - >> guard - ( - ( - assertion ("type name expected") - ( - identifier - ) - >> assertion ("parameter name expected", - DiagnosticType::BEFORE) - ( - simple_identifier - ) - )[act_event_type_factory_parameter] - )[error_handler] + >> (identifier >> simple_identifier)[act_event_type_factory_parameter] ; event_type_factory_raises_list = - guard - ( - assertion ("exception name expected") - ( - identifier[act_event_type_factory_raises] - ) - >> *( - COMMA - >> assertion ("exception name expected") - ( - identifier[act_event_type_factory_raises] - ) - ) - )[error_handler] + identifier[act_event_type_factory_raises] + >> *(COMMA >> identifier[act_event_type_factory_raises]) ; // // home // home_decl = - HOME - >> guard - ( - assertion ("home name expected") - ( - simple_identifier[act_home_begin] - ) - >> hood - ( - !(COLON >> home_inheritance_spec) - >> !(SUPPORTS >> home_support_spec) - >> assertion ("'manages' expected", - DiagnosticType::BEFORE) - ( - MANAGES - ) - >> assertion ("executor name expected") - ( - identifier[act_home_manages] - ) - >> assertion ("'{' expected") - ( - LCBRACE[act_home_open_scope] - ) - >> hood (home_body) - [ - handler (f.home (), - &SemanticAction::Home::close_scope) - ] - >> assertion ("'}' expected", - f.home (), - &SemanticAction::Home::close_scope, - DiagnosticType::BEFORE) - ( - RCBRACE[act_home_close_scope] - ) - ) - [ - handler (f.home (), - &SemanticAction::Home::end) - ] - >> assertion ("';' expected", - f.home (), - &SemanticAction::Home::end, - RecoveryMethod::NONE) - ( - SEMI[act_home_end] - ) - )[error_handler] + home_header + >> !(COLON >> home_inheritance_spec) + >> !(SUPPORTS >> home_support_spec) + >> MANAGES >> home_manage_spec + >> LCBRACE[act_home_open_scope] + >> home_body + >> RCBRACE[act_home_close_scope] + >> SEMI[act_home_end] ; - home_inheritance_spec = - guard - ( - assertion ("base home name expected") - ( - identifier[act_home_inherits] - ) - )[error_handler] + home_header = HOME >> simple_identifier[act_home_begin] + ; + + home_inheritance_spec = identifier[act_home_inherits] ; home_support_spec = - guard - ( - assertion ("supported interface name expected") - ( - identifier[act_home_supports] - ) - >> *( - COMMA - >> assertion ("supported interface name expected") - ( - identifier[act_home_supports] - ) - ) - )[error_handler] + identifier[act_home_supports] + >> *(COMMA >> identifier[act_home_supports]) + ; + + home_manage_spec = identifier[act_home_manages] ; home_body = @@ -986,41 +515,12 @@ namespace CCF // home_factory_decl = FACTORY - >> guard - ( - assertion ("factory name expected") - ( - simple_identifier[act_home_factory_name] - ) - >> assertion ("'(' expected") - ( - LPAREN - ) - >> home_factory_parameter_list - >> assertion ("parameter declaration or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - >> !( - RAISES - >> assertion ("'(' expected") - ( - LPAREN - ) - >> home_factory_raises_list - >> assertion ("',' or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> simple_identifier[act_home_factory_name] + >> LPAREN + >> home_factory_parameter_list + >> RPAREN + >> !(RAISES >> LPAREN >> home_factory_raises_list >> RPAREN) + >> SEMI ; home_factory_parameter_list = @@ -1032,37 +532,12 @@ namespace CCF home_factory_parameter = IN - >> guard - ( - ( - assertion ("type name expected") - ( - identifier - ) - >> assertion ("parameter name expected", - DiagnosticType::BEFORE) - ( - simple_identifier - ) - )[act_home_factory_parameter] - )[error_handler] + >> (identifier >> simple_identifier)[act_home_factory_parameter] ; home_factory_raises_list = - guard - ( - assertion ("exception name expected") - ( - identifier[act_home_factory_raises] - ) - >> *( - COMMA - >> assertion ("exception name expected") - ( - identifier[act_home_factory_raises] - ) - ) - )[error_handler] + identifier[act_home_factory_raises] + >> *(COMMA >> identifier[act_home_factory_raises]) ; @@ -1071,41 +546,12 @@ namespace CCF // home_finder_decl = FINDER - >> guard - ( - assertion ("finder name expected") - ( - simple_identifier[act_home_finder_name] - ) - >> assertion ("'(' expected") - ( - LPAREN - ) - >> home_finder_parameter_list - >> assertion ("parameter declaration or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - >> !( - RAISES - >> assertion ("'(' expected") - ( - LPAREN - ) - >> home_finder_raises_list - >> assertion ("',' or ')' expected", - DiagnosticType::BEFORE) - ( - RPAREN - ) - ) - >> assertion ("';' expected", - RecoveryMethod::NONE) - ( - SEMI - ) - )[error_handler] + >> simple_identifier[act_home_finder_name] + >> LPAREN + >> home_finder_parameter_list + >> RPAREN + >> !(RAISES >> LPAREN >> home_finder_raises_list >> RPAREN) + >> SEMI ; home_finder_parameter_list = @@ -1117,37 +563,12 @@ namespace CCF home_finder_parameter = IN - >> guard - ( - ( - assertion ("type name expected") - ( - identifier - ) - >> assertion ("parameter name expected", - DiagnosticType::BEFORE) - ( - simple_identifier - ) - )[act_home_finder_parameter] - )[error_handler] + >> (identifier >> simple_identifier)[act_home_finder_parameter] ; home_finder_raises_list = - guard - ( - assertion ("exception name expected") - ( - identifier[act_home_finder_raises] - ) - >> *( - COMMA - >> assertion ("exception name expected") - ( - identifier[act_home_finder_raises] - ) - ) - )[error_handler] + identifier[act_home_finder_raises] + >> *(COMMA >> identifier[act_home_finder_raises]) ; } } diff --git a/modules/CIAO/CCF/CCF/IDL3/Parser.hpp b/modules/CIAO/CCF/CCF/IDL3/Parser.hpp index 715045f2466..39a11f022ca 100644 --- a/modules/CIAO/CCF/CCF/IDL3/Parser.hpp +++ b/modules/CIAO/CCF/CCF/IDL3/Parser.hpp @@ -48,6 +48,7 @@ namespace CCF // component // Rule component_decl; + Rule component_def_trailer; Rule component_inheritance_spec; Rule component_support_spec; Rule component_body; @@ -64,6 +65,7 @@ namespace CCF Rule concrete_event_type_decl; Rule event_type_inheritance_spec; Rule event_type_supports_spec; + Rule event_type_def_trailer; Rule event_type_body; Rule event_type_factory_decl; @@ -74,8 +76,10 @@ namespace CCF // home // Rule home_decl; + Rule home_header; Rule home_inheritance_spec; Rule home_support_spec; + Rule home_manage_spec; Rule home_body; Rule home_factory_decl; diff --git a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp index 9a8eeb645c8..77b8cdbe5e5 100644 --- a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp +++ b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp @@ -27,12 +27,6 @@ namespace CCF virtual void supports (IdentifierPtr const& id) = 0; - virtual void - open_scope () = 0; - - virtual void - close_scope () = 0; - virtual void end () = 0; }; diff --git a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp index f6891d6ee24..e4b15430921 100644 --- a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp +++ b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp @@ -33,12 +33,6 @@ namespace CCF virtual void supports (IdentifierPtr const& id) = 0; - virtual void - open_scope () = 0; - - virtual void - close_scope () = 0; - virtual void end () = 0; }; diff --git a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp index 9dac172d39e..b0b219370a1 100644 --- a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp +++ b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp @@ -27,12 +27,6 @@ namespace CCF virtual void manages (IdentifierPtr const& id) = 0; - virtual void - open_scope () = 0; - - virtual void - close_scope () = 0; - virtual void end () = 0; }; diff --git a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp index 4bfc9818c65..52c89b1fe81 100644 --- a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp +++ b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp @@ -60,7 +60,7 @@ namespace CCF cerr << ctx.file () << ":" << id->line () << ": error: " << "declaration with name \'" << name << "\' visible from scope \'" << from - << "\' is not an interface declaration" << endl; + << "\' is not an eventtype declaration" << endl; cerr << ctx.file () << ":" << id->line () << ": error: " << "using non-interface type in provides declaration is " diff --git a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp index ce32f39dea0..1ad850502b0 100644 --- a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp +++ b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp @@ -67,7 +67,7 @@ namespace CCF cerr << ctx.file () << ":" << id->line () << ": error: " << "declaration with name \'" << name << "\' visible from scope \'" << from - << "\' is not an interface declaration" << endl; + << "\' is not an eventtype declaration" << endl; cerr << ctx.file () << ":" << id->line () << ": error: " << "using non-interface type in uses declaration is " -- cgit v1.2.1