lua-users home
lua-l archive

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


I'm writing a parser for lua and found some strange rules in the EBNF Syntax available at

exp ::=  nil | false | true | Number | String | `...´ | function |
		 prefixexp | tableconstructor | exp binop exp | unop exp

prefixexp ::= var | functioncall | `(´ exp `)´

functioncall ::=  prefixexp args | prefixexp `:´ Name args

args ::=  `(´ [explist] `)´ | tableconstructor | String

Looking at these four rules above the Language allowes functioncalls like:




Which are obviously senseless and when I try to execute them the interpreter gives me the following error message:

ambiguous syntax (function call x new statement) near '('

Is this intenden behaviour or is this an error and somebody can provie me a updated EBNF syntax.

Best regards,

Nicolai Mainiero