Module gdminus_int

GDMinus Interpreter.

Copyright © (C) 2021, Lincoln Bryant

Authors: Lincoln Bryant This source code is made available under the Apache License v2.0.

Description

GDMinus Interpreter.

Function Index

destroy/0Delete all stateful information in the process dictionary.
do/1Walk the parse tree, evaluating statements and expressions along the way.
do/2Walk the parse tree, evaluating statements and expressions along the way.
file/1Open a file, tokenize, parse, evaluate, and return the final output to the caller.
file/2Open a file, tokenize, parse, evaluate, and return the final output to the caller.
init/0Initialize the state of the interpreter in the process dictionary.
insert_function/2Insert an function into the GDScript function table.
parse_file/1Parse a list of tokens into GDScript grammar.
scan_file/1Read a file from disk and tokenize it to prepare for parsing.

Function Details

destroy/0

destroy() -> ok

Delete all stateful information in the process dictionary

do/1

do(Stmt::list()) -> {list(), list(), tuple()}

Walk the parse tree, evaluating statements and expressions along the way. Output from print functions etc returned as lists representing Standard Out and Standard Error. The state record itself will be returned as well.

do/2

do(Stmt::list(), Return::map()) -> {list(), list(), map(), tuple()}

Walk the parse tree, evaluating statements and expressions along the way. Output from print functions etc returned as lists representing Standard Out and Standard Error. A map will be returned with the final state of requested variables. Finally the state record itself will be returned.

file/1

file(Path::list()) -> {list(), list()}

Open a file, tokenize, parse, evaluate, and return the final output to the caller.

file/2

file(Path::list(), X2::atom()) -> {list(), list()} | {list(), list(), tuple()}

Open a file, tokenize, parse, evaluate, and return the final output to the caller. Optionally return the final state of the program.

init/0

init() -> ok

Initialize the state of the interpreter in the process dictionary

insert_function/2

insert_function(Name::list(), Fun::function()) -> ok

Insert an function into the GDScript function table. Functions may only take a list as an argument.

parse_file/1

parse_file(Path::list()) -> list()

Parse a list of tokens into GDScript grammar.

scan_file/1

scan_file(Path::list()) -> list()

Read a file from disk and tokenize it to prepare for parsing.


Generated by EDoc