[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua grammar question
- From: Asger Ottar Alstrup <aalstrup@...>
- Date: Sat, 26 Feb 2005 14:01:35 +0100
The Lua grammar contains these three lines to describe the syntax for
function calls:
functioncall = p args | p ':' Name args
p = var | functioncall | '(' exp ')'
var = Name | p '[' exp ']' | p '.' Name
That is left recursive in strange ways, and thus Greek to me. Based on
my understanding of the language, I've tried to rewrite it to something
which is easier to understand for me. Does this match the grammar?
functioncall =
( Name | '(' exp ')' )
( args | '.' Name | ':' Name | '[' exp ']' )*
args
Regards,
Asger Ottar Alstrup