# Autogenerated from a Treetop grammar. Edits may be lost. module Music module Transcription module Parsing module Meter include Treetop::Runtime def root @root ||= :meter end include PositiveInteger module Meter0 def bpm elements[0] end def bd elements[2] end end module Meter1 def to_meter Music::Transcription::Meter.new(bpm.to_i, Rational(1,bd.to_i)) end end def _nt_meter start_index = index if node_cache[:meter].has_key?(index) cached = node_cache[:meter][index] if cached node_cache[:meter][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_positive_integer s0 << r1 if r1 if (match_len = has_terminal?("/", false, index)) r2 = true @index += match_len else terminal_parse_failure("/") r2 = nil end s0 << r2 if r2 r3 = _nt_positive_integer s0 << r3 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Meter0) r0.extend(Meter1) else @index = i0 r0 = nil end node_cache[:meter][start_index] = r0 r0 end end class MeterParser < Treetop::Runtime::CompiledParser include Meter end end end end