+(defun parse (lexed-ast &optional structure)
+ "PARSE LEXED-AST &optional STRUCTURE => AST
+
+ARGUMENTS AND VALUES:
+
+ LEXED-AST: An ambigious ast
+ STRUCTURE: A boolean
+ AST: An unambigious ast that can be transpiled
+
+DESCRIPTION:
+
+ PARSE takes a ambigious LEXED-AST and converts it to an unambigious one.
+
+ When STRUCTURE is true, parse is done with the expanded indentifier set used
+ in NetLogo files, as well as pulling out procedure definitions.
+
+ The need for a parser between the lexer and the transpiler is because NetLogo
+ needs two passes to turn into something that can be used. This is the only entry
+ point into this module, and should probably remain that way.
+
+ There's also a lot of error checking that the LEXED-AST even makes sense, even
+ though the lexer obviously thought it did.
+
+ Examples are too numerous and varied, but by inserting an output between
+ the lexer and this code, a good idea of what goes on can be gotten."
+ (let
+ ; could have defined this using the special variable, but didn't to make the
+ ; function definition simpler, as well as the documentation.
+ ((*in-structure* structure))
+ (parse-internal lexed-ast)))
+
+(defun parse-internal (lexed-ast)