Feature Request: better error messages when .gzl grammar file doesn't compile

4 views
Skip to first unread message

Catherine Rodgers

unread,
Jul 9, 2008, 3:23:44 PM7/9/08
to gazelle-users
I had a very small test grammar working, so I tried creating the more
complex grammar that I actually cared about. I'm assuming that I typed
in the grammar incorrectly somewhere, but the error messages that gzlc
spits out don't tell me where to start looking in the test.gzl file:

> ../compiler/gzlc --verbose test.gzl
Gazelle v0.2
Opening input file 'test.gzl'...
Parsing grammar...
Convering RTN NFAs to DFAs...
Minimizing RTN DFAs...
Doing LL(k) lookahead calculations...
lua: /home/cmrodgers/local/src/gazelle-0.2/compiler/ll.lua:69: attempt
to index field '?' (a nil value)
stack traceback:
/home/cmrodgers/local/src/gazelle-0.2/compiler/ll.lua:69: in
function 'get_follow_states'
/home/cmrodgers/local/src/gazelle-0.2/compiler/ll.lua:38: in
function 'compute_lookahead'
../compiler/gzlc:130: in main chunk
[C]: ?

Joshua Haberman

unread,
Jul 10, 2008, 12:02:42 AM7/10/08
to gazell...@googlegroups.com
Hi Catherine, thanks for the report!  Could you possibly post (or send me privately) the grammar that triggers that bad message?  What you're seeing actually isn't a syntax error, it's an error in the analysis stage.

Thanks,
Josh
Reply all
Reply to author
Forward
0 new messages