2 #include "be_valuetype.h"
3 #include "be_eventtype.h"
4 #include "be_connector.h"
7 #include "be_exception.h"
9 #include "be_structure.h"
11 #include "be_operation.h"
12 #include "be_factory.h"
13 #include "be_finder.h"
15 #include "be_visitor.h"
17 // Default Constructor.
25 be_scope::be_scope (AST_Decl::NodeType type
)
31 be_scope::~be_scope ()
35 // Code generation methods.
38 be_scope::be_add_field (AST_Field
*f
)
40 return this->fe_add_field (f
);
44 be_scope::be_add_argument (AST_Argument
*)
50 be_scope::comma (unsigned short comma
)
56 be_scope::comma () const
61 // Return the scope created by this node (if one exists, else NULL).
65 switch (this->scope_node_type ())
67 case AST_Decl::NT_interface
:
68 return dynamic_cast<be_interface
*> (this);
69 case AST_Decl::NT_valuetype
:
70 return dynamic_cast<be_valuetype
*> (this);
71 case AST_Decl::NT_eventtype
:
72 return dynamic_cast<be_eventtype
*> (this);
73 case AST_Decl::NT_component
:
74 return dynamic_cast<be_component
*> (this);
75 case AST_Decl::NT_connector
:
76 return dynamic_cast<be_connector
*> (this);
77 case AST_Decl::NT_home
:
78 return dynamic_cast<be_home
*> (this);
79 case AST_Decl::NT_module
:
80 return dynamic_cast<be_module
*> (this);
81 case AST_Decl::NT_root
:
82 return dynamic_cast<be_root
*> (this);
83 case AST_Decl::NT_except
:
84 return dynamic_cast<be_exception
*> (this);
85 case AST_Decl::NT_union
:
86 return dynamic_cast<be_union
*> (this);
87 case AST_Decl::NT_struct
:
88 return dynamic_cast<be_structure
*> (this);
89 case AST_Decl::NT_enum
:
90 return dynamic_cast<be_enum
*> (this);
92 return dynamic_cast<be_operation
*> (this);
93 case AST_Decl::NT_factory
:
94 return dynamic_cast<be_factory
*> (this);
95 case AST_Decl::NT_finder
:
96 return dynamic_cast<be_finder
*> (this);
108 be_scope::accept (be_visitor
*visitor
)
110 return visitor
->visit_scope (this);