Separate class spell information from functions and UI elements.

This allows the spell information to be re-used in other scripts without
also including unwanted functions or UI elements (checkboxes and lists).

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1523 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Give default scripts a unique name to use via "Include(...)".

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1524 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Fix the addon broadcast message for requesting a version check.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1525 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Avoid needless use of GetInventorySlotInfo() when constants are provided.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1526 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Defer creation of frame for tooltip-scanning until addon is loaded.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1527 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Remove unused code.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1528 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Rename "name" field to "spellName" to avoid conflict with AceAddon.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1529 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Quiet compiler.pl warnings.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1530 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Detect private functions defined using variable assignment.

This detects functions defined as follows:

    local foo
    foo = function() ... end

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1531 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Overhaul of WoWAPI unit testing module.

The WoWAPI module tries to provide enough of the WoW environment to be
able to load addon files and do unit testing or integration testing of
addon components.

WoWAPI contains fake implementations of some libraries that are used
by Ovale.

Example usage:

    local state = {
        class = "DRUID",
        level = 90,
    }
    dofile("WoWAPI.lua")
    WoWAPI:Initialize("Ovale", state)
    WoWAPI:ExportSymbols()
    WoWAPI:LoadTOC("Ovale.toc")

This example loads all of the Ovale addon's files in the order listed in
its TOC file.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1532 d5049fe3-3747-40f7-a4b5-f36d6801af5f
WoWAPI: Add strsplit to string module and fix for "." in delimiter string.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1533 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Fix generate.lua to work after WoWAPI module changes.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1534 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Split out unit tests in OvaleTimeSpan into a separate file.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1535 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Add test for properly loading all of the Ovale addon files.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1536 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Remove unprintable characters that caused failures when loading in Lua.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1537 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Add new queue method :At() to return the queue element at the given index.

Also, tweak the internal indices so that in the best case usage, the queue
simply uses array table size for the queued elements.  Lastly, fix the
documentation since queue = FIFO and stack = LIFO.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1538 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Encapsulate vendor code in a better way.

Include the file verbatim with the minor changes needed to allow it to be
part of an addon file.  Wrap the exported functions within an Ovale
module.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1539 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Change OvaleLexer into an object factory to generate lexers.

The calling code must provide an iterator, which is typically generated
with OvaleLexer.scan.  The lexer buffers the token stream so that it may
be accessed with look-ahead capabilities.

The lexer provides two methods for accessing the buffered token stream:

Peek(k) buffers the next k tokens from the stream and returns the k'th one.
Consume(k) consumes the next k tokens from the buffer and returns the k'th one.

This allows the following code to iterate through the token stream without
consuming extra tokens.

    -- Process tokens until seeing a '}'.
    local tokenType, token = lexer:Peek()
    while tokenType ~= "}" do
        lexer:Consume()
        -- do stuff here with the token
        tokenType, token = lexer:Peek()
    end
    -- Here, the next token to be consumed is still '}'.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1540 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Move ComputeParameter into the dependent code to reduce dependencies.

This has code duplication and needs to refactored.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1541 d5049fe3-3747-40f7-a4b5-f36d6801af5f
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+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@1542 d5049fe3-3747-40f7-a4b5-f36d6801af5f