jrester / EBNF.cr

Work with (E)BNF and bison/YACC Grammar: Parsing, FIRST/FOLLOW set, CNF, Conversions, LR and LL parsing tables
MIT License
26 stars 3 forks source link

Build fails with Crystal 1.7.2 #3

Open binarytemple opened 1 year ago

binarytemple commented 1 year ago
~/repos/bt/EBNF.cr/ asdf which crystal                  /Users/b/.asdf/installs/crystal/1.7.2/bin/crystal
~/repos/bt/EBNF.cr/ asdf which shards 
/Users/b/.asdf/installs/crystal/1.7.2/embedded/bin/shards
~/repos/bt/EBNF.cr/ shards build --release --production
Dependencies are satisfied
Building: ebnf
Error target ebnf failed to compile:
Showing last frame. Use --error-trace for full trace.

In src/ebnf/grammar/rule.cr:89:48

 89 | def initialize(@atoms = Array(Atom).new, @action = nil)
                                               ^
Error: instance variable @action of EBNF::Bison::Rule was inferred to be Nil, but Nil alone provides no information
binarytemple commented 1 year ago

It worked with Crystal 0.33.
I'm trying to get it to parse the Postgres Bison Grammar - https://github.com/postgres/postgres/blob/master/src/backend/parser/gram.y My goal is to automate the conversion of the postgres grammar into a intermediate format from whence I can create an (Erlang) Yecc grammar. Any general advice welcomed as well, maybe I'm taking the wrong approach.