Add a rule to the grammar. Will raise a typescript error if the rule already exists in the grammar.
Add a rule to the grammar. If the rule already exists, but the implementation differs, an error will be thrown.
Delete a grammar rule by its name.
Merge this grammar builder with another. It is best to merge the bigger grammar with the smaller one. If the two builders both have a grammar rule with the same name, no error will be thrown case they map to the same ruledef object. If they map to a different object, an error will be thrown. To fix this problem, the overridingRules array should contain a rule with the same conflicting name, this rule implementation will be used.
Change the implementation of an existing grammar rule.
Static
createCreate a builder from some initial grammar rules or an existing builder. If a builder is provided, a new copy will be created.
The grammar builder. This is the core of traqula (besides using the amazing chevrotain framework). Using the builder you can create a grammar + AST creator. At any point in time, a parser can be constructed from the added rules. Constructing a parser will cause a validation which will validate the correctness of the grammar.