Class: Lrama::Grammar::Destructor
- Inherits:
-
Object
- Object
- Lrama::Grammar::Destructor
- Defined in:
- lib/lrama/grammar/destructor.rb
Instance Attribute Summary collapse
-
#ident_or_tags ⇒ Object
readonly
: Array.
-
#lineno ⇒ Object
readonly
: Integer.
-
#token_code ⇒ Object
readonly
: Lexer::Token::UserCode.
Instance Method Summary collapse
-
#initialize(ident_or_tags:, token_code:, lineno:) ⇒ Destructor
constructor
A new instance of Destructor.
- #translated_code(tag) ⇒ Object
Constructor Details
#initialize(ident_or_tags:, token_code:, lineno:) ⇒ Destructor
Returns a new instance of Destructor.
12 13 14 15 16 |
# File 'lib/lrama/grammar/destructor.rb', line 12 def initialize(ident_or_tags:, token_code:, lineno:) @ident_or_tags = @token_code = token_code @lineno = lineno end |
Instance Attribute Details
#ident_or_tags ⇒ Object (readonly)
: Array
7 8 9 |
# File 'lib/lrama/grammar/destructor.rb', line 7 def @ident_or_tags end |
#lineno ⇒ Object (readonly)
: Integer
9 10 11 |
# File 'lib/lrama/grammar/destructor.rb', line 9 def lineno @lineno end |
#token_code ⇒ Object (readonly)
: Lexer::Token::UserCode
8 9 10 |
# File 'lib/lrama/grammar/destructor.rb', line 8 def token_code @token_code end |
Instance Method Details
#translated_code(tag) ⇒ Object
19 20 21 |
# File 'lib/lrama/grammar/destructor.rb', line 19 def translated_code(tag) Code::DestructorCode.new(type: :destructor, token_code: token_code, tag: tag).translated_code end |