Allow defining multiple parser types and assigning parser types to tokens and rules

This commit is contained in:
josh committed 2022-11-13 13:35:19 -05:00
1 parent 8dc27686aa
commit e4a160f918
5 files changed
+91 -28

No files matched your search

+8 -1
View File
@@ -14,6 +14,10 @@ class Propane
# Rule ID.
attr_accessor :id
# @return [String, nil]
# Parser type name.
attr_reader :ptypename
# @return [Integer]
# Line number where the rule was defined in the input grammar.
attr_reader :line_number
@@ -34,12 +38,15 @@ class Propane
# Rule components.
# @param code [String]
# User code associated with the rule.
# @param ptypename [String, nil]
# Parser type name.
# @param line_number [Integer]
# Line number where the rule was defined in the input grammar.
def initialize(name, components, code, line_number)
def initialize(name, components, code, ptypename, line_number)
@name = name
@components = components
@code = code
@ptypename = ptypename
@line_number = line_number
end