diff options
author | Willem Jan Palenstijn | 2010-07-21 19:59:33 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2010-07-21 19:59:33 +0000 |
commit | a97d8875f5d921a6e6b2583ebe07f75b6989633f (patch) | |
tree | d91fc404c4837ec99af48bf9d324be115683c159 /engines/sci/parser/vocabulary.h | |
parent | e95ef4f5f8f007763cf13fd718b6a2b4cdbb5711 (diff) | |
download | scummvm-rg350-a97d8875f5d921a6e6b2583ebe07f75b6989633f.tar.gz scummvm-rg350-a97d8875f5d921a6e6b2583ebe07f75b6989633f.tar.bz2 scummvm-rg350-a97d8875f5d921a6e6b2583ebe07f75b6989633f.zip |
SCI: Rewrite said spec handling.
We now use a manual parser instead of a bison-generated one, and the
new code to match said trees with parse trees matches sierra's more
closely.
Also change the parse/spec tree nodes to use direct pointers to
their child nodes to make it more convenient to manipulate the trees.
This has a high potential for regressions.
svn-id: r51099
Diffstat (limited to 'engines/sci/parser/vocabulary.h')
-rw-r--r-- | engines/sci/parser/vocabulary.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h index 5c8c8fd57d..375e0b21e9 100644 --- a/engines/sci/parser/vocabulary.h +++ b/engines/sci/parser/vocabulary.h @@ -82,7 +82,7 @@ enum { #define VOCAB_MAGIC_NUMBER_GROUP 0xffd /* 0xffe ? */ #define VOCAB_MAGIC_NOTHING_GROUP 0xffe -/* Number of nodes for each parse_tree_node structure */ +/* Number of nodes for each ParseTreeNode structure */ #define VOCAB_TREE_NODES 500 #define VOCAB_TREE_NODE_LAST_WORD_STORAGE 0x140 @@ -152,16 +152,16 @@ struct parse_tree_branch_t { }; enum ParseTypes { - kParseTreeLeafNode = 0, - kParseTreeBranchNode = 1 + kParseTreeWordNode = 4, + kParseTreeLeafNode = 5, + kParseTreeBranchNode = 6 }; -struct parse_tree_node_t { +struct ParseTreeNode { ParseTypes type; /**< leaf or branch */ - union { - int value; /**< For leaves */ - short branches[2]; /**< For branches */ - } content; + int value; /**< For leaves */ + ParseTreeNode* left; /**< Left child, for branches */ + ParseTreeNode* right; /**< Right child, for branches */ }; enum VocabularyVersions { @@ -321,7 +321,7 @@ private: public: // Accessed by said() - parse_tree_node_t _parserNodes[VOCAB_TREE_NODES]; /**< The parse tree */ + ParseTreeNode _parserNodes[VOCAB_TREE_NODES]; /**< The parse tree */ // Parser data: reg_t parser_base; /**< Base address for the parser error reporting mechanism */ @@ -334,7 +334,7 @@ public: * @param tree_name Name of the tree to dump (free-form) * @param nodes The nodes containing the parse tree */ -void vocab_dump_parse_tree(const char *tree_name, parse_tree_node_t *nodes); +void vocab_dump_parse_tree(const char *tree_name, ParseTreeNode *nodes); |