lyacc library

Functions

app(List<String> arguments, String versionString, String preAmble, String quitStatement, Map<String, dynamic> tokenMap, Map<String, dynamic> grammar, List<String> cosmeticTokens, Map<String, dynamic> functionMap) → void
This method contains the entire app/interpreter. This is the only method you need to call!
constructParseTree(Map<String, dynamic> grammar, List<String> cosmeticTokens, List parsedTokens) List
This method builds an AST of the matched tokens, removes all unneeded tokens and constructs an intermediate representation by trying to "understand" the code it is given.
evaluateLine(Map<String, dynamic> tokenMap, String text, Map<String, dynamic> grammar, List<String> cosmeticTokens, Map<String, dynamic> functionMap) → void
This method executes each line of a given line of text!
executeParseTree(List parseTree, Map<String, dynamic> functionMap) → void
This method takes the intermediate representation and AST from the parse tree and executes a function with a given number of arguments. Each function has a dynamic list of arguments. This method adds to that list and runs the result.
parseText(Map<String, dynamic> tokenMap, String text) List
This method synthesizes the matched tokens from a string of text. The tokens are supplied as a map.
readFile(String fileName, Map<String, dynamic> tokenMap, Map<String, dynamic> grammar, List<String> cosmeticTokens, Map<String, dynamic> functionMap) → void
This method reads the contents of a file and executes each line of code.
shell(String preAmble, String quitStatement, Map<String, dynamic> tokenMap, Map<String, dynamic> grammar, List<String> cosmeticTokens, Map<String, dynamic> functionMap) → void
This method provides a shell method. It can be customized.
visualParseTree(List parseTree) → void
This method prints a visual of the AST.