parrotcode: a Lua 5.1 grammar in PGE | |
Contents | Language Implementations | Lua |
lua.pg - a Lua 5.1 grammar in PGE
The grammar rules are according to the original Lua parser as defined lparser.c in the lua distribution.
Helper rules will match a specific token, otherwise a syntax error is generated. These rules make the grammar more readable, so the calls to syntaxerror() are not all over the grammar, but only in these rules.
Tokens not defined here (in PGE) are written in PIR in languages/lua/src/lua51.pir.
Operator precedence is implemented using an optable.
Klaas-Jan Stol <parrotcode@gmail.com>
Francois Perrad
|