Module: Rucc::Lexer::Preprocessor::Constructor
- Included in:
- Rucc::Lexer::Preprocessor
- Defined in:
- lib/rucc/lexer/preprocessor/constructor.rb
Instance Method Summary collapse
- #copy_token(tok) ⇒ Token
- #define_obj_macro(name, value) ⇒ Object
- #make_cond_incl(wastrue) ⇒ Object
- #make_func_macro(body, nargs, is_varg) ⇒ Object
- #make_macro_token(position, is_vararg) ⇒ Object
- #make_obj_macro(body) ⇒ Macro
- #make_special_macro(fn) ⇒ Object
Instance Method Details
#copy_token(tok) ⇒ Token
48 49 50 |
# File 'lib/rucc/lexer/preprocessor/constructor.rb', line 48 def copy_token(tok) tok.dup end |
#define_obj_macro(name, value) ⇒ Object
7 8 9 |
# File 'lib/rucc/lexer/preprocessor/constructor.rb', line 7 def define_obj_macro(name, value) @macros[name] = make_obj_macro([value]) end |
#make_cond_incl(wastrue) ⇒ Object
30 31 32 |
# File 'lib/rucc/lexer/preprocessor/constructor.rb', line 30 def make_cond_incl(wastrue) CondIncl.new(CondInclCtx::THEN, wastrue: wastrue) end |
#make_func_macro(body, nargs, is_varg) ⇒ Object
20 21 22 |
# File 'lib/rucc/lexer/preprocessor/constructor.rb', line 20 def make_func_macro(body, nargs, is_varg) Macro.new(M::FUNC, body: body, nargs: nargs, is_varg: is_varg) end |
#make_macro_token(position, is_vararg) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/rucc/lexer/preprocessor/constructor.rb', line 36 def make_macro_token(position, is_vararg) Token.new(T::MACRO_PARAM, is_vararg: is_vararg, hideset: nil, position: position, space: false, bol: false, ) end |