Class: MTK::Lang::Parser
- Inherits:
-
Object
- Object
- MTK::Lang::Parser
- Defined in:
- lib/mtk/lang/parser.rb
Overview
Parser for the MTK syntax
Class Method Summary collapse
-
.parse(syntax, grammar_rule = :root, dump = false) ⇒ Sequencers::LegatoSequencer, ...
Parse the given MTK syntax according to the grammar rules.
Class Method Details
.parse(syntax, grammar_rule = :root, dump = false) ⇒ Sequencers::LegatoSequencer, ...
Parse the given MTK syntax according to the grammar rules
23 24 25 26 27 28 29 |
# File 'lib/mtk/lang/parser.rb', line 23 def self.parse(syntax, grammar_rule=:root, dump=false) syntax = syntax.to_s.strip return nil if syntax.empty? match = ::MTK_Grammar.parse(syntax, root: grammar_rule) puts match.dump if dump match.value end |