1 #ifndef AWFUL_IDLPARSE_ASTMETHOD_H_
2 #define AWFUL_IDLPARSE_ASTMETHOD_H_
6 namespace awful
{ namespace idlparser
8 // Grammar action functors used to build method AST elements.
10 struct action_NewMethod
12 action_NewMethod( ASTState
& State_
) :
17 template< typename IterT
> void operator()( const IterT
& first
, const IterT
& last
) const
19 idlast::Method
* pMethod
= m_State
.m_pCurrentClass
->getOrAddMethod(
20 m_State
.m_CurrentIdentifier
, m_State
.m_MembersFlags
);
21 pMethod
->addOverload( m_State
.m_pCurrentParamList
);
22 m_State
.m_pCurrentParamList
= NULL
;
24 if( m_State
.m_bVirtualMethod
)
26 pMethod
->setFlag( "Virtual", true );
27 m_State
.m_bVirtualMethod
= false;
34 struct action_NewStaticMethod
36 action_NewStaticMethod( ASTState
& State_
) :
41 template< typename IterT
> void operator()( const IterT
& first
, const IterT
& last
) const
43 idlast::Method
* pMethod
= m_State
.m_pCurrentClass
->getOrAddStaticMethod(
44 m_State
.m_CurrentIdentifier
);
45 pMethod
->addOverload( m_State
.m_pCurrentParamList
);
46 m_State
.m_pCurrentParamList
= NULL
;
52 struct action_CtorNameCheck
54 action_CtorNameCheck( ASTState
& State_
) :
59 bool operator()() const
61 return m_State
.m_CurrentIdentifier
== m_State
.m_pCurrentClass
->getName();
67 struct action_NewConstructor
69 action_NewConstructor( ASTState
& State_
) :
74 template< typename IterT
> void operator()( const IterT
& first
, const IterT
& last
) const
76 m_State
.m_pCurrentClass
->addConstructor( m_State
.m_pCurrentParamList
, m_State
.m_MembersFlags
);
77 m_State
.m_pCurrentParamList
= NULL
;
83 struct action_SetVirtual
85 action_SetVirtual( ASTState
& State_
) :
90 template< typename TokenT
> void operator()( const TokenT
& tok
) const
92 m_State
.m_bVirtualMethod
= true;
93 m_State
.m_pCurrentClass
->setFlag( "Polymorphic", true );