Class: Packrat::Grammar
Instance Attribute Summary
Attributes included from GrammarBuild
#start
Class Method Summary
collapse
[], any, ast, ast_class, ast_class_name, each_prod, each_rule, eos, finalize!, hidden, internal_rule_name, lift, make_ast_class, maybe, mult, next_internal_rule_num, plus, postprocess_set_grammar_on_rules, prod, rep, rule, rules, sexpr, start_rule, start_symbol
Class Method Details
.interpreting_parser(klass = Packrat::InterpretingParser) ⇒ Object
197
198
199
200
|
# File 'lib/packrat/grammar.rb', line 197
def interpreting_parser(klass = Packrat::InterpretingParser)
self.finalize!
klass.new_subclass(self)
end
|
.new(&grammarBuilder) ⇒ Object
185
186
187
188
189
190
191
192
193
194
195
|
# File 'lib/packrat/grammar.rb', line 185
def new(&grammarBuilder)
@num_grammars ||= 0
const_set("Grammar" + (@num_grammars += 1).to_s,
klass = Class.new(self))
klass.const_set("ASTs", Module.new)
klass.module_eval(&grammarBuilder)
klass
end
|