aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/parser
diff options
context:
space:
mode:
authorMax Horn2010-02-13 17:42:49 +0000
committerMax Horn2010-02-13 17:42:49 +0000
commitac4d325e0d61b649026a5f5414f749697b285ccc (patch)
treec58f62596d050be62e98180c0255e7998a9a62e4 /engines/sci/parser
parent24fd77eb242c4d90e8c3a3b0bcc5f0c48a4dc77f (diff)
downloadscummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.tar.gz
scummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.tar.bz2
scummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.zip
SCI: Add global g_sci pointer to the active SciEngine instance
svn-id: r48046
Diffstat (limited to 'engines/sci/parser')
-rw-r--r--engines/sci/parser/grammar.cpp4
-rw-r--r--engines/sci/parser/vocabulary.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp
index 9ee3b8aeaa..1f35bffbc4 100644
--- a/engines/sci/parser/grammar.cpp
+++ b/engines/sci/parser/grammar.cpp
@@ -355,7 +355,7 @@ ParseRuleList *Vocabulary::buildGNF(bool verbose) {
int ntrules_nr;
ParseRuleList *ntlist = NULL;
ParseRuleList *tlist, *new_tlist;
- Console *con = ((SciEngine *)g_engine)->getSciDebugger();
+ Console *con = g_sci->getSciDebugger();
for (uint i = 1; i < _parserBranches.size(); i++) { // branch rule 0 is treated specially
ParseRule *rule = _vbuild_rule(&_parserBranches[i]);
@@ -480,7 +480,7 @@ static int _vbpt_write_subexpression(parse_tree_node_t *nodes, int *pos, ParseRu
}
int Vocabulary::parseGNF(const ResultWordList &words, bool verbose) {
- Console *con = ((SciEngine *)g_engine)->getSciDebugger();
+ Console *con = g_sci->getSciDebugger();
// Get the start rules:
ParseRuleList *work = _vocab_clone_rule_list_by_id(_parserRules, _parserBranches[0].data[1]);
ParseRuleList *results = NULL;
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 2cf47f00c3..00448f5d51 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -448,7 +448,7 @@ bool Vocabulary::tokenizeString(ResultWordList &retval, const char *sentence, ch
void Vocabulary::printSuffixes() const {
char word_buf[256], alt_buf[256];
- Console *con = ((SciEngine *)g_engine)->getSciDebugger();
+ Console *con = g_sci->getSciDebugger();
int i = 0;
for (SuffixList::const_iterator suf = _parserSuffixes.begin(); suf != _parserSuffixes.end(); ++suf) {
@@ -463,7 +463,7 @@ void Vocabulary::printSuffixes() const {
}
void Vocabulary::printParserWords() const {
- Console *con = ((SciEngine *)g_engine)->getSciDebugger();
+ Console *con = g_sci->getSciDebugger();
int j = 0;
for (WordMap::iterator i = _parserWords.begin(); i != _parserWords.end(); ++i) {
@@ -570,7 +570,7 @@ void Vocabulary::synonymizeTokens(ResultWordList &words) {
}
void Vocabulary::printParserNodes(int num) {
- Console *con = ((SciEngine *)g_engine)->getSciDebugger();
+ Console *con = g_sci->getSciDebugger();
for (int i = 0; i < num; i++) {
con->DebugPrintf(" Node %03x: ", i);
@@ -584,7 +584,7 @@ void Vocabulary::printParserNodes(int num) {
int Vocabulary::parseNodes(int *i, int *pos, int type, int nr, int argc, const char **argv) {
int nextToken = 0, nextValue = 0, newPos = 0, oldPos = 0;
- Console *con = ((SciEngine *)g_engine)->getSciDebugger();
+ Console *con = g_sci->getSciDebugger();
if (type == kParseNil)
return 0;