- compile
Program compile(string source, string name)
compile code into chunk usable by vm
- compile
Program compile(StatementNode[] statements)
This is strictly for use by the Parser to evaluate case expressions and such.
- visitArrayIndexNode
Variant visitArrayIndexNode(ArrayIndexNode ainode)
handle [] operator. This method cannot be used in assignment
- visitArrayLiteralNode
Variant visitArrayLiteralNode(ArrayLiteralNode alnode)
- visitBinaryOpNode
Variant visitBinaryOpNode(BinaryOpNode bonode)
handles binary operations
- visitBlockStatementNode
Variant visitBlockStatementNode(BlockStatementNode bsnode)
- visitBreakStatementNode
Variant visitBreakStatementNode(BreakStatementNode bsnode)
- visitClassDeclarationStatementNode
Variant visitClassDeclarationStatementNode(ClassDeclarationStatementNode cdsnode)
Class declarations. Reduce to let leftHand = classExpression
- visitClassLiteralNode
Variant visitClassLiteralNode(ClassLiteralNode clnode)
Class literals. Parser is supposed to make sure string-function pairs match up
- visitContinueStatementNode
Variant visitContinueStatementNode(ContinueStatementNode csnode)
visit continue statements
- visitDeleteStatementNode
Variant visitDeleteStatementNode(DeleteStatementNode dsnode)
delete statement. can be used on ArrayIndexNode or MemberAccessNode
- visitDoWhileStatementNode
Variant visitDoWhileStatementNode(DoWhileStatementNode dwsnode)
- visitExpressionStatementNode
Variant visitExpressionStatementNode(ExpressionStatementNode esnode)
handle expression statements
- visitForOfStatementNode
Variant visitForOfStatementNode(ForOfStatementNode fosnode)
- visitForStatementNode
Variant visitForStatementNode(ForStatementNode fsnode)
- visitFunctionCallNode
Variant visitFunctionCallNode(FunctionCallNode fcnode)
- visitFunctionDeclarationStatementNode
Variant visitFunctionDeclarationStatementNode(FunctionDeclarationStatementNode fdsnode)
- visitFunctionLiteralNode
Variant visitFunctionLiteralNode(FunctionLiteralNode flnode)
handle function literals. The VM should create new functions with the appropriate context when a function is loaded from the const table
- visitIfStatementNode
Variant visitIfStatementNode(IfStatementNode isnode)
- visitLambdaNode
Variant visitLambdaNode(LambdaNode lnode)
- visitLiteralNode
Variant visitLiteralNode(LiteralNode lnode)
handle literal value node (easiest)
- visitMemberAccessNode
Variant visitMemberAccessNode(MemberAccessNode manode)
handle . operator. This method cannot be used in assignment
- visitNewExpressionNode
Variant visitNewExpressionNode(NewExpressionNode nenode)
handle new operator. visitFunctionCallExpression will handle returnThis field
- visitObjectLiteralNode
Variant visitObjectLiteralNode(ObjectLiteralNode olnode)
handle object literal nodes
- visitPostfixOpNode
Variant visitPostfixOpNode(PostfixOpNode ponode)
- visitReturnStatementNode
Variant visitReturnStatementNode(ReturnStatementNode rsnode)
- visitSuperNode
Variant visitSuperNode(SuperNode snode)
this should only be directly visited when used by itself
- visitSwitchStatementNode
Variant visitSwitchStatementNode(SwitchStatementNode ssnode)
- visitTemplateStringNode
Variant visitTemplateStringNode(TemplateStringNode tsnode)
- visitTerniaryOpNode
Variant visitTerniaryOpNode(TerniaryOpNode tonode)
- visitThrowStatementNode
Variant visitThrowStatementNode(ThrowStatementNode tsnode)
- visitTryCatchBlockStatementNode
Variant visitTryCatchBlockStatementNode(TryCatchBlockStatementNode tcbsnode)
- visitUnaryOpNode
Variant visitUnaryOpNode(UnaryOpNode uonode)
- visitVarAccessNode
Variant visitVarAccessNode(VarAccessNode vanode)
These should not be directly visited for assignment
- visitVarDeclarationStatementNode
Variant visitVarDeclarationStatementNode(VarDeclarationStatementNode vdsnode)
- visitWhileStatementNode
Variant visitWhileStatementNode(WhileStatementNode wsnode)
- visitYieldNode
Variant visitYieldNode(YieldNode ynode)
Implements a bytecode compiler that can be used by mildew.vm.virtualmachine. This class is not thread safe and each thread must use its own Compiler instance. Only one program can be compiled at a time.