lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Asger Alstrup wrote:

Klaas-Jan Stol wrote:

I'm looking for a LALR, Lua 5 grammar. In other words, I'd like the grammar for input for bison/yacc. I searched for it, but it doesn't seem to exist. Does anybody have a Lua 5 grammar, eatable by bison?


See

http://lua-users.org/wiki/LuaGrammar

Regards,
Asger Ottar Alstrup


hi,

thanks for your link. I saw this grammar, but
(1) I'm not sure if it's a Lua 5 grammar,
(2) it's wrong I think:

look at

primary --> NIL | number | literal | '%' name | table_cons
| FUNCTION '(' [ params ] ')' block END | ( expr )
var     --> name
        |  primary index
        |  var index
        |  call index

according to this, it should be possible to write:

"some literal".some_key = 1

which is rejected by Lua on my system (which is Lua 5). So something isn't right here.

Thanks anyway,
klaas-jan