awic compiles again.
[fail.git] / src / core / idlparser / astmethod.h
blob8d76bda7c91c600d9b5eb580656feb9410ff1c3a
1 #ifndef AWFUL_IDLPARSE_ASTMETHOD_H_
2 #define AWFUL_IDLPARSE_ASTMETHOD_H_
4 #include "aststate.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_ ) :
13 m_State( 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;
31 ASTState& m_State;
34 struct action_NewStaticMethod
36 action_NewStaticMethod( ASTState& State_ ) :
37 m_State( 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;
49 ASTState& m_State;
52 struct action_CtorNameCheck
54 action_CtorNameCheck( ASTState& State_ ) :
55 m_State( State_ )
59 bool operator()() const
61 return m_State.m_CurrentIdentifier == m_State.m_pCurrentClass->getName();
64 ASTState& m_State;
67 struct action_NewConstructor
69 action_NewConstructor( ASTState& State_ ) :
70 m_State( 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;
80 ASTState& m_State;
83 struct action_SetVirtual
85 action_SetVirtual( ASTState& State_ ) :
86 m_State( 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 );
96 ASTState& m_State;
100 #endif