1. chunk ::= {stat [`;´]} [laststat [`;´]]
    2. block ::= chunk
    3. stat ::= varlist `=´ explist |
    4. functioncall |
    5. do block end |
    6. while exp do block end |
    7. repeat block until exp |
    8. if exp then block {elseif exp then block} [else block] end |
    9. for Name ` exp `,´ exp [` exp] do block end |
    10. for namelist in explist do block end |
    11. function funcname funcbody |
    12. local function Name funcbody |
    13. local namelist [`=´ explist]
    14. laststat ::= return [explist] | break
    15. funcname ::= Name {` Name} [`:´ Name]
    16. varlist ::= var {` var}
    17. var ::= Name | prefixexp `[´ exp ` | prefixexp `.´ Name
    18. namelist ::= Name {` Name}
    19. explist ::= {exp `,´} exp
    20. exp ::= nil | false | true | Number | String | `...´ | function |
    21. prefixexp | tableconstructor | exp binop exp | unop exp
    22. prefixexp ::= var | functioncall | `(´ exp `
    23. functioncall ::= prefixexp args | prefixexp `:´ Name args
    24. args ::= ` [explist] `)´ | tableconstructor | String
    25. function ::= function funcbody
    26. funcbody ::= ` [parlist] `)´ block end
    27. parlist ::= namelist [` `...´] | `...´
    28. tableconstructor ::= `{´ [fieldlist] `
    29. fieldlist ::= field {fieldsep field} [fieldsep]
    30. field ::= `[´ exp ` `=´ exp | Name ` exp | exp
    31. fieldsep ::= `,´ | `
    32. binop ::= `+´ | ` | `*´ | ` | `^´ | ` | `..´ |
    33. ` | `<=´ | ` | `>=´ | `==´ | `~=´ |
    34. and | or
    35. unop ::= ` | not | `#´