aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/vocabulary.h
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-31 02:37:24 +0000
committerFilippos Karapetis2009-05-31 02:37:24 +0000
commita4d13cef8c48eecb1f73f2d509437261a663ab05 (patch)
treeb4cbf2d09a3a7fb78f982168a513e63e790b8f78 /engines/sci/vocabulary.h
parent896df6daf337bf83f27193918eb386321c4b0166 (diff)
downloadscummvm-rg350-a4d13cef8c48eecb1f73f2d509437261a663ab05.tar.gz
scummvm-rg350-a4d13cef8c48eecb1f73f2d509437261a663ab05.tar.bz2
scummvm-rg350-a4d13cef8c48eecb1f73f2d509437261a663ab05.zip
More objectification of the Vocabulary functions
svn-id: r41057
Diffstat (limited to 'engines/sci/vocabulary.h')
-rw-r--r--engines/sci/vocabulary.h59
1 files changed, 26 insertions, 33 deletions
diff --git a/engines/sci/vocabulary.h b/engines/sci/vocabulary.h
index f364a5bda0..cb4bb181d4 100644
--- a/engines/sci/vocabulary.h
+++ b/engines/sci/vocabulary.h
@@ -231,6 +231,31 @@ public:
*/
bool getBranches();
+ /**
+ * Gets any word from the specified group. For debugging only.
+ * @param group Group number
+ */
+ const char *getAnyWordFromGroup(int group);
+
+
+ /* Looks up a single word in the words and suffixes list
+ ** Parameters: (char *) word: Pointer to the word to look up
+ ** (int) word_len: Length of the word to look up
+ ** Returns : (const ResultWordList &) A list containing 1 or 0 words
+ */
+ ResultWord lookupWord(const char *word, int word_len);
+
+
+ /* Tokenizes a string and compiles it into word_ts.
+ ** Parameters: (char *) sentence: The sentence to examine
+ ** (char **) error: Points to a malloc'd copy of the offending text or to NULL on error
+ ** (ResultWordList) retval: A list of word_ts containing the result, or NULL.
+ ** Returns : true on success, false on failure
+ ** On error, NULL is returned. If *error is NULL, the sentence did not contain any useful words;
+ ** if not, *error points to a malloc'd copy of the offending word.
+ ** The returned list may contain anywords.
+ */
+ bool tokenizeString(ResultWordList &retval, const char *sentence, char **error);
Common::StringList _selectorNames;
Common::Array<opcode> _opcodes;
@@ -238,6 +263,7 @@ public:
WordMap _parserWords;
SuffixList _parserSuffixes;
Common::Array<parse_tree_branch_t> _parserBranches;
+ selector_map_t _selectorMap; /**< Shortcut list for important selectors */
private:
ResourceManager *_resmgr;
@@ -245,32 +271,6 @@ private:
int _vocabVersion;
};
-/* Looks up a single word in the words and suffixes list
-** Parameters: (char *) word: Pointer to the word to look up
-** (int) word_len: Length of the word to look up
-** (const WordMap &) words: List of words
-** (SuffixList) suffixes: List of suffixes
-** Returns : (const ResultWordList &) A list containing 1 or 0 words
-*/
-ResultWord vocab_lookup_word(const char *word, int word_len,
- const WordMap &words, const SuffixList &suffixes);
-
-
-/* Tokenizes a string and compiles it into word_ts.
-** Parameters: (char *) sentence: The sentence to examine
-** (const WordMap &) words: The words to scan for
-** (SuffixList) suffixes: suffixes to scan for
-** (char **) error: Points to a malloc'd copy of the offending text or to NULL on error
-** (ResultWordList) retval: A list of word_ts containing the result, or NULL.
-** Returns : true on success, false on failure
-** On error, NULL is returned. If *error is NULL, the sentence did not contain any useful words;
-** if not, *error points to a malloc'd copy of the offending word.
-** The returned list may contain anywords.
-*/
-bool vocab_tokenize_string(ResultWordList &retval, const char *sentence,
- const WordMap &words, const SuffixList &suffixes, char **error);
-
-
/* Constructs the Greibach Normal Form of the grammar supplied in 'branches'
** Parameters: (parse_tree_branch_t *) branches: The parser's branches
** Returns : (parse_rule_list_t *): Pointer to a list of singly linked
@@ -319,13 +319,6 @@ void vocab_dump_parse_tree(const char *tree_name, parse_tree_node_t *nodes);
*/
int said(EngineState *s, byte *spec, int verbose);
-/**
- * Gets any word from the specified group. For debugging only.
- * @param group Group number
- * @param words List of words
- */
-const char *vocab_get_any_group_word(int group, const WordMap &words);
-
/* Decyphers a said block and dumps its content via sciprintf.
** Parameters: (EngineState *) s: The state to use