File: parser_extras.rb

package info (click to toggle)
ruby-journey 1.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 292 kB
  • sloc: ruby: 2,830; javascript: 113; yacc: 42; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 327 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'journey/scanner'
require 'journey/nodes/node'

module Journey
  class Parser < Racc::Parser
    include Journey::Nodes

    def initialize
      @scanner = Scanner.new
    end

    def parse string
      @scanner.scan_setup string
      do_parse
    end

    def next_token
      @scanner.next_token
    end
  end
end