import { Token, Visitor } from './mod'; declare enum NodeType { Literal = "Literal", NilLiteral = "NilLiteral", VarargLiteral = "VarargLiteral", StringLiteral = "StringLiteral", NumericLiteral = "NumericLiteral", BooleanLiteral = "BooleanLiteral", CommentLiteral = "CommentLiteral", Identifier = "Identifier", FunctionExpression = "FunctionExpression", GroupingExpression = "GroupingExpression", MemberExpression = "MemberExpression", IndexExpression = "IndexExpression", UnaryExpression = "UnaryExpression", BinaryExpression = "BinaryExpression", FunctionCallExpression = "FunctionCallExpression", TableFunctionCallExpression = "TableFunctionCallExpression", LocalStatement = "LocalStatement", ForNumericStatement = "ForNumericStatement", ForGenericStatement = "ForGenericStatement", ReturnStatement = "ReturnStatement", LabelStatement = "LabelStatement", GotoStatement = "GotoStatement", BreakStatement = "BreakStatement", DoStatement = "DoStatement", RepeatStatement = "RepeatStatement", WhileStatement = "WhileStatement", IfStatement = "IfStatement", FunctionLocalStatement = "FunctionLocalStatement", FunctionDeclarationStatement = "FunctionDeclarationStatement", AssignmentStatement = "AssignmentStatement", FunctionCallStatement = "FunctionCallStatement", TableKey = "TableKey", TableKeyString = "TableKeyString", TableValue = "TableValue", TableConstructor = "TableConstructor", Block = "Block", Chunk = "Chunk" } interface Node { type: NodeType; accept(visitor: Visitor): unknown; } type Expression = Node; type Statement = Node; declare class Literal implements Expression { readonly type: NodeType; token: Token; constructor(token: Token); accept(visitor: Visitor): unknown; } declare class Identifier implements Expression { readonly type = NodeType.Identifier; attrib: string; token: Token; constructor(token: Token); accept(visitor: Visitor): unknown; } declare class NilLiteral extends Literal { readonly type = NodeType.NilLiteral; accept(visitor: Visitor): unknown; } declare class VarargLiteral extends Literal { readonly type = NodeType.VarargLiteral; accept(visitor: Visitor): unknown; } declare class StringLiteral extends Literal { readonly type = NodeType.StringLiteral; accept(visitor: Visitor): unknown; } declare class NumericLiteral extends Literal { readonly type = NodeType.NumericLiteral; accept(visitor: Visitor): unknown; } declare class BooleanLiteral extends Literal { readonly type = NodeType.BooleanLiteral; accept(visitor: Visitor): unknown; } declare class CommentLiteral extends Literal { readonly type = NodeType.CommentLiteral; accept(visitor: Visitor): unknown; } declare class FunctionExpression implements Expression { readonly type = NodeType.FunctionExpression; parlist: Expression[]; block: Block; constructor(parlist: Expression[], block: Block); accept(visitor: Visitor): unknown; } declare class FunctionLocalStatement implements Statement { readonly type = NodeType.FunctionLocalStatement; funcname: Identifier; parlist: Expression[]; block: Block; constructor(funcname: Identifier, parlist: Expression[], block: Block); accept(visitor: Visitor): unknown; } declare class FunctionDeclarationStatement implements Statement { readonly type = NodeType.FunctionDeclarationStatement; funcname: Identifier | MemberExpression; parlist: Expression[]; block: Block; constructor(funcname: Identifier | MemberExpression, parlist: Expression[], block: Block); accept(visitor: Visitor): unknown; } declare class GroupingExpression implements Expression { readonly type = NodeType.GroupingExpression; expression: Expression; constructor(expression: Expression); accept(visitor: Visitor): unknown; } declare class MemberExpression implements Expression { readonly type = NodeType.MemberExpression; base: Expression; identifier: Identifier; indexer: string; constructor(base: Expression, indexer: string, identifier: Identifier); accept(visitor: Visitor): unknown; } declare class IndexExpression implements Expression { readonly type = NodeType.IndexExpression; base: Expression; index: Expression; constructor(base: Expression, expression: Expression); accept(visitor: Visitor): unknown; } declare class TableKey implements Expression { readonly type = NodeType.TableKey; key: Expression; value: Expression; constructor(key: Expression, value: Expression); accept(visitor: Visitor): unknown; } declare class TableKeyString implements Expression { readonly type = NodeType.TableKeyString; key: Identifier; value: Expression; constructor(key: Identifier, value: Expression); accept(visitor: Visitor): unknown; } declare class TableValue implements Expression { readonly type = NodeType.TableValue; value: Expression; constructor(value: Expression); accept(visitor: Visitor): unknown; } declare class TableConstructor implements Expression { readonly type = NodeType.TableConstructor; fieldlist: Expression[]; constructor(fieldlist: Expression[]); accept(visitor: Visitor): unknown; } declare class FunctionCallExpression implements Expression { readonly type = NodeType.FunctionCallExpression; base: Expression; args: Expression[]; constructor(base: Expression, args: Expression[]); accept(visitor: Visitor): unknown; } declare class UnaryExpression implements Expression { readonly type = NodeType.UnaryExpression; operator: Token; argument: Expression; constructor(operator: Token, argument: Expression); accept(visitor: Visitor): unknown; } declare class BinaryExpression implements Expression { readonly type = NodeType.BinaryExpression; left: Expression; operator: Token; right: Expression; constructor(left: Expression, operator: Token, right: Expression); accept(visitor: Visitor): unknown; } declare class LocalStatement implements Statement { readonly type = NodeType.LocalStatement; variables: Identifier[]; init: Expression[]; constructor(variables: Identifier[], init: Expression[]); accept(visitor: Visitor): unknown; } declare class ReturnStatement implements Statement { readonly type = NodeType.ReturnStatement; arguments: Expression[]; constructor(expressions: Expression[]); accept(visitor: Visitor): unknown; } declare class FunctionCallStatement implements Expression { readonly type = NodeType.FunctionCallStatement; expression: Expression; constructor(expression: Expression); accept(visitor: Visitor): unknown; } declare class LabelStatement implements Statement { readonly type = NodeType.LabelStatement; name: Identifier; constructor(name: Identifier); accept(visitor: Visitor): unknown; } declare class GotoStatement implements Statement { readonly type = NodeType.GotoStatement; label: Identifier; constructor(label: Identifier); accept(visitor: Visitor): unknown; } declare class BreakStatement implements Statement { readonly type = NodeType.BreakStatement; accept(visitor: Visitor): unknown; } declare class DoStatement implements Statement { readonly type = NodeType.DoStatement; block: Block; constructor(block: Block); accept(visitor: Visitor): unknown; } declare class RepeatStatement implements Statement { readonly type = NodeType.RepeatStatement; block: Block; condition: Expression; constructor(block: Block, condition: Expression); accept(visitor: Visitor): unknown; } declare class WhileStatement implements Statement { readonly type = NodeType.WhileStatement; block: Block; condition: Expression; constructor(block: Block, condition: Expression); accept(visitor: Visitor): unknown; } declare class AssignmentStatement implements Statement { readonly type = NodeType.AssignmentStatement; variables: Expression[]; init: Expression[]; constructor(variables: Expression[], init: Expression[]); accept(visitor: Visitor): unknown; } declare class IfStatement implements Statement { readonly type = NodeType.IfStatement; ifCondition: Expression; ifBlock: Block; elseifConditions: Expression[]; elseifBlocks: Block[]; elseBlock: Block | null; constructor(ifCondition: Expression, ifBlock: Block, elseifConditions: Expression[], elseifBlocks: Block[], elseBlock: Block | null); accept(visitor: Visitor): unknown; } declare class ForNumericStatement implements Statement { readonly type = NodeType.ForNumericStatement; variable: Identifier; start: Expression; end: Expression; step: Expression | void; block: Block; constructor(variable: Identifier, start: Expression, end: Expression, step: Expression | void, block: Block); accept(visitor: Visitor): unknown; } declare class ForGenericStatement implements Statement { readonly type = NodeType.ForGenericStatement; variables: Identifier[]; iterators: Expression[]; block: Block; constructor(variables: Identifier[], iterators: Expression[], block: Block); accept(visitor: Visitor): unknown; } declare class Block implements Node { readonly type = NodeType.Block; statements: Statement[]; constructor(statements: Statement[]); accept(visitor: Visitor): unknown; } declare class Chunk implements Node { readonly type = NodeType.Chunk; block: Block; constructor(block: Block); accept(visitor: Visitor): unknown; } export { AssignmentStatement, BinaryExpression, Block, BooleanLiteral, BreakStatement, Chunk, CommentLiteral, DoStatement, ForGenericStatement, ForNumericStatement, FunctionCallExpression, FunctionCallStatement, FunctionDeclarationStatement, FunctionExpression, FunctionLocalStatement, GotoStatement, GroupingExpression, Identifier, IfStatement, IndexExpression, LabelStatement, Literal, LocalStatement, MemberExpression, NilLiteral, NodeType, NumericLiteral, RepeatStatement, ReturnStatement, StringLiteral, TableConstructor, TableKey, TableKeyString, TableValue, UnaryExpression, VarargLiteral, WhileStatement, }; export type { Expression, Node, Statement, Visitor };