예제 #1
0
def compile_with_standard_library(vbs: SourceFile) -> Result:
    cpl = Compiler()
    ast = Parser.parse_file(vbs)
    cpl.add_module(ast, reference.ProceduralModule, "main_module")
    program = cpl.link_standard_library(cpl.program)

    return program.to_dict()
예제 #2
0
def interpreting(vbs: SourceFile) -> Result:
    ast = Parser.parse_file(vbs)
    comp = Compiler()
    comp.add_module(ast, reference.ProceduralModule, "main_module")

    program = comp.link_standard_library(comp.program)

    interp = interpreter.Interpreter(program)
    interp.run("Main")

    return interp._outside_world.to_dict(reproducible=True)
예제 #3
0
def execute_program(program: Program, entry_point: str) -> None:
    linked_program = Compiler.link_standard_library(program)
    return Interpreter.run_program(linked_program, entry_point)