Page 1 of 1

nml parser grammar is in some dark corner somewhere?

Posted: 27 May 2021 17:33
by speeder
NML official parser use Python's ply, that is short for Python Lex Yacc

Theoretically the way you create such parser, is by running a .l and a .y file through ply, and getting a .py parser out of it.

The .py parser exists... and it would really help a proejct of mine if I could get the .l and .y files instead. Are they... somewhere?

Re: nml parser grammar is in some dark corner somewhere?

Posted: 27 May 2021 20:19
by Eddi
the syntax is all embedded in https://github.com/OpenTTD/nml/blob/mas ... /parser.py

you would have to dig through the ply documentation, maybe there's a way to extrude .l and .y files