Class: Lrama::Grammar::Printer

Inherits:
Struct
  • Object
show all
Defined in:
lib/lrama/grammar/printer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ident_or_tagsObject

Returns the value of attribute ident_or_tags

Returns:

  • (Object)

    the current value of ident_or_tags



5
6
7
# File 'lib/lrama/grammar/printer.rb', line 5

def ident_or_tags
  @ident_or_tags
end

#linenoObject

Returns the value of attribute lineno

Returns:

  • (Object)

    the current value of lineno



5
6
7
# File 'lib/lrama/grammar/printer.rb', line 5

def lineno
  @lineno
end

#token_codeObject

Returns the value of attribute token_code

Returns:

  • (Object)

    the current value of token_code



5
6
7
# File 'lib/lrama/grammar/printer.rb', line 5

def token_code
  @token_code
end

Instance Method Details

#translated_code(tag) ⇒ Object



6
7
8
# File 'lib/lrama/grammar/printer.rb', line 6

def translated_code(tag)
  Code::PrinterCode.new(type: :printer, token_code: token_code, tag: tag).translated_code
end