pub fn parse(input: &str) -> Result<Program, Error>Expand description
This function takes in a string input, and produces either a valid syntax tree, or a syntax error.
§Arguments
input- The input SAP program as a string.
§Returns
-
If there are no syntax errors, an
Ok(Program), which is the root node containing the entire AST (Abstract Syntax Tree) which represents the program. -
If there are syntax errors, then an
Err(Error)is returned, containing information about what went wrong.