Add OvaleAST module to generate an abstract syntax tree from a script.
Add OvaleAST module to generate an abstract syntax tree from a script.
This module implements a recursive descent parser for the Ovale script
language and generates an AST for further manipulation.
There are some ambiguities in the script language:
* Unary negation versus binary subtraction.
* '{' and '}' can enclose either a statement group or an expression.
The public methods for OvaleAST are:
ParseCode(code) to generate an AST from a block of code.
ParseScript(name) to generate an AST from a named script.
Unparse(node) to generate a block of code from an AST node.
Optimize(ast) to make optimization passes through the AST.
Unparse(ParseCode(Code)) should be roughly idempotent in that the original
code and the resulting code should have the same AST representation.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1542 d5049fe3-3747-40f7-a4b5-f36d6801af5f