-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
Description
I'm trying to parse the BNF/EBNF found here:
It appears to parse fine with a BNF Playground website I found but I get the following error when I use the ebnf
gem:
require 'ebnf'
grammar = EBNF.parse(File.open("./json.ebnf"))
puts grammar.to_s
/Users/mperham/.gem/ruby/3.3.5/gems/ebnf-2.5.0/lib/ebnf/parser.rb:304:in `rescue in initialize': ERROR [line: 1] syntax error, expecting "@terminals", "@pass", :LHS (found "<quoted_string> ::= ") (SyntaxError)
from /Users/mperham/.gem/ruby/3.3.5/gems/ebnf-2.5.0/lib/ebnf/parser.rb:267:in `initialize'
from /Users/mperham/.gem/ruby/3.3.5/gems/ebnf-2.5.0/lib/ebnf/base.rb:125:in `new'
from /Users/mperham/.gem/ruby/3.3.5/gems/ebnf-2.5.0/lib/ebnf/base.rb:125:in `initialize'
from /Users/mperham/.gem/ruby/3.3.5/gems/ebnf-2.5.0/lib/ebnf.rb:29:in `new'
from /Users/mperham/.gem/ruby/3.3.5/gems/ebnf-2.5.0/lib/ebnf.rb:29:in `parse'
from lib/jsonebnf.rb:3:in `<main>'
Any tips?