Class: Lrama::Lexer::Token::InstantiateRule

Inherits:
Lrama::Lexer::Token show all
Defined in:
lib/lrama/lexer/token/instantiate_rule.rb

Instance Attribute Summary collapse

Attributes inherited from Lrama::Lexer::Token

#alias_name, #location, #referred, #s_value

Instance Method Summary collapse

Methods inherited from Lrama::Lexer::Token

#==, #first_column, #first_line, #invalid_ref, #last_column, #last_line, #referred_by?, #to_s

Constructor Details

#initialize(s_value:, alias_name: nil, location: nil, args: [], lhs_tag: nil) ⇒ InstantiateRule

Returns a new instance of InstantiateRule.



12
13
14
15
16
# File 'lib/lrama/lexer/token/instantiate_rule.rb', line 12

def initialize(s_value:, alias_name: nil, location: nil, args: [], lhs_tag: nil)
  super s_value: s_value, alias_name: alias_name, location: location
  @args = args
  @lhs_tag = lhs_tag
end

Instance Attribute Details

#argsObject (readonly)

: Array



8
9
10
# File 'lib/lrama/lexer/token/instantiate_rule.rb', line 8

def args
  @args
end

#lhs_tagObject (readonly)

: Lexer::Token::Tag?



9
10
11
# File 'lib/lrama/lexer/token/instantiate_rule.rb', line 9

def lhs_tag
  @lhs_tag
end

Instance Method Details

#args_countObject



24
25
26
# File 'lib/lrama/lexer/token/instantiate_rule.rb', line 24

def args_count
  args.count
end

#rule_nameObject



19
20
21
# File 'lib/lrama/lexer/token/instantiate_rule.rb', line 19

def rule_name
  s_value
end