#include <cccc_utl.h>
|
| ParseUtility (ANTLRParser *parser) |
|
| ~ParseUtility () |
|
void | tracein (const char *rulename, int guessing, ANTLRAbstractToken *tok) |
|
void | traceout (const char *rulename, int guessing, ANTLRAbstractToken *tok) |
|
void | syn (_ANTLRTokenPtr tok, ANTLRChar *egroup, SetWordType *eset, ANTLRTokenType etok, int k) |
|
string | lookahead_text (int n) |
|
void | resynchronize (int initial_nesting, SetWordType *resync_token_class, ANTLRTokenPtr &resync_token) |
|
string | scopeCombine (const string &baseScope, const string &name) |
|
Definition at line 139 of file cccc_utl.h.
Definition at line 183 of file cccc_utl.cc.
static ParseUtility * theCurrentInstance
ParseUtility::~ParseUtility |
( |
| ) |
|
Definition at line 199 of file cccc_utl.cc.
static ParseUtility * theCurrentInstance
Definition at line 169 of file cccc_utl.h.
static ParseUtility * theCurrentInstance
string ParseUtility::lookahead_text |
( |
int |
n | ) |
|
Definition at line 99 of file cccc_utl.cc.
101 static string retval;
108 retval=retval+
parser->LT(i)->getText();
ANTLR_Assisted_Parser * parser
void ParseUtility::resynchronize |
( |
int |
initial_nesting, |
|
|
SetWordType * |
resync_token_class, |
|
|
ANTLRTokenPtr & |
resync_token |
|
) |
| |
Definition at line 115 of file cccc_utl.cc.
128 string resync_text=
"...";
130 string string1=
parser->LT(1)->getText();
131 int line1=
parser->LT(1)->getLine();
135 int resynchronising=1;
136 while(resynchronising)
138 parser->consumeUntil(resync_token_class);
140 (
MY_TOK(
parser->LT(1))->getNestingLevel() > initial_nesting) &&
150 string2=
parser->LT(1)->getText();
151 line2=
parser->LT(1)->getLine();
158 resync_token=
parser->LT(1);
160 parser->set_el(
parser->LT(1)->getType(),resync_token_class) &&
161 (
MY_TOK(
parser->LT(1))->getNestingLevel() == initial_nesting)
164 string2=
parser->LT(1)->getText();
165 line2=
parser->LT(1)->getLine();
167 resync_text+=
parser->LT(1)->getText();
169 resync_token=
parser->LT(1);
170 resync_token->setText(resync_text.c_str());
174 cerr <<
"Unrecognized section from "
175 << string1.c_str() <<
" on line " << line1 <<
" to "
176 << string2.c_str() <<
" on line " << line2 << endl
177 <<
"=====ignored section begins=====" << endl
178 << resync_text.c_str() << endl
179 <<
"===== ignored section ends =====" << endl;
ANTLR_Assisted_Parser * parser
string ParseUtility::scopeCombine |
( |
const string & |
baseScope, |
|
|
const string & |
name |
|
) |
| |
Definition at line 207 of file cccc_utl.cc.
216 bool bIgnoreScope=
true;
222 else if(baseScope.size()>0 && name.size()>0)
224 retval=baseScope+
"::"+name;
228 retval=baseScope+name;
void ParseUtility::syn |
( |
_ANTLRTokenPtr |
tok, |
|
|
ANTLRChar * |
egroup, |
|
|
SetWordType * |
eset, |
|
|
ANTLRTokenType |
etok, |
|
|
int |
k |
|
) |
| |
Definition at line 549 of file cccc_utl.cc.
556 cerr << filename <<
'(' << tok->getLine() <<
"):"
557 <<
" syntax error at token " << tok->getText() << endl;
561 cerr << filename <<
"(0): syntax error at null token" << endl;
575 cerr <<
"Parser context:" << endl;
static string stack_rules[MAX_STACK_DEPTH]
static ParseStore * currentInstance()
static int stack_tokenline[MAX_STACK_DEPTH]
static string stack_tokentext[MAX_STACK_DEPTH]
void ParseUtility::tracein |
( |
const char * |
rulename, |
|
|
int |
guessing, |
|
|
ANTLRAbstractToken * |
tok |
|
) |
| |
Definition at line 501 of file cccc_utl.cc.
517 rectrace(rulename,
"-> ",guessing,tok);
static void rectrace(const char *rulename, const char *dir_indic, int guessing, ANTLRAbstractToken *tok)
static void toktrace(ANTLRAbstractToken *tok)
static string stack_rules[MAX_STACK_DEPTH]
static int stack_tokenline[MAX_STACK_DEPTH]
static string stack_tokentext[MAX_STACK_DEPTH]
void ParseUtility::traceout |
( |
const char * |
rulename, |
|
|
int |
guessing, |
|
|
ANTLRAbstractToken * |
tok |
|
) |
| |
Definition at line 520 of file cccc_utl.cc.
530 cerr <<
"ParseUtility::traceout negative stack depth - "
531 <<
"exiting from rule " << rulename
532 <<
" at " << tok->getText() <<
" on line " << tok->getLine()
537 cerr <<
"ParseStore::traceout rule name mismatch - "
546 rectrace(rulename,
"<- ",guessing,tok);
static void rectrace(const char *rulename, const char *dir_indic, int guessing, ANTLRAbstractToken *tok)
static void toktrace(ANTLRAbstractToken *tok)
static string stack_rules[MAX_STACK_DEPTH]
static int stack_tokenline[MAX_STACK_DEPTH]
static string stack_tokentext[MAX_STACK_DEPTH]
int ParseUtility::stack_depth |
|
staticprivate |
string ParseUtility::stack_rules |
|
staticprivate |
int ParseUtility::stack_tokenline |
|
staticprivate |
string ParseUtility::stack_tokentext |
|
staticprivate |
int ParseUtility::trace_depth |
|
private |
The documentation for this class was generated from the following files: