public VirtualMachine.Closure CompileString(String source) { Lexer lexer = new Lexer(); List<Lexer.Lexeme> output = lexer.lex(source); Parser parser = new Parser(output); AST outpu2 = parser.Parse(); Compiler.Compiler compiler = new Compiler.Compiler(); VirtualMachine.Function compiledFunctions = compiler.CompileAST(outpu2); //Function.Print(compiledFunctions, LamnState.OutStream); return new VirtualMachine.Closure(compiledFunctions, new VirtualMachine.StackCell[0]); }
public LocalFunctionStatement(String name, Body body, Lexer.Position position) { Name = name; Body = body; SourcePos = position; }
public LocalAssignmentStatement(List<String> variables, List<Expression> expressions, Lexer.Position position) { Variables = variables; Expressions = expressions; SourcePos = position; }
public LexemeStream(Lexer.Lexeme[] source) { Source = source; Position = 0; PopWhitespaceAndComments(); }