Reshuffling directories to separate include and sources, part one.
[fail.git] / include / core / idlparser / astflags.h
blob71d402c0c9703d28a965d575db1c4fd514d8e567
1 #ifndef AWFUL_IDLPARSE_ASTFLAGS_H_
2 #define AWFUL_IDLPARSE_ASTFLAGS_H_
4 #include "aststate.h"
6 namespace awful { namespace idlparser
8 // Grammar action functors used to setup flags.
10 struct action_ResetAllFlags
12 action_ResetAllFlags( ASTState& State_ ) :
13 m_State( State_ )
17 template< typename IterT > void operator()( const IterT& first, const IterT& last ) const
19 m_State.m_pCurrentFlags->clear();
22 ASTState& m_State;
25 struct action_SetFlagTrue
27 action_SetFlagTrue( ASTState& State_ ) :
28 m_State( State_ )
32 template< typename TokenT > void operator()( const TokenT& tok ) const
34 ( *m_State.m_pCurrentFlags )[ m_State.m_CurrentIdentifier ] = true;
37 ASTState& m_State;
40 struct action_SetFlagFalse
42 action_SetFlagFalse( ASTState& State_ ) :
43 m_State( State_ )
47 template< typename TokenT > void operator()( const TokenT& tok ) const
49 ( *m_State.m_pCurrentFlags )[ m_State.m_CurrentIdentifier ] = false;
52 ASTState& m_State;
55 struct action_ResetFlag
57 action_ResetFlag( ASTState& State_ ) :
58 m_State( State_ )
62 template< typename TokenT > void operator()( const TokenT& tok ) const
64 ( *m_State.m_pCurrentFlags ).erase( m_State.m_CurrentIdentifier );
67 ASTState& m_State;
71 #endif