1 #ifndef AWFUL_IDLPARSE_ASTPARAMLIST_H_
2 #define AWFUL_IDLPARSE_ASTPARAMLIST_H_
6 namespace awful
{ namespace idlparser
8 // Grammar action functors used to build param list AST elements.
10 struct action_NewParamList
12 action_NewParamList( ASTState
& State_
) :
17 template< typename TokenT
> void operator()( const TokenT
& tok
) const
19 // The last parsed type at this point is the method return type.
20 m_State
.m_pCurrentParamList
=
21 new idlast::ParamList(
22 m_State
.m_pCurrentType
,
23 tok
.get_position().get_file().c_str(),
24 tok
.get_position().get_line() );
25 m_State
.m_pCurrentType
= NULL
;
31 struct action_AddParam
33 action_AddParam( ASTState
& State_
) :
38 template< typename TokenT
> void operator()( const TokenT
& tok
) const
40 std::string name
= tok
.get_value().c_str();
41 m_State
.m_pCurrentParamList
->push_back( std::make_pair( name
, m_State
.m_pCurrentType
) );
42 m_State
.m_pCurrentType
= NULL
;
48 struct action_SetMethodConst
50 action_SetMethodConst( ASTState
& State_
) :
55 template< typename TokenT
> void operator()( const TokenT
& tok
) const
57 m_State
.m_pCurrentParamList
->setConst();