lexer.dat and parser.dat

24 views
Skip to first unread message

fidel....@gmail.com

unread,
May 12, 2022, 1:36:47 PM5/12/22
to SableCC
Hi, Ettienne!

I have always wondered why the lexer and parser tables have been moved to lexer.dat and parser.dat respectively. We can see the tables in the code commented out. But, was there a specific reason for moving them to these two external files? Was it for efficiency reasons?

Thanks in advance!

Fidel H Viegas


Etienne Gagnon

unread,
May 12, 2022, 2:05:28 PM5/12/22
to sab...@googlegroups.com
Hi Fidel,

It's to circumvent a limitation of class files. When lexer and parser tables get big, the static class initializer (which prefills tables with data) can't fit within the 64k method size limit of the class file format.

Have fun,

Etienne

Etienne Gagnon, Ph.D.
http://sablecc.org


--
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sablecc/684d3a6b-08dc-4018-b866-837e15a769e4n%40googlegroups.com.

fidel....@gmail.com

unread,
May 12, 2022, 7:58:54 PM5/12/22
to SableCC
Hi, Ettienne!

Thanks for your answer! I wasn't ware of that.

Best Regards,

Fidel H Viegas

Reply all
Reply to author
Forward
0 new messages