Reshuffling directories to separate include and sources, part one.
[fail.git] / include / core / idlparser / astparamlist.h
blob0f7c2a54117de3affb60b54f67e903e7dc2373c5
1 #ifndef AWFUL_IDLPARSE_ASTPARAMLIST_H_
2 #define AWFUL_IDLPARSE_ASTPARAMLIST_H_
4 #include "aststate.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_ ) :
13 m_State( 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;
28 ASTState& m_State;
31 struct action_AddParam
33 action_AddParam( ASTState& State_ ) :
34 m_State( 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;
45 ASTState& m_State;
48 struct action_SetMethodConst
50 action_SetMethodConst( ASTState& State_ ) :
51 m_State( State_ )
55 template< typename TokenT > void operator()( const TokenT& tok ) const
57 m_State.m_pCurrentParamList->setConst();
60 ASTState& m_State;
64 #endif