1 #ifndef AWFUL_IDLPARSE_ASTENUM_H_
2 #define AWFUL_IDLPARSE_ASTENUM_H_
6 namespace awful
{ namespace idlparser
8 // Grammar action functors used to build enum AST elements.
12 action_NewEnum( ASTState
& State_
) :
17 template< typename TokenT
> void operator()( const TokenT
& tok
) const
19 m_State
.m_pCurrentEnum
= new idlast::Enum(
20 tok
.get_value().c_str(),
21 tok
.get_position().get_file().c_str(),
22 tok
.get_position().get_line() );
24 m_State
.m_pCurrentEnum
->setFlags( m_State
.m_MembersFlags
);
30 struct action_AddEnumValue
32 action_AddEnumValue( ASTState
& State_
) :
37 template< typename TokenT
> void operator()( const TokenT
& tok
) const
39 m_State
.m_pCurrentEnum
->addValue( tok
.get_value().c_str() );
47 action_AddEnum( ASTState
& State_
) :
52 template< typename TokenT
> void operator()( const TokenT
& tok
) const
54 m_State
.m_pCurrentClass
->addEnum( m_State
.m_pCurrentEnum
);
55 m_State
.m_pCurrentEnum
= NULL
;