summaryrefslogtreecommitdiff
path: root/tool/lrama/lib/lrama/lexer/token/instantiate_rule.rb
blob: 1c4d1095c8f22b30a8b249338fdc44814d7bad90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Lrama
  class Lexer
    class Token
      class InstantiateRule < Token
        attr_reader :args, :lhs_tag

        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

        def rule_name
          s_value
        end

        def args_count
          args.count
        end
      end
    end
  end
end