diff options
author | Willem Jan Palenstijn | 2010-10-02 23:17:03 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2010-10-02 23:17:03 +0000 |
commit | ab46bf0f61b5c18acbd3abbf0f8cd42ccd9f9956 (patch) | |
tree | 2669732eb87559f2d712ecf8530df27d370fd11a /engines/sci/parser/grammar.cpp | |
parent | 4a9f2204c4666841b50fdf2fc188c22240010752 (diff) | |
download | scummvm-rg350-ab46bf0f61b5c18acbd3abbf0f8cd42ccd9f9956.tar.gz scummvm-rg350-ab46bf0f61b5c18acbd3abbf0f8cd42ccd9f9956.tar.bz2 scummvm-rg350-ab46bf0f61b5c18acbd3abbf0f8cd42ccd9f9956.zip |
SCI: Allow multiple word groups in parse tree leafs
This is to prepare for multilingual SCI versions. In those a single typed word
may be parsed to multiple class,group pairs, any of which may match
the said specs. The actual parsing is not yet implemented.
svn-id: r52985
Diffstat (limited to 'engines/sci/parser/grammar.cpp')
-rw-r--r-- | engines/sci/parser/grammar.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp index 6f37b49919..ad00397057 100644 --- a/engines/sci/parser/grammar.cpp +++ b/engines/sci/parser/grammar.cpp @@ -445,6 +445,7 @@ static int _vbpt_append(ParseTreeNode *nodes, int *pos, int base, int value) { nodes[base].left = &nodes[++(*pos)]; nodes[*pos].type = kParseTreeLeafNode; nodes[*pos].value = value; + nodes[*pos].right = 0; nodes[base].right = &nodes[++(*pos)]; nodes[*pos].type = kParseTreeBranchNode; nodes[*pos].left = 0; @@ -456,6 +457,7 @@ static int _vbpt_terminate(ParseTreeNode *nodes, int *pos, int base, int value) // Terminates, overwriting a nextwrite forknode nodes[base].type = kParseTreeLeafNode; nodes[base].value = value; + nodes[base].right = 0; return *pos; } @@ -570,6 +572,7 @@ int Vocabulary::parseGNF(const ResultWordList &words, bool verbose) { _parserNodes[1].type = kParseTreeLeafNode; _parserNodes[1].value = 0x141; + _parserNodes[1].right = 0; _parserNodes[2].type = kParseTreeBranchNode; _parserNodes[2].left = 0; |