public class Exec
extends java.lang.Object
Exec is an interpreter of abstract syntax trees.
This file contains the AST parser and parser helper functions.
AST Execution starts in the ASTExec file, but spreads throughout Rapids.
Trees have a Lisp-like structure with the following "reserved" special
characters:
'(' a nested function application expression ')
'{' a nested function definition expression '}'
'#' a double: attached_token
'[' a numeric or string list expression, till ']'
'%' an ID: attached_token
'"' a String (double quote): attached_token
"'" a String (single quote): attached_token
digits: a double
letters or other specials: an ID
In the above, attached_token signals that the special char has extra chars
that must be parsed separately. These are variable names (in the case of
%), doubles (in the case of #), Strings (in the case of ' and "), or number
lists (in the case of '[' till ']')
Variables are lexically scoped inside 'let' expressions or at the top-level
looked-up in the DKV directly (and must refer to a known type that is valid
on the execution stack)