Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
racc / sample / yyerr.y
Size: Mime:
# $Id$
#
# Test grammer file for error handling.

class A
rule

target: a b c

a :
      {
        yyerror
        raise ArgumentError, "yyerror failed"
      }
  | error

b :
      {
        yyerrok
      }

c :
      {
        yyaccept
        raise "yyaccept failed"
      }

end

---- inner

  def parse
    do_parse
  end

  def next_token
    [false, '$end']
  end

  def on_error(*args)
    $stderr.puts "on_error called: args=#{args.inspect}"
  end

---- footer

A.new.parse