1 #ifndef AWFUL_IDLPARSE_ASTCLASS_H_
2 #define AWFUL_IDLPARSE_ASTCLASS_H_
6 namespace awful
{ namespace idlparser
8 // Grammar action functors used to build class AST elements.
10 struct action_NewClass
12 action_NewClass( ASTState
& State_
) :
17 template< typename TokenT
> void operator()( const TokenT
& tok
) const
19 // std::cout << "class: " << tok.get_value() << std::endl;
20 m_State
.m_pCurrentClass
=
21 new idlast::Class( tok
.get_value().c_str(),
22 tok
.get_position().get_file().c_str(),
23 tok
.get_position().get_line() );
25 m_State
.m_pCurrentNamespace
->addClass( m_State
.m_pCurrentClass
);
27 m_State
.m_pCurrentClass
->setFlags( m_State
.m_ClassFlags
);
28 m_State
.m_MembersFlags
.clear();
29 m_State
.m_pCurrentFlags
= &m_State
.m_MembersFlags
;
35 struct action_NewStruct
37 action_NewStruct( ASTState
& State_
) :
42 template< typename TokenT
> void operator()( const TokenT
& tok
) const
44 // std::cout << "class: " << tok.get_value() << std::endl;
45 m_State
.m_pCurrentClass
=
46 new idlast::Class( tok
.get_value().c_str(),
47 tok
.get_position().get_file().c_str(),
48 tok
.get_position().get_line() );
50 m_State
.m_pCurrentNamespace
->addStruct( m_State
.m_pCurrentClass
);
52 m_State
.m_pCurrentClass
->setFlags( m_State
.m_ClassFlags
);
53 m_State
.m_MembersFlags
.clear();
54 m_State
.m_pCurrentFlags
= &m_State
.m_MembersFlags
;
60 struct action_AddSuperClass
62 action_AddSuperClass( ASTState
& State_
) :
67 template< typename IterT
> void operator()( const IterT
& first
, const IterT
& last
) const
69 // std::cout << "addsuperclass\n";
70 m_State
.m_pCurrentClass
->addSuperClass( m_State
.m_pCurrentClassRef
);
71 m_State
.m_pCurrentClassRef
= NULL
;
77 struct action_EndClass
79 action_EndClass( ASTState
& State_
) :
84 template< typename IterT
> void operator()( const IterT
& first
, const IterT
& last
) const
86 m_State
.m_pCurrentFlags
= &m_State
.m_ClassFlags
;