import { ast } from './mod'; declare class Parser { #private; constructor(source: string); /** * exp ::= (unop exp | primary | prefixexp ) { binop exp } * primary ::= nil | false | true | Number | String | '...' | * functiondef | tableconstructor */ parseExpression(precedence?: number): ast.Expression; /** * local ::= 'local' 'function' Name funcdecl | * 'local' Name {',' Name} ['=' exp {',' exp}] */ parseLocalStatement(): ast.Statement; /** * label ::= '::' Name '::' */ parseLabelStatement(): ast.Statement; /** * if ::= 'if' exp 'then' block {elseif} ['else' block] 'end' * elseif ::= 'elseif' exp 'then' block */ parseIfStatement(): ast.Statement; /** * retstat ::= 'return' [exp {',' exp}] [';'] */ parseReturnStatement(): ast.Statement; /** * local function Name funcbody */ parseLocalFunctionStatement(): ast.Statement; /** * function funcname funcbody */ parseFunctionDeclarationStatement(): ast.Statement; /** * while ::= 'while' exp 'do' block 'end' */ parseWhileStatement(): ast.Statement; /** * for ::= Name '=' exp ',' exp [',' exp] 'do' block 'end' * for ::= namelist 'in' explist 'do' block 'end' * namelist ::= Name {',' Name} * explist ::= exp {',' exp} */ parseForStatement(): ast.Statement; /** * repeat ::= 'repeat' block 'until' exp */ parseRepeatStatement(): ast.Statement; /** * break ::= 'break' */ parseBreakStatement(): ast.Statement; /** * do ::= 'do' block 'end' */ parseDoStatement(): ast.Statement; /** * goto ::= 'goto' Name */ parseGotoStatement(): ast.Statement; /** * assignment ::= varlist '=' explist * var ::= Name | prefixexp '[' exp ']' | prefixexp '.' Name * varlist ::= var {',' var} * explist ::= exp {',' exp} * call ::= callexp * callexp ::= prefixexp args | prefixexp ':' Name args */ parseAssignmentOrFunctionCallStatement(): ast.Statement; /** * stat ::= ‘;’ | * varlist ‘=’ explist | * local function Name funcbody | * local namelist [‘=’ explist] * function funcname funcbody | * label | * break | * goto Name | * do block end | * while exp do block end | * repeat block until exp | * if exp then block {elseif exp then block} [else block] end | * for Name ‘=’ exp ‘,’ exp [‘,’ exp] do block end | * for namelist in explist do block end | * functioncall | */ parseStatement(): ast.Statement | null; /** * block ::= {stat} [retstat] */ parseBlock(): ast.Block; /** * chunk ::= block */ parseChunk(): ast.Chunk; parse(): ast.Chunk; } export { Parser };