diff options
author | boris <boris@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-09-27 13:33:33 +0000 |
---|---|---|
committer | boris <boris@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-09-27 13:33:33 +0000 |
commit | 82a54985a283ff875691f227422a16186bf45f4b (patch) | |
tree | 469ecb1c51e77858215eb8dce1a45e3eb09be750 /TAO/CIAO/CCF/CCF | |
parent | 7558cd9673e7d68cee6d1c681a648f241dc0572a (diff) | |
download | ATCD-82a54985a283ff875691f227422a16186bf45f4b.tar.gz |
ChangeLogTag: Tue Sep 27 14:26:44 2005 Boris Kolpackov <boris@kolpackov.net>
Diffstat (limited to 'TAO/CIAO/CCF/CCF')
21 files changed, 2607 insertions, 114 deletions
diff --git a/TAO/CIAO/CCF/CCF/CIDL/Parser.cpp b/TAO/CIAO/CCF/CCF/CIDL/Parser.cpp index 4703e84ae30..ae99e2428b0 100644 --- a/TAO/CIAO/CCF/CCF/CIDL/Parser.cpp +++ b/TAO/CIAO/CCF/CCF/CIDL/Parser.cpp @@ -71,9 +71,9 @@ namespace CCF // composition_decl = composition_header - >> LBRACE[act_composition_open_scope] + >> LCBRACE[act_composition_open_scope] >> home_executor_decl - >> RBRACE[act_composition_close_scope] + >> RCBRACE[act_composition_close_scope] >> SEMI[act_composition_end] ; @@ -94,10 +94,10 @@ namespace CCF // home_executor_decl = home_executor_header - >> LBRACE + >> LCBRACE >> home_executor_home_impl_decl >> home_executor_executor_decl - >> RBRACE + >> RCBRACE >> SEMI[act_home_executor_end] ; diff --git a/TAO/CIAO/CCF/CCF/IDL2/LexicalAnalyzer.cpp b/TAO/CIAO/CCF/CCF/IDL2/LexicalAnalyzer.cpp index a2def15efb2..e357a1a0c28 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/LexicalAnalyzer.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/LexicalAnalyzer.cpp @@ -106,6 +106,8 @@ namespace CCF punctuation_table_.insert (","); punctuation_table_.insert ("{"); punctuation_table_.insert ("}"); + punctuation_table_.insert ("["); + punctuation_table_.insert ("]"); punctuation_table_.insert ("("); punctuation_table_.insert (")"); punctuation_table_.insert ("<"); diff --git a/TAO/CIAO/CCF/CCF/IDL2/Parser.cpp b/TAO/CIAO/CCF/CCF/IDL2/Parser.cpp index 8a73bc0c60c..3f87695c812 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Parser.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Parser.cpp @@ -70,15 +70,17 @@ namespace CCF VALUETYPE ("valuetype" ), WSTRING ("wstring" ), - COLON (":"), - COMMA (","), - LBRACE ("{"), - RBRACE ("}"), - LPAREN ("("), - RPAREN (")"), - LT ("<"), - GT (">"), - SEMI (";"), + COLON (":"), + COMMA (","), + LCBRACE ("{"), + RCBRACE ("}"), + LSBRACE ("["), + RSBRACE ("]"), + LPAREN ("("), + RPAREN (")"), + LT ("<"), + GT (">"), + SEMI (";"), ADD ("+"), @@ -119,6 +121,14 @@ namespace CCF act_attribute_end ( f.attribute (), &SemanticAction::Attribute::end), + // Const + // + act_const_begin ( + f.const_ (), &SemanticAction::Const::begin), + + act_const_expr ( + f.const_ (), &SemanticAction::Const::expr), + // Enum // // @@ -132,6 +142,73 @@ namespace CCF f.enum_ (), &SemanticAction::Enum::end), + // Expression + // + + act_const_expr_flush ( + f.numeric_expression (), + &SemanticAction::NumericExpression::flush), + + act_numeric_expression_const ( + f.numeric_expression (), + &SemanticAction::NumericExpression::const_), + + act_numeric_expression_integer_literal ( + f.numeric_expression (), + &SemanticAction::NumericExpression::integer_literal), + + act_numeric_expression_pos ( + f.numeric_expression (), + &SemanticAction::NumericExpression::pos), + + act_numeric_expression_neg ( + f.numeric_expression (), + &SemanticAction::NumericExpression::neg), + + act_numeric_expression_com ( + f.numeric_expression (), + &SemanticAction::NumericExpression::com), + + act_numeric_expression_mul ( + f.numeric_expression (), + &SemanticAction::NumericExpression::mul), + + act_numeric_expression_div ( + f.numeric_expression (), + &SemanticAction::NumericExpression::div), + + act_numeric_expression_rem ( + f.numeric_expression (), + &SemanticAction::NumericExpression::rem), + + act_numeric_expression_add ( + f.numeric_expression (), + &SemanticAction::NumericExpression::add), + + act_numeric_expression_sub ( + f.numeric_expression (), + &SemanticAction::NumericExpression::sub), + + act_numeric_expression_rsh ( + f.numeric_expression (), + &SemanticAction::NumericExpression::rsh), + + act_numeric_expression_lsh ( + f.numeric_expression (), + &SemanticAction::NumericExpression::lsh), + + act_numeric_expression_and ( + f.numeric_expression (), + &SemanticAction::NumericExpression::and_), + + act_numeric_expression_xor ( + f.numeric_expression (), + &SemanticAction::NumericExpression::xor_), + + act_numeric_expression_or ( + f.numeric_expression (), + &SemanticAction::NumericExpression::or_), + // Exception // // @@ -514,7 +591,7 @@ namespace CCF f.module (), &SemanticAction::Module::end) ( - LBRACE[act_module_open_scope] + LCBRACE[act_module_open_scope] ) >> assertion ("declaration expected", f.module (), @@ -537,7 +614,7 @@ namespace CCF RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( - RBRACE[act_module_close_scope] + RCBRACE[act_module_close_scope] ) >> assertion ("\';\' is missing", f.module (), @@ -554,10 +631,9 @@ namespace CCF // const_decl = CONST - >> identifier - >> simple_identifier - >> EQ - >> const_expr + >> (identifier >> simple_identifier)[act_const_begin] + >> EQ[act_const_expr_flush] // flush expression stacks + >> const_expr[act_const_expr] >> SEMI ; @@ -569,7 +645,7 @@ namespace CCF const_expr = boolean_const_expr | character_const_expr - | integer_const_expr + | numeric_const_expr | string_const_expr ; @@ -577,66 +653,68 @@ namespace CCF character_const_expr = character_literal; - //@@ I may have recognision problem on unary operators or - // even worse on LPAREN. Seems not. - // - integer_const_expr = integer_or_expr; + // + // + numeric_const_expr = numeric_or_expr; - integer_or_expr = - integer_xor_expr - >> *(OR >> integer_xor_expr) + numeric_or_expr = + numeric_xor_expr + >> *(OR >> numeric_xor_expr)[act_numeric_expression_or] ; - integer_xor_expr = - integer_and_expr - >> *(XOR >> integer_and_expr) + numeric_xor_expr = + numeric_and_expr + >> *(XOR >> numeric_and_expr)[act_numeric_expression_xor] ; - integer_and_expr = - integer_shift_expr - >> *(AND >> integer_shift_expr) + numeric_and_expr = + numeric_shift_expr + >> *(AND >> numeric_shift_expr)[act_numeric_expression_and] ; - integer_shift_expr = - integer_add_expr + numeric_shift_expr = + numeric_add_expr >> *( - (RSH >> integer_add_expr) - | (LSH >> integer_add_expr) + (RSH >> numeric_add_expr)[act_numeric_expression_rsh] + | (LSH >> numeric_add_expr)[act_numeric_expression_lsh] ) ; - integer_add_expr = - integer_mul_expr + numeric_add_expr = + numeric_mul_expr >> *( - (ADD >> integer_mul_expr) - | (SUB >> integer_mul_expr) + (ADD >> numeric_mul_expr)[act_numeric_expression_add] + | (SUB >> numeric_mul_expr)[act_numeric_expression_sub] ) ; - integer_mul_expr = - integer_unary_expr + numeric_mul_expr = + numeric_unary_expr >> *( - (MUL >> integer_unary_expr) - | (DIV >> integer_unary_expr) - | (REM >> integer_unary_expr) + (MUL >> numeric_unary_expr)[act_numeric_expression_mul] + | (DIV >> numeric_unary_expr)[act_numeric_expression_div] + | (REM >> numeric_unary_expr)[act_numeric_expression_rem] ) ; - integer_unary_expr = - integer_primary_expr - | ADD >> integer_primary_expr - | SUB >> integer_primary_expr - | COM >> integer_primary_expr + numeric_unary_expr = + numeric_primary_expr + | ADD >> numeric_primary_expr[act_numeric_expression_pos] + | SUB >> numeric_primary_expr[act_numeric_expression_neg] + | COM >> numeric_primary_expr[act_numeric_expression_com] ; - integer_primary_expr = - identifier - | integer_literal - | LPAREN >> integer_const_expr >> RPAREN + numeric_primary_expr = + identifier[act_numeric_expression_const] + | integer_literal[act_numeric_expression_integer_literal] + | LPAREN >> numeric_const_expr >> RPAREN ; + + // + // string_const_expr = string_literal; @@ -646,9 +724,9 @@ namespace CCF enum_decl = ENUM >> simple_identifier[act_enum_begin] - >> LBRACE + >> LCBRACE >> enumerator_decl >> *(COMMA >> enumerator_decl) - >> RBRACE + >> RCBRACE >> SEMI[act_enum_end] ; @@ -673,14 +751,14 @@ namespace CCF )[act_interface_begin_abstract_def] >> interface_inheritance_spec - >> LBRACE[act_interface_open_scope] + >> LCBRACE[act_interface_open_scope] >> interface_def_trailer ) | ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_interface_begin_abstract_def][act_interface_open_scope] >> interface_def_trailer @@ -704,14 +782,14 @@ namespace CCF )[act_interface_begin_local_def] >> interface_inheritance_spec - >> LBRACE[act_interface_open_scope] + >> LCBRACE[act_interface_open_scope] >> interface_def_trailer ) | ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_interface_begin_local_def][act_interface_open_scope] >> interface_def_trailer @@ -737,14 +815,14 @@ namespace CCF )[act_interface_begin_unconstrained_def] >> interface_inheritance_spec - >> LBRACE[act_interface_open_scope] + >> LCBRACE[act_interface_open_scope] >> interface_def_trailer ) | ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_interface_begin_unconstrained_def][act_interface_open_scope] >> interface_def_trailer @@ -780,7 +858,7 @@ namespace CCF RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( - RBRACE[act_interface_close_scope] + RCBRACE[act_interface_close_scope] ) >> assertion ("\';\' is missing", f.interface (), @@ -802,7 +880,7 @@ namespace CCF | ( !(COLON >> interface_inheritance_spec) - >> LBRACE[act_interface_open_scope] + >> LCBRACE[act_interface_open_scope] >> interface_body >> assertion ("declaration or \'}\' expected", f.interface (), @@ -811,7 +889,7 @@ namespace CCF RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( - RBRACE[act_interface_close_scope] + RCBRACE[act_interface_close_scope] ) >> assertion ("\';\' is missing", f.interface (), @@ -903,9 +981,9 @@ namespace CCF exception_decl = EXCEPTION >> simple_identifier[act_exception_begin] - >> LBRACE[act_exception_open_scope] + >> LCBRACE[act_exception_open_scope] >> exception_body - >> RBRACE[act_exception_close_scope] + >> RCBRACE[act_exception_close_scope] >> SEMI[act_exception_end] ; @@ -1008,7 +1086,7 @@ namespace CCF ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_struct_begin_def][act_struct_open_scope] >> struct_def_trailer ) @@ -1020,9 +1098,9 @@ namespace CCF struct_decl = STRUCT >> simple_identifier - >> LBRACE + >> LCBRACE >> struct_body - >> RBRACE + >> RCBRACE >> SEMI ; */ @@ -1037,7 +1115,7 @@ namespace CCF RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( - RBRACE[act_struct_close_scope] + RCBRACE[act_struct_close_scope] ) >> assertion ("\';\' is missing", f.struct_ (), @@ -1061,11 +1139,19 @@ namespace CCF typedef_decl = TYPEDEF >> typedef_type_spec - >> simple_identifier[act_typedef_declarator] - >> *(COMMA >> simple_identifier[act_typedef_declarator]) + >> typedef_declarator + >> *(COMMA >> typedef_declarator) >> SEMI[act_typedef_end] ; + typedef_declarator = + simple_identifier[act_typedef_declarator] + >> *( LSBRACE[act_const_expr_flush] // flush expression stacks + >> numeric_const_expr + >> RSBRACE + ) + ; + typedef_type_spec = identifier[act_typedef_begin] | @@ -1073,20 +1159,24 @@ namespace CCF SEQUENCE >> LT >> identifier[act_typedef_begin_seq] + >> !( + COMMA[act_const_expr_flush] // flush expression stacks + >> numeric_const_expr + ) >> GT ) | ( STRING - >> LT - >> integer_const_expr[act_typedef_begin_bounded_string] + >> LT[act_const_expr_flush] // flush expression stacks + >> numeric_const_expr[act_typedef_begin_bounded_string] >> GT ) | ( WSTRING - >> LT - >> integer_const_expr[act_typedef_begin_bounded_wstring] + >> LT[act_const_expr_flush] // flush expression stacks + >> numeric_const_expr[act_typedef_begin_bounded_wstring] >> GT ) ; @@ -1119,7 +1209,7 @@ namespace CCF LPAREN >> identifier[act_union_type] >> RPAREN - >> LBRACE[act_union_open_scope] + >> LCBRACE[act_union_open_scope] >> union_body >> assertion ("member or \'}\' expected", f.union_ (), @@ -1128,7 +1218,7 @@ namespace CCF RecoveryMethod::STANDARD, DiagnosticType::BEFORE) ( - RBRACE[act_union_close_scope] + RCBRACE[act_union_close_scope] ) >> assertion ("\';\' is missing", f.union_ (), @@ -1150,7 +1240,11 @@ namespace CCF ; union_case_label = - (CASE >> const_expr >> COLON) + ( + CASE[act_const_expr_flush] // flush expression stacks + >> const_expr + >> COLON + ) | (DEFAULT >> COLON) ; @@ -1174,7 +1268,7 @@ namespace CCF >> value_type_inheritance_spec >> !(SUPPORTS >> value_type_supports_spec) - >> LBRACE[act_value_type_open_scope] + >> LCBRACE[act_value_type_open_scope] >> value_type_def_trailer ) | @@ -1185,14 +1279,14 @@ namespace CCF )[act_value_type_begin_abstract_def] >> value_type_supports_spec - >> LBRACE[act_value_type_open_scope] + >> LCBRACE[act_value_type_open_scope] >> value_type_def_trailer ) | ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_value_type_begin_abstract_def][act_value_type_open_scope] >> value_type_def_trailer @@ -1218,7 +1312,7 @@ namespace CCF >> value_type_inheritance_spec >> !(SUPPORTS >> value_type_supports_spec) - >> LBRACE[act_value_type_open_scope] + >> LCBRACE[act_value_type_open_scope] >> value_type_def_trailer ) | @@ -1229,14 +1323,14 @@ namespace CCF )[act_value_type_begin_concrete_def] >> value_type_supports_spec - >> LBRACE[act_value_type_open_scope] + >> LCBRACE[act_value_type_open_scope] >> value_type_def_trailer ) | ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_value_type_begin_concrete_def][act_value_type_open_scope] >> value_type_def_trailer @@ -1264,7 +1358,7 @@ namespace CCF value_type_def_trailer = value_type_body - >> RBRACE[act_value_type_close_scope] + >> RCBRACE[act_value_type_close_scope] >> SEMI[act_value_type_end] ; diff --git a/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp b/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp index a800472791e..29ee5da0426 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp @@ -356,8 +356,10 @@ namespace CCF // PunctuationParser COLON; PunctuationParser COMMA; - PunctuationParser LBRACE; - PunctuationParser RBRACE; + PunctuationParser LCBRACE; + PunctuationParser RCBRACE; + PunctuationParser LSBRACE; + PunctuationParser RSBRACE; PunctuationParser LPAREN; PunctuationParser RPAREN; PunctuationParser LT; @@ -412,16 +414,16 @@ namespace CCF Rule boolean_const_expr; Rule character_const_expr; - Rule integer_const_expr; + Rule numeric_const_expr; - Rule integer_or_expr; - Rule integer_xor_expr; - Rule integer_and_expr; - Rule integer_shift_expr; - Rule integer_add_expr; - Rule integer_mul_expr; - Rule integer_unary_expr; - Rule integer_primary_expr; + Rule numeric_or_expr; + Rule numeric_xor_expr; + Rule numeric_and_expr; + Rule numeric_shift_expr; + Rule numeric_add_expr; + Rule numeric_mul_expr; + Rule numeric_unary_expr; + Rule numeric_primary_expr; Rule string_const_expr; @@ -462,6 +464,7 @@ namespace CCF Rule struct_body; Rule typedef_decl; + Rule typedef_declarator; Rule typedef_type_spec; Rule type_id_decl; @@ -528,6 +531,15 @@ namespace CCF NoArgAction<SemanticAction::Attribute> act_attribute_end; + // Const + // + TwoArgAction<IdentifierPtr, SimpleIdentifierPtr, SemanticAction::Const> + act_const_begin; + + NoArgAction<SemanticAction::Const> + act_const_expr; + + // Enum // // @@ -537,6 +549,33 @@ namespace CCF NoArgAction<SemanticAction::Enum> act_enum_end; + // Expression + // + NoArgAction<SemanticAction::NumericExpression> + act_const_expr_flush; + + OneArgAction<IdentifierPtr, SemanticAction::NumericExpression> + act_numeric_expression_const; + + OneArgAction<IntegerLiteralPtr, SemanticAction::NumericExpression> + act_numeric_expression_integer_literal; + + NoArgAction<SemanticAction::NumericExpression> + act_numeric_expression_pos, + act_numeric_expression_neg, + act_numeric_expression_com, + act_numeric_expression_mul, + act_numeric_expression_div, + act_numeric_expression_rem, + act_numeric_expression_add, + act_numeric_expression_sub, + act_numeric_expression_rsh, + act_numeric_expression_lsh, + act_numeric_expression_and, + act_numeric_expression_xor, + act_numeric_expression_or; + + // Exception // // diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction.hpp index c8a31ac38fc..7311cf90910 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction.hpp @@ -10,6 +10,7 @@ #include "CCF/IDL2/SemanticAction/Factory.hpp" #include "CCF/IDL2/SemanticAction/Attribute.hpp" +#include "CCF/IDL2/SemanticAction/Const.hpp" #include "CCF/IDL2/SemanticAction/Enum.hpp" #include "CCF/IDL2/SemanticAction/Exception.hpp" #include "CCF/IDL2/SemanticAction/Include.hpp" @@ -17,6 +18,7 @@ #include "CCF/IDL2/SemanticAction/Member.hpp" #include "CCF/IDL2/SemanticAction/Module.hpp" #include "CCF/IDL2/SemanticAction/Native.hpp" +#include "CCF/IDL2/SemanticAction/NumericExpression.hpp" #include "CCF/IDL2/SemanticAction/Operation.hpp" #include "CCF/IDL2/SemanticAction/Struct.hpp" #include "CCF/IDL2/SemanticAction/Typedef.hpp" diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Const.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Const.hpp new file mode 100644 index 00000000000..dcb7c0054ac --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Const.hpp @@ -0,0 +1,29 @@ +// file : CCF/IDL2/SemanticAction/Const.hpp +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#ifndef CCF_IDL2_SEMANTIC_ACTION_CONST_HPP +#define CCF_IDL2_SEMANTIC_ACTION_CONST_HPP + +#include "CCF/IDL2/SemanticAction/Elements.hpp" + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticAction + { + struct Const + { + virtual void + begin (IdentifierPtr const& type, + SimpleIdentifierPtr const& name) = 0; + + virtual void + expr () = 0; + }; + } + } +} + +#endif // CCF_IDL2_SEMANTIC_ACTION_CONST_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Factory.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Factory.hpp index 7a91093f61e..2f84d760710 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Factory.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Factory.hpp @@ -12,6 +12,7 @@ namespace CCF namespace SemanticAction { struct Attribute; + struct Const; struct Enum; struct Exception; struct Include; @@ -19,6 +20,7 @@ namespace CCF struct Member; struct Module; struct Native; + struct NumericExpression; struct Operation; struct Struct; struct Typedef; @@ -40,6 +42,9 @@ namespace CCF virtual Attribute& attribute () = 0; + virtual Const& + const_ () = 0; + virtual SemanticAction::Enum& enum_ () = 0; @@ -61,6 +66,9 @@ namespace CCF virtual Native& native () = 0; + virtual NumericExpression& + numeric_expression () = 0; + virtual Operation& operation () = 0; diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp new file mode 100644 index 00000000000..6a55fa768c4 --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp @@ -0,0 +1,112 @@ +// file : CCF/IDL2/SemanticAction/Impl/Const.cpp +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#include "CCF/IDL2/SemanticAction/Impl/Const.hpp" + +#include "CCF/IDL2/SemanticGraph/Fundamental.hpp" +#include "CCF/IDL2/SemanticGraph/IntExpression.hpp" + +#include <iostream> + +using std::cerr; +using std::endl; + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticAction + { + namespace Impl + { + using namespace SemanticGraph; + + Const:: + Const (Context& c) + : Base (c) + { + } + + void Const:: + begin (IdentifierPtr const& type_id, + SimpleIdentifierPtr const& name_id) + { + if (ctx.trace ()) + cerr << "const " << type_id << " " << name_id << endl; + + const_ = 0; + + SimpleName name (name_id->lexeme ()); + Name type_name (type_id->lexeme ()); + ScopedName from (ctx.scope ().scoped_name ()); + + try + { + try + { + Type& t (resolve<Type> (from, type_name, Flags::complete)); + + if (dynamic_cast<Octet*> (&t) || + dynamic_cast<Short*> (&t) || + dynamic_cast<UnsignedShort*> (&t) || + dynamic_cast<Long*> (&t) || + dynamic_cast<UnsignedLong*> (&t) || + dynamic_cast<LongLong*> (&t) || + dynamic_cast<UnsignedLongLong*> (&t)) + { + // Integer constant. + // + const_ = &ctx.tu ().new_node<SemanticGraph::IntConst> (); + + ctx.tu ().new_edge<Belongs> (*const_, t); + ctx.tu ().new_edge<Defines> (ctx.scope (), *const_, name); + } + + } + catch (Resolve const&) + { + cerr << "error: invalid const declaration" << endl; + throw; + } + + //@@ I am not handling NotUnique here. For example if + // I provide module name as type then the compiler + // will ICE. Think about other places it may happen + // (attribute, value memebr, typeded, others?). + // + } + catch (NotFound const&) + { + cerr << "no type with name \'" << name + << "\' visible from scope \'" << from << "\'" << endl; + } + catch (WrongType const&) + { + cerr << "declaration with name \'" << name + << "\' visible from scope \'" << from + << "\' is not a type declaration" << endl; + cerr << "using non-type as a const type is illegal" << endl; + } + catch (NotComplete const& e) + { + cerr << "type \'" << e.name () << "\' is not complete" << endl; + } + } + + void Const:: + expr () + { + //@@ Need to check if int_exp_stack is empty. + // + if (const_ && ctx.int_exp_size () > 0) + { + IntExpression& expr (ctx.int_exp_pop ()); + + ctx.tu ().new_edge<Initializes> (expr, *const_); + } + } + } + } + } +} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.hpp new file mode 100644 index 00000000000..37ac3153d16 --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.hpp @@ -0,0 +1,39 @@ +// file : CCF/IDL2/SemanticAction/Impl/Const.hpp +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_CONST_HPP +#define CCF_IDL2_SEMANTIC_ACTION_IMPL_CONST_HPP + +#include "CCF/IDL2/SemanticGraph/Elements.hpp" +#include "CCF/IDL2/SemanticAction/Const.hpp" +#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp" + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticAction + { + namespace Impl + { + struct Const : SemanticAction::Const, Base + { + Const (Context& c); + + virtual void + begin (IdentifierPtr const& type, + SimpleIdentifierPtr const& name); + + virtual void + expr (); + + private: + SemanticGraph::Const* const_; + }; + } + } + } +} + +#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_CONST_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp index bcb83fb20c8..9b32c0931e1 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp @@ -8,6 +8,7 @@ #include <stack> #include "CCF/IDL2/SemanticGraph/Translation.hpp" +#include "CCF/IDL2/SemanticGraph/IntExpression.hpp" #include "CCF/IDL2/SemanticAction/Elements.hpp" @@ -92,12 +93,42 @@ namespace CCF region_ = &r; } + public: + void + int_exp_push (SemanticGraph::IntExpression& e) + { + int_exp_stack_.push (&e); + } + + SemanticGraph::IntExpression& + int_exp_pop () + { + SemanticGraph::IntExpression& e (*int_exp_stack_.top ()); + int_exp_stack_.pop (); + return e; + } + + std::size_t + int_exp_size () + { + return int_exp_stack_.size (); + } + + void + int_exp_flush () + { + while (int_exp_stack_.size ()) + int_exp_stack_.pop (); + } + private: bool trace_; SemanticGraph::TranslationUnit& tu_; SemanticGraph::TranslationRegion* region_; SemanticGraph::Scope* scope_; + std::stack<SemanticGraph::IntExpression*> int_exp_stack_; + private: Context (Context const&); void operator= (Context const&); diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp index 1617e0bfae1..9c5ac4df626 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp @@ -24,6 +24,7 @@ namespace CCF : ctx_ (context.get ("trace-semantic-action", false), tu), attribute_ (ctx_), + const__ (ctx_), enum__ (ctx_), exception_ (ctx_), include_ (ctx_), @@ -31,6 +32,7 @@ namespace CCF member_ (ctx_), module_ (ctx_), native_ (ctx_), + numeric_expression_ (ctx_), operation_ (ctx_), struct__ (ctx_), typedef__ (ctx_), diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp index 9c226581d57..4a0b8aceb8b 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp @@ -16,6 +16,7 @@ //@@ It would be nice to move this includes into .cpp // #include "CCF/IDL2/SemanticAction/Impl/Attribute.hpp" +#include "CCF/IDL2/SemanticAction/Impl/Const.hpp" #include "CCF/IDL2/SemanticAction/Impl/Enum.hpp" #include "CCF/IDL2/SemanticAction/Impl/Exception.hpp" #include "CCF/IDL2/SemanticAction/Impl/Include.hpp" @@ -23,6 +24,7 @@ #include "CCF/IDL2/SemanticAction/Impl/Member.hpp" #include "CCF/IDL2/SemanticAction/Impl/Module.hpp" #include "CCF/IDL2/SemanticAction/Impl/Native.hpp" +#include "CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp" #include "CCF/IDL2/SemanticAction/Impl/Operation.hpp" #include "CCF/IDL2/SemanticAction/Impl/Struct.hpp" #include "CCF/IDL2/SemanticAction/Impl/Typedef.hpp" @@ -52,6 +54,12 @@ namespace CCF return attribute_; } + virtual SemanticAction::Const& + const_ () + { + return const__; + } + virtual SemanticAction::Enum& enum_ () { @@ -94,6 +102,12 @@ namespace CCF return native_; } + virtual SemanticAction::NumericExpression& + numeric_expression () + { + return numeric_expression_; + } + virtual SemanticAction::Operation& operation () { @@ -153,6 +167,7 @@ namespace CCF private: Attribute attribute_; + Const const__; Enum enum__; Exception exception_; Include include_; @@ -160,6 +175,7 @@ namespace CCF Member member_; Module module_; Native native_; + NumericExpression numeric_expression_; Operation operation_; Struct struct__; Typedef typedef__; diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp new file mode 100644 index 00000000000..49f26cbcacb --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp @@ -0,0 +1,338 @@ +// file : CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#include "CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp" + +#include "CCF/IDL2/SemanticGraph/Elements.hpp" +#include "CCF/IDL2/SemanticGraph/IntExpression.hpp" + +#include <iostream> + +using std::cerr; +using std::endl; + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticAction + { + namespace Impl + { + using namespace SemanticGraph; + + NumericExpression:: + NumericExpression (Context& c) + : Base (c) + { + } + + void NumericExpression:: + flush () + { + if (ctx.trace ()) + cerr << "expression" << endl; + + ctx.int_exp_flush (); + } + + void NumericExpression:: + const_ (IdentifierPtr const& id) + { + if (ctx.trace ()) + cerr << "const " << id << endl; + + Name name (id->lexeme ()); + ScopedName from (ctx.scope ().scoped_name ()); + + try + { + try + { + Const& c (resolve<Const> (from, name)); + + if (IntConst* ic = dynamic_cast<IntConst*> (&c)) + { + ctx.int_exp_push (*ic); + } + } + catch (Resolve const&) + { + cerr << "error: invalid reference to const" << endl; + throw; + } + } + catch (NotFound const&) + { + cerr << "no const with name \'" << name + << "\' visible from scope \'" << from << "\'" << endl; + } + catch (WrongType const&) + { + cerr << "declaration with name \'" << name + << "\' visible from scope \'" << from + << "\' is not a const declaration" << endl; + cerr << "using non-const as a reference to const is illegal" + << endl; + } + } + + void NumericExpression:: + integer_literal (IntegerLiteralPtr const& il) + { + if (ctx.trace ()) + cerr << "integer literal " << il->value () << endl; + + ctx.int_exp_push (ctx.tu ().new_node<IntLiteral> (il->value ())); + } + + void NumericExpression:: + pos () + { + if (ctx.trace ()) + cerr << "unary +" << endl; + + // Nothing to do. + } + + void NumericExpression:: + neg () + { + if (ctx.trace ()) + cerr << "unary -" << endl; + + if (ctx.int_exp_size () < 1) + return; + + IntExpression& expr (ctx.int_exp_pop ()); + + IntNeg& neg (ctx.tu ().new_node<IntNeg> ()); + + ctx.tu ().new_edge<IntNegates> (neg, expr); + + ctx.int_exp_push (neg); + } + + void NumericExpression:: + com () + { + if (ctx.trace ()) + cerr << "unary ~" << endl; + + if (ctx.int_exp_size () < 1) + return; + + IntExpression& expr (ctx.int_exp_pop ()); + + IntCom& com (ctx.tu ().new_node<IntCom> ()); + + ctx.tu ().new_edge<IntComplements> (com, expr); + + ctx.int_exp_push (com); + } + + void NumericExpression:: + mul () + { + if (ctx.trace ()) + cerr << "*" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& multiplier (ctx.int_exp_pop ()); + IntExpression& multiplicand (ctx.int_exp_pop ()); + + IntMul& mul (ctx.tu ().new_node<IntMul> ()); + + ctx.tu ().new_edge<IntMultiplies> (mul, multiplicand); + ctx.tu ().new_edge<IntMultiplies> (mul, multiplier); + + ctx.int_exp_push (mul); + } + + void NumericExpression:: + div () + { + if (ctx.trace ()) + cerr << "/" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& divisor (ctx.int_exp_pop ()); + IntExpression& divident (ctx.int_exp_pop ()); + + IntDiv& div (ctx.tu ().new_node<IntDiv> ()); + + ctx.tu ().new_edge<IntDivides> (div, divident); + ctx.tu ().new_edge<IntDivides> (div, divisor); + + ctx.int_exp_push (div); + } + + void NumericExpression:: + rem () + { + if (ctx.trace ()) + cerr << "%" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& divisor (ctx.int_exp_pop ()); + IntExpression& divident (ctx.int_exp_pop ()); + + IntRem& rem (ctx.tu ().new_node<IntRem> ()); + + ctx.tu ().new_edge<IntDivides> (rem, divident); + ctx.tu ().new_edge<IntDivides> (rem, divisor); + + ctx.int_exp_push (rem); + } + + + void NumericExpression:: + add () + { + if (ctx.trace ()) + cerr << "+" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& second_item (ctx.int_exp_pop ()); + IntExpression& first_item (ctx.int_exp_pop ()); + + IntAdd& add (ctx.tu ().new_node<IntAdd> ()); + + ctx.tu ().new_edge<IntAdds> (add, first_item); + ctx.tu ().new_edge<IntAdds> (add, second_item); + + ctx.int_exp_push (add); + } + + void NumericExpression:: + sub () + { + if (ctx.trace ()) + cerr << "-" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& subtrahend (ctx.int_exp_pop ()); + IntExpression& minuend (ctx.int_exp_pop ()); + + IntSub& sub (ctx.tu ().new_node<IntSub> ()); + + ctx.tu ().new_edge<IntSubtracts> (sub, minuend); + ctx.tu ().new_edge<IntSubtracts> (sub, subtrahend); + + ctx.int_exp_push (sub); + } + + void NumericExpression:: + rsh () + { + if (ctx.trace ()) + cerr << ">>" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& factor (ctx.int_exp_pop ()); + IntExpression& pattern (ctx.int_exp_pop ()); + + IntRsh& rsh (ctx.tu ().new_node<IntRsh> ()); + + ctx.tu ().new_edge<IntShifts> (rsh, pattern); + ctx.tu ().new_edge<IntShifts> (rsh, factor); + + ctx.int_exp_push (rsh); + } + + void NumericExpression:: + lsh () + { + if (ctx.trace ()) + cerr << "<<" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& factor (ctx.int_exp_pop ()); + IntExpression& pattern (ctx.int_exp_pop ()); + + IntLsh& lsh (ctx.tu ().new_node<IntLsh> ()); + + ctx.tu ().new_edge<IntShifts> (lsh, pattern); + ctx.tu ().new_edge<IntShifts> (lsh, factor); + + ctx.int_exp_push (lsh); + } + + void NumericExpression:: + and_ () + { + if (ctx.trace ()) + cerr << "&" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& second_pattern (ctx.int_exp_pop ()); + IntExpression& first_pattern (ctx.int_exp_pop ()); + + IntAnd& and_ (ctx.tu ().new_node<IntAnd> ()); + + ctx.tu ().new_edge<IntConjuncts> (and_, first_pattern); + ctx.tu ().new_edge<IntConjuncts> (and_, second_pattern); + + ctx.int_exp_push (and_); + } + + void NumericExpression:: + xor_ () + { + if (ctx.trace ()) + cerr << "^" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& second_pattern (ctx.int_exp_pop ()); + IntExpression& first_pattern (ctx.int_exp_pop ()); + + IntXor& xor_ (ctx.tu ().new_node<IntXor> ()); + + ctx.tu ().new_edge<IntExclusivelyDisjuncts> (xor_, first_pattern); + ctx.tu ().new_edge<IntExclusivelyDisjuncts> (xor_, second_pattern); + + ctx.int_exp_push (xor_); + } + + void NumericExpression:: + or_ () + { + if (ctx.trace ()) + cerr << "|" << endl; + + if (ctx.int_exp_size () < 2) + return; + + IntExpression& second_pattern (ctx.int_exp_pop ()); + IntExpression& first_pattern (ctx.int_exp_pop ()); + + IntOr& or_ (ctx.tu ().new_node<IntOr> ()); + + ctx.tu ().new_edge<IntInclusivelyDisjuncts> (or_, first_pattern); + ctx.tu ().new_edge<IntInclusivelyDisjuncts> (or_, second_pattern); + + ctx.int_exp_push (or_); + } + } + } + } +} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp new file mode 100644 index 00000000000..53fc8b2e010 --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp @@ -0,0 +1,80 @@ +// file : CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_NUMERIC_EXPRESSION_HPP +#define CCF_IDL2_SEMANTIC_ACTION_IMPL_NUMERIC_EXPRESSION_HPP + +#include "CCF/IDL2/SemanticGraph/Elements.hpp" +#include "CCF/IDL2/SemanticAction/NumericExpression.hpp" +#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp" + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticAction + { + namespace Impl + { + struct NumericExpression : SemanticAction::NumericExpression, Base + { + NumericExpression (Context& c); + + virtual void + flush (); + + virtual void + const_ (IdentifierPtr const&); + + virtual void + integer_literal (IntegerLiteralPtr const&); + + virtual void + pos (); + + virtual void + neg (); + + virtual void + com (); + + virtual void + mul (); + + virtual void + div (); + + virtual void + rem (); + + virtual void + add (); + + virtual void + sub (); + + virtual void + rsh (); + + virtual void + lsh (); + + virtual void + and_ (); + + virtual void + xor_ (); + + virtual void + or_ (); + + + private: + }; + } + } + } +} + +#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_NUMERIC_EXPRESSION_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/NumericExpression.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/NumericExpression.hpp new file mode 100644 index 00000000000..09dcc964cb6 --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/NumericExpression.hpp @@ -0,0 +1,70 @@ +// file : CCF/IDL2/SemanticAction/NumericExpression.hpp +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#ifndef CCF_IDL2_SEMANTIC_ACTION_NUMERIC_EXPRESSION_HPP +#define CCF_IDL2_SEMANTIC_ACTION_NUMERIC_EXPRESSION_HPP + +#include "CCF/IDL2/SemanticAction/Elements.hpp" + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticAction + { + struct NumericExpression + { + virtual void + flush () = 0; + + virtual void + const_ (IdentifierPtr const&) = 0; + + virtual void + integer_literal (IntegerLiteralPtr const&) = 0; + + virtual void + pos () = 0; + + virtual void + neg () = 0; + + virtual void + com () = 0; + + virtual void + mul () = 0; + + virtual void + div () = 0; + + virtual void + rem () = 0; + + virtual void + add () = 0; + + virtual void + sub () = 0; + + virtual void + rsh () = 0; + + virtual void + lsh () = 0; + + virtual void + and_ () = 0; + + virtual void + xor_ () = 0; + + virtual void + or_ () = 0; + }; + } + } +} + +#endif // CCF_IDL2_SEMANTIC_ACTION_NUMERIC_EXPRESSION_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph.hpp index 611ac02c8cc..fcb798887ce 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph.hpp @@ -17,6 +17,7 @@ #include "CCF/IDL2/SemanticGraph/Module.hpp" #include "CCF/IDL2/SemanticGraph/Name.hpp" #include "CCF/IDL2/SemanticGraph/Native.hpp" +#include "CCF/IDL2/SemanticGraph/IntExpression.hpp" #include "CCF/IDL2/SemanticGraph/Operation.hpp" #include "CCF/IDL2/SemanticGraph/Sequence.hpp" #include "CCF/IDL2/SemanticGraph/Struct.hpp" diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp index 9c12714bc58..ef1c8892b9a 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp @@ -433,6 +433,68 @@ namespace CCF static_type_info () { return inherits_; } + // Initializes + // + // + namespace + { + TypeInfo + initializes_init_ () + { + TypeInfo ti (typeid (Initializes)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo initializes_ (initializes_init_ ()); + } + + TypeInfo const& Initializes:: + static_type_info () { return initializes_; } + + + // Expression + // + // + namespace + { + TypeInfo + expression_init_ () + { + TypeInfo ti (typeid (Expression)); + ti.add_base (Access::PUBLIC, true, Node::static_type_info ()); + return ti; + } + + TypeInfo expression_ (expression_init_ ()); + } + + TypeInfo const& Expression:: + static_type_info () { return expression_; } + + + // Const + // + // + namespace + { + TypeInfo + const_init_ () + { + TypeInfo ti (typeid (Const)); + ti.add_base (Access::PUBLIC, true, Instance::static_type_info ()); + ti.add_base (Access::PUBLIC, true, Nameable::static_type_info ()); + ti.add_base (Access::PUBLIC, true, Expression::static_type_info ()); + return ti; + } + + TypeInfo const_ (const_init_ ()); + } + + TypeInfo const& Const:: + static_type_info () { return const_; } + + // Contains // // diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp index 5008a43f5d8..05d11f5057f 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp @@ -634,8 +634,6 @@ namespace CCF Specialized* specialized_; }; - - class Specialized : public virtual Edge { public: @@ -760,6 +758,107 @@ namespace CCF // // + + class Expression; + class Const; + + class Initializes: public virtual Edge + { + public: + Expression& + expression () const + { + return *expression_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + Initializes () + { + type_info (static_type_info ()); + } + + void + set_left_node (Expression& e) + { + expression_ = &e; + } + + void + set_right_node (Const& n) + { + } + + private: + Expression* expression_; + }; + + + class Expression: public virtual Node + { + public: + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + Expression () + { + type_info (static_type_info ()); + } + + void + add_edge_left (Initializes&) + { + } + }; + + + class Const: public virtual Instance, + public virtual Nameable, + public virtual Expression + { + public: + Initializes& + initialized () const + { + return *initialized_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + Const () + { + type_info (static_type_info ()); + } + + using Instance::add_edge_left; + using Expression::add_edge_left; + + void + add_edge_right (Initializes& i) + { + initialized_ = &i; + } + + using Nameable::add_edge_right; + + private: + Initializes* initialized_; + }; + + + // + // // class Container; diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/IntExpression.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/IntExpression.cpp new file mode 100644 index 00000000000..b294e197df1 --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/IntExpression.cpp @@ -0,0 +1,482 @@ +// file : CCF/IDL2/SemanticGraph/IntExpression.cpp +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#include "CCF/IDL2/SemanticGraph/IntExpression.hpp" + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticGraph + { + using Introspection::TypeInfo; + using Introspection::Access; + + // IntExpression + // + namespace + { + TypeInfo + int_expression_init_ () + { + TypeInfo ti (typeid (IntExpression)); + ti.add_base (Access::PUBLIC, true, Expression::static_type_info ()); + return ti; + } + + TypeInfo int_expression_ (int_expression_init_ ()); + } + + TypeInfo const& IntExpression:: + static_type_info () { return int_expression_; } + + + // IntLiteral + // + namespace + { + TypeInfo + int_literal_init_ () + { + TypeInfo ti (typeid (IntLiteral)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_literal_ (int_literal_init_ ()); + } + + TypeInfo const& IntLiteral:: + static_type_info () { return int_literal_; } + + + // IntConst + // + namespace + { + TypeInfo + int_const_init_ () + { + TypeInfo ti (typeid (IntConst)); + ti.add_base (Access::PUBLIC, true, Const::static_type_info ()); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_const_ (int_const_init_ ()); + } + + TypeInfo const& IntConst:: + static_type_info () { return int_const_; } + + + // NEG + // + + namespace + { + TypeInfo + int_negates_init_ () + { + TypeInfo ti (typeid (IntNegates)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_negates_ (int_negates_init_ ()); + } + + TypeInfo const& IntNegates:: + static_type_info () { return int_negates_; } + + namespace + { + TypeInfo + int_neg_init_ () + { + TypeInfo ti (typeid (IntNeg)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_neg_ (int_neg_init_ ()); + } + + TypeInfo const& IntNeg:: + static_type_info () { return int_neg_; } + + + // COM + // + + namespace + { + TypeInfo + int_complements_init_ () + { + TypeInfo ti (typeid (IntComplements)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_complements_ (int_complements_init_ ()); + } + + TypeInfo const& IntComplements:: + static_type_info () { return int_complements_; } + + namespace + { + TypeInfo + int_com_init_ () + { + TypeInfo ti (typeid (IntCom)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_com_ (int_com_init_ ()); + } + + TypeInfo const& IntCom:: + static_type_info () { return int_com_; } + + + // MUL + // + + namespace + { + TypeInfo + int_multiplies_init_ () + { + TypeInfo ti (typeid (IntMultiplies)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_multiplies_ (int_multiplies_init_ ()); + } + + TypeInfo const& IntMultiplies:: + static_type_info () { return int_multiplies_; } + + namespace + { + TypeInfo + int_mul_init_ () + { + TypeInfo ti (typeid (IntMul)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_mul_ (int_mul_init_ ()); + } + + TypeInfo const& IntMul:: + static_type_info () { return int_mul_; } + + + // DIV + // + + namespace + { + TypeInfo + int_divides_init_ () + { + TypeInfo ti (typeid (IntDivides)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_divides_ (int_divides_init_ ()); + } + + TypeInfo const& IntDivides:: + static_type_info () { return int_divides_; } + + namespace + { + TypeInfo + int_div_init_ () + { + TypeInfo ti (typeid (IntDiv)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_div_ (int_div_init_ ()); + } + + TypeInfo const& IntDiv:: + static_type_info () { return int_div_; } + + namespace + { + TypeInfo + int_rem_init_ () + { + TypeInfo ti (typeid (IntRem)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_rem_ (int_rem_init_ ()); + } + + TypeInfo const& IntRem:: + static_type_info () { return int_rem_; } + + + // ADD + // + + namespace + { + TypeInfo + int_adds_init_ () + { + TypeInfo ti (typeid (IntAdds)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_adds_ (int_adds_init_ ()); + } + + TypeInfo const& IntAdds:: + static_type_info () { return int_adds_; } + + namespace + { + TypeInfo + int_add_init_ () + { + TypeInfo ti (typeid (IntAdd)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_add_ (int_add_init_ ()); + } + + TypeInfo const& IntAdd:: + static_type_info () { return int_add_; } + + + // SUB + // + + namespace + { + TypeInfo + int_subtracts_init_ () + { + TypeInfo ti (typeid (IntSubtracts)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_subtracts_ (int_subtracts_init_ ()); + } + + TypeInfo const& IntSubtracts:: + static_type_info () { return int_subtracts_; } + + namespace + { + TypeInfo + int_sub_init_ () + { + TypeInfo ti (typeid (IntSub)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_sub_ (int_sub_init_ ()); + } + + TypeInfo const& IntSub:: + static_type_info () { return int_sub_; } + + + // RSH & LSH + // + + namespace + { + TypeInfo + int_shifts_init_ () + { + TypeInfo ti (typeid (IntShifts)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_shifts_ (int_shifts_init_ ()); + } + + TypeInfo const& IntShifts:: + static_type_info () { return int_shifts_; } + + namespace + { + TypeInfo + int_rsh_init_ () + { + TypeInfo ti (typeid (IntRsh)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_rsh_ (int_rsh_init_ ()); + } + + TypeInfo const& IntRsh:: + static_type_info () { return int_rsh_; } + + namespace + { + TypeInfo + int_lsh_init_ () + { + TypeInfo ti (typeid (IntLsh)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_lsh_ (int_lsh_init_ ()); + } + + TypeInfo const& IntLsh:: + static_type_info () { return int_lsh_; } + + + // AND + // + + namespace + { + TypeInfo + int_conjuncts_init_ () + { + TypeInfo ti (typeid (IntConjuncts)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_conjuncts_ (int_conjuncts_init_ ()); + } + + TypeInfo const& IntConjuncts:: + static_type_info () { return int_conjuncts_; } + + namespace + { + TypeInfo + int_and_init_ () + { + TypeInfo ti (typeid (IntAnd)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_and_ (int_and_init_ ()); + } + + TypeInfo const& IntAnd:: + static_type_info () { return int_and_; } + + + // XOR + // + + namespace + { + TypeInfo + int_exclusively_disjuncts_init_ () + { + TypeInfo ti (typeid (IntExclusivelyDisjuncts)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_exclusively_disjuncts_ ( + int_exclusively_disjuncts_init_ ()); + } + + TypeInfo const& IntExclusivelyDisjuncts:: + static_type_info () { return int_exclusively_disjuncts_; } + + namespace + { + TypeInfo + int_xor_init_ () + { + TypeInfo ti (typeid (IntXor)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_xor_ (int_xor_init_ ()); + } + + TypeInfo const& IntXor:: + static_type_info () { return int_xor_; } + + + // OR + // + + namespace + { + TypeInfo + int_inclusively_disjuncts_init_ () + { + TypeInfo ti (typeid (IntInclusivelyDisjuncts)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo int_inclusively_disjuncts_ ( + int_inclusively_disjuncts_init_ ()); + } + + TypeInfo const& IntInclusivelyDisjuncts:: + static_type_info () { return int_inclusively_disjuncts_; } + + namespace + { + TypeInfo + int_or_init_ () + { + TypeInfo ti (typeid (IntOr)); + ti.add_base ( + Access::PUBLIC, true, IntExpression::static_type_info ()); + return ti; + } + + TypeInfo int_or_ (int_or_init_ ()); + } + + TypeInfo const& IntOr:: + static_type_info () { return int_or_; } + } + } +} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/IntExpression.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/IntExpression.hpp new file mode 100644 index 00000000000..da0c4fc85cb --- /dev/null +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/IntExpression.hpp @@ -0,0 +1,987 @@ +// file : CCF/IDL2/SemanticGraph/IntExpression.hpp +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#ifndef CCF_IDL2_SEMANTIC_GRAPH_INT_EXPRESSION_HPP +#define CCF_IDL2_SEMANTIC_GRAPH_INT_EXPRESSION_HPP + +#include "CCF/IDL2/SemanticGraph/Elements.hpp" + +namespace CCF +{ + namespace IDL2 + { + namespace SemanticGraph + { + // + // + class IntExpression: public virtual Expression + { + public: + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntExpression () + { + type_info (static_type_info ()); + } + }; + + + // + // + class IntLiteral: public virtual IntExpression + { + public: + unsigned long long + value () const + { + return value_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntLiteral (unsigned long long value) + : value_ (value) + { + type_info (static_type_info ()); + } + + private: + unsigned long long value_; + }; + + + // + // + class IntConst: public virtual Const, + public virtual IntExpression + { + public: + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntConst () + { + type_info (static_type_info ()); + } + }; + + + // NEG + // + + class IntNeg; + + class IntNegates: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntNegates () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntNeg&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntNeg: public virtual IntExpression + { + public: + IntNegates& + negates () const + { + return *negates_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntNeg () + : negates_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntNegates& n) + { + negates_ = &n; + } + + private: + IntNegates* negates_; + }; + + + // COM + // + + class IntCom; + + class IntComplements: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntComplements () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntCom&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntCom: public virtual IntExpression + { + public: + IntComplements& + complements () const + { + return *complements_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntCom () + : complements_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntComplements& n) + { + complements_ = &n; + } + + private: + IntComplements* complements_; + }; + + + // MUL + // + + class IntMul; + + class IntMultiplies: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntMultiplies () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntMul&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntMul: public virtual IntExpression + { + public: + IntMultiplies& + first_factor () const + { + return *first_factor_; + } + + IntMultiplies& + second_factor () const + { + return *second_factor_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntMul () + : first_factor_ (0), second_factor_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntMultiplies& d) + { + if (first_factor_ == 0) + first_factor_ = &d; + else + second_factor_ = &d; + } + + private: + IntMultiplies* first_factor_; + IntMultiplies* second_factor_; + }; + + + // DIV & REM + // + + class IntDiv; + class IntRem; + + class IntDivides: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntDivides () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntDiv&) + { + } + + void + set_left_node (IntRem&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntDiv: public virtual IntExpression + { + public: + IntDivides& + divident () const + { + return *divident_; + } + + IntDivides& + divisor () const + { + return *divisor_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntDiv () + : divident_ (0), divisor_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntDivides& d) + { + if (divident_ == 0) + divident_ = &d; + else + divisor_ = &d; + } + + private: + IntDivides* divident_; + IntDivides* divisor_; + }; + + class IntRem: public virtual IntExpression + { + public: + IntDivides& + divident () const + { + return *divident_; + } + + IntDivides& + divisor () const + { + return *divisor_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntRem () + : divident_ (0), divisor_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntDivides& d) + { + if (divident_ == 0) + divident_ = &d; + else + divisor_ = &d; + } + + private: + IntDivides* divident_; + IntDivides* divisor_; + }; + + + // ADD + // + + class IntAdd; + + class IntAdds: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntAdds () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntAdd&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntAdd: public virtual IntExpression + { + public: + IntAdds& + first_item () const + { + return *first_item_; + } + + IntAdds& + second_item () const + { + return *second_item_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntAdd () + : first_item_ (0), second_item_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntAdds& d) + { + if (first_item_ == 0) + first_item_ = &d; + else + second_item_ = &d; + } + + private: + IntAdds* first_item_; + IntAdds* second_item_; + }; + + + // SUB + // + + class IntSub; + + class IntSubtracts: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntSubtracts () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntSub&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntSub: public virtual IntExpression + { + public: + IntSubtracts& + minuend () const + { + return *minuend_; + } + + IntSubtracts& + subtrahend () const + { + return *subtrahend_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntSub () + : minuend_ (0), subtrahend_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntSubtracts& d) + { + if (minuend_ == 0) + minuend_ = &d; + else + subtrahend_ = &d; + } + + private: + IntSubtracts* minuend_; + IntSubtracts* subtrahend_; + }; + + + // RSH & LSH + // + + class IntRsh; + class IntLsh; + + class IntShifts: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntShifts () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntRsh&) + { + } + + void + set_left_node (IntLsh&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntRsh: public virtual IntExpression + { + public: + IntShifts& + pattern () const + { + return *pattern_; + } + + IntShifts& + factor () const + { + return *factor_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntRsh () + : pattern_ (0), factor_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntShifts& d) + { + if (pattern_ == 0) + pattern_ = &d; + else + factor_ = &d; + } + + private: + IntShifts* pattern_; + IntShifts* factor_; + }; + + class IntLsh: public virtual IntExpression + { + public: + IntShifts& + pattern () const + { + return *pattern_; + } + + IntShifts& + factor () const + { + return *factor_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntLsh () + : pattern_ (0), factor_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntShifts& d) + { + if (pattern_ == 0) + pattern_ = &d; + else + factor_ = &d; + } + + private: + IntShifts* pattern_; + IntShifts* factor_; + }; + + + // AND + // + + class IntAnd; + + class IntConjuncts: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntConjuncts () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntAnd&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntAnd: public virtual IntExpression + { + public: + IntConjuncts& + first_pattern () const + { + return *first_pattern_; + } + + IntConjuncts& + second_pattern () const + { + return *second_pattern_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntAnd () + : first_pattern_ (0), second_pattern_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntConjuncts& d) + { + if (first_pattern_ == 0) + first_pattern_ = &d; + else + second_pattern_ = &d; + } + + private: + IntConjuncts* first_pattern_; + IntConjuncts* second_pattern_; + }; + + + // XOR + // + + class IntXor; + + class IntExclusivelyDisjuncts: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntExclusivelyDisjuncts () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntXor&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntXor: public virtual IntExpression + { + public: + IntExclusivelyDisjuncts& + first_pattern () const + { + return *first_pattern_; + } + + IntExclusivelyDisjuncts& + second_pattern () const + { + return *second_pattern_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntXor () + : first_pattern_ (0), second_pattern_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntExclusivelyDisjuncts& d) + { + if (first_pattern_ == 0) + first_pattern_ = &d; + else + second_pattern_ = &d; + } + + private: + IntExclusivelyDisjuncts* first_pattern_; + IntExclusivelyDisjuncts* second_pattern_; + }; + + + // OR + // + + class IntOr; + + class IntInclusivelyDisjuncts: public virtual Edge + { + public: + IntExpression& + argument () const + { + return *argument_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntInclusivelyDisjuncts () + { + type_info (static_type_info ()); + } + + void + set_left_node (IntOr&) + { + } + + void + set_right_node (IntExpression& e) + { + argument_ = &e; + } + + private: + IntExpression* argument_; + }; + + + class IntOr: public virtual IntExpression + { + public: + IntInclusivelyDisjuncts& + first_pattern () const + { + return *first_pattern_; + } + + IntInclusivelyDisjuncts& + second_pattern () const + { + return *second_pattern_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + IntOr () + : first_pattern_ (0), second_pattern_ (0) + { + type_info (static_type_info ()); + } + + void + add_edge_left (IntInclusivelyDisjuncts& d) + { + if (first_pattern_ == 0) + first_pattern_ = &d; + else + second_pattern_ = &d; + } + + private: + IntInclusivelyDisjuncts* first_pattern_; + IntInclusivelyDisjuncts* second_pattern_; + }; + } + } +} + +#endif // CCF_IDL2_SEMANTIC_GRAPH_INT_EXPRESSION_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/Parser.cpp b/TAO/CIAO/CCF/CCF/IDL3/Parser.cpp index 1d04529c1fe..38eeeb087df 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/Parser.cpp +++ b/TAO/CIAO/CCF/CCF/IDL3/Parser.cpp @@ -221,7 +221,7 @@ namespace CCF )[act_component_begin_def] >> component_inheritance_spec >> !(SUPPORTS >> component_support_spec) - >> LBRACE[act_component_open_scope] + >> LCBRACE[act_component_open_scope] >> component_def_trailer ) | @@ -231,14 +231,14 @@ namespace CCF >> SUPPORTS )[act_component_begin_def] >> component_support_spec - >> LBRACE[act_component_open_scope] + >> LCBRACE[act_component_open_scope] >> component_def_trailer ) | ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_component_begin_def][act_component_open_scope] >> component_def_trailer ) @@ -248,7 +248,7 @@ namespace CCF component_def_trailer = component_body - >> RBRACE[act_component_close_scope] + >> RCBRACE[act_component_close_scope] >> SEMI[act_component_end] ; @@ -329,7 +329,7 @@ namespace CCF >> event_type_inheritance_spec >> !(SUPPORTS >> event_type_supports_spec) - >> LBRACE[act_event_type_open_scope] + >> LCBRACE[act_event_type_open_scope] >> event_type_def_trailer ) | @@ -340,14 +340,14 @@ namespace CCF )[act_event_type_begin_abstract_def] >> event_type_supports_spec - >> LBRACE[act_event_type_open_scope] + >> LCBRACE[act_event_type_open_scope] >> event_type_def_trailer ) | ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_event_type_begin_abstract_def][act_event_type_open_scope] >> event_type_def_trailer @@ -373,7 +373,7 @@ namespace CCF >> event_type_inheritance_spec >> !(SUPPORTS >> event_type_supports_spec) - >> LBRACE[act_event_type_open_scope] + >> LCBRACE[act_event_type_open_scope] >> event_type_def_trailer ) | @@ -384,14 +384,14 @@ namespace CCF )[act_event_type_begin_concrete_def] >> event_type_supports_spec - >> LBRACE[act_event_type_open_scope] + >> LCBRACE[act_event_type_open_scope] >> event_type_def_trailer ) | ( ( simple_identifier - >> LBRACE + >> LCBRACE )[act_event_type_begin_concrete_def][act_event_type_open_scope] >> event_type_def_trailer @@ -419,7 +419,7 @@ namespace CCF event_type_def_trailer = event_type_body - >> RBRACE[act_event_type_close_scope] + >> RCBRACE[act_event_type_close_scope] >> SEMI[act_event_type_end] ; @@ -476,9 +476,9 @@ namespace CCF >> !(COLON >> home_inheritance_spec) >> !(SUPPORTS >> home_support_spec) >> MANAGES >> home_manage_spec - >> LBRACE[act_home_open_scope] + >> LCBRACE[act_home_open_scope] >> home_body - >> RBRACE[act_home_close_scope] + >> RCBRACE[act_home_close_scope] >> SEMI[act_home_end] ; |