|
@@ -87,7 +87,7 @@ int HqlLex::lookupIdentifierToken(YYSTYPE & returnToken, HqlLex * lexer, bool lo
|
|
|
IHqlExpression *expr;
|
|
|
//fprintf(stderr, "\nLookupSymbol %s\n",name->str());
|
|
|
//Lookup expr last otherwise it leaks.
|
|
|
- if ( !lookup || lexer->macroGathering || lexer->skipping|| !(expr=lexer->lookupSymbol(cname,returnToken)))
|
|
|
+ if ( !lookup || lexer->macroGathering || lexer->skipNesting|| !(expr=lexer->lookupSymbol(cname,returnToken)))
|
|
|
{
|
|
|
TraceReturnToken(UNKNOWN_ID);
|
|
|
returnToken.setId(cname);
|
|
@@ -299,14 +299,14 @@ xpathseq ([^}\r\n])+
|
|
|
|
|
|
#ERROR {
|
|
|
setupdatepos;
|
|
|
- if (lexer->macroGathering || lexer->skipping)
|
|
|
+ if (lexer->macroGathering || lexer->skipNesting)
|
|
|
return SKIPPED;
|
|
|
lexer->doError(returnToken, true);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#WARNING {
|
|
|
setupdatepos;
|
|
|
- if (lexer->macroGathering || lexer->skipping)
|
|
|
+ if (lexer->macroGathering || lexer->skipNesting)
|
|
|
return SKIPPED;
|
|
|
lexer->doError(returnToken, false);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
@@ -316,9 +316,9 @@ xpathseq ([^}\r\n])+
|
|
|
if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->beginNestedHash(HashStmtFor);
|
|
|
- if (lexer->skipping)
|
|
|
+ if (lexer->skipNesting)
|
|
|
{
|
|
|
- lexer->skipping++;
|
|
|
+ lexer->skipNesting++;
|
|
|
return SKIPPED;
|
|
|
}
|
|
|
lexer->doFor(returnToken, false);
|
|
@@ -329,9 +329,9 @@ xpathseq ([^}\r\n])+
|
|
|
if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->beginNestedHash(HashStmtForAll);
|
|
|
- if (lexer->skipping)
|
|
|
+ if (lexer->skipNesting)
|
|
|
{
|
|
|
- lexer->skipping++;
|
|
|
+ lexer->skipNesting++;
|
|
|
return SKIPPED;
|
|
|
}
|
|
|
lexer->doFor(returnToken, true);
|
|
@@ -342,9 +342,9 @@ xpathseq ([^}\r\n])+
|
|
|
if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->beginNestedHash(HashStmtLoop);
|
|
|
- if (lexer->skipping)
|
|
|
+ if (lexer->skipNesting)
|
|
|
{
|
|
|
- lexer->skipping++;
|
|
|
+ lexer->skipNesting++;
|
|
|
return SKIPPED;
|
|
|
}
|
|
|
lexer->doLoop(returnToken);
|
|
@@ -355,7 +355,7 @@ xpathseq ([^}\r\n])+
|
|
|
if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->hasHashbreak = true;
|
|
|
- if (lexer->skipping)
|
|
|
+ if (lexer->skipNesting)
|
|
|
return SKIPPED;
|
|
|
return HASHBREAK;
|
|
|
}
|
|
@@ -364,130 +364,130 @@ xpathseq ([^}\r\n])+
|
|
|
if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->beginNestedHash(HashStmtIf);
|
|
|
- if (lexer->skipping)
|
|
|
+ if (lexer->skipNesting)
|
|
|
{
|
|
|
- lexer->skipping++;
|
|
|
+ lexer->skipNesting++;
|
|
|
return SKIPPED;
|
|
|
}
|
|
|
- lexer->doIf(returnToken);
|
|
|
+ lexer->doIf(returnToken, false);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#EXPAND {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doExpand(returnToken);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#DECLARE {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doDeclare(returnToken);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#SET {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doSet(returnToken, false);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#TRACE {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doTrace(returnToken);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#EXPORT {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doExport(returnToken, false);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#EXPORTXML {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doExport(returnToken, true);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#MANGLE {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doMangle(returnToken, false);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#DEMANGLE {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doMangle(returnToken, true);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#APPLY {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doApply(returnToken);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#APPEND {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doSet(returnToken, true);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#CONSTANT {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return(HASH_CONSTANT);
|
|
|
}
|
|
|
#IFDEFINED {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doDefined(returnToken);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#ELSE {
|
|
|
setupdatepos;
|
|
|
- if (lexer->macroGathering)
|
|
|
+ if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return lexer->doElse(returnToken, lookup, activeState, false);
|
|
|
}
|
|
|
#ELSEIF {
|
|
|
setupdatepos;
|
|
|
- if (lexer->macroGathering)
|
|
|
+ if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return lexer->doElse(returnToken, lookup, activeState, true);
|
|
|
}
|
|
|
#ELSIF {
|
|
|
setupdatepos;
|
|
|
- if (lexer->macroGathering)
|
|
|
+ if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return lexer->doElse(returnToken, lookup, activeState, true);
|
|
|
}
|
|
|
#ELIF {
|
|
|
setupdatepos;
|
|
|
- if (lexer->macroGathering)
|
|
|
+ if (lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return lexer->doElse(returnToken, lookup, activeState, true);
|
|
|
}
|
|
|
#DEBUG {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return(HASH_OPTION);
|
|
|
}
|
|
|
#GETDATATYPE {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doGetDataType(returnToken);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
@@ -495,21 +495,21 @@ xpathseq ([^}\r\n])+
|
|
|
|
|
|
#INMODULE {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doInModule(returnToken);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#ISVALID {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doIsValid(returnToken);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#ISDEFINED {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
bool defined = lexer->doIsDefined(returnToken);
|
|
|
// RETURNHARD(defined ? TOK_TRUE : TOK_FALSE);
|
|
@@ -523,39 +523,39 @@ xpathseq ([^}\r\n])+
|
|
|
}
|
|
|
#LINK {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return(HASH_LINK);
|
|
|
}
|
|
|
#ONWARNING {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return(HASH_ONWARNING);
|
|
|
}
|
|
|
#OPTION {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return(HASH_OPTION);
|
|
|
}
|
|
|
#STORED {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return(HASH_STORED);
|
|
|
}
|
|
|
#TEXT {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering || !lookup)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering || !lookup)
|
|
|
return SKIPPED;
|
|
|
return lexer->doHashText(returnToken);
|
|
|
}
|
|
|
#UNIQUENAME {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
{
|
|
|
- //PrintLog("lexer->skipping #UNIQUENAME");
|
|
|
+ //PrintLog("lexer->skipNesting #UNIQUENAME");
|
|
|
return SKIPPED;
|
|
|
}
|
|
|
lexer->doUniqueName(returnToken);
|
|
@@ -563,7 +563,7 @@ xpathseq ([^}\r\n])+
|
|
|
}
|
|
|
#WORKUNIT {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
return(HASH_WORKUNIT);
|
|
|
}
|
|
@@ -583,26 +583,15 @@ __LINE__ {
|
|
|
#END {
|
|
|
//Place #END last so the specialised versions are hit first
|
|
|
setupdatepos;
|
|
|
- if (lexer->macroGathering)
|
|
|
- return SKIPPED;
|
|
|
- unsigned depth = 1;
|
|
|
- if (lexer->hashendDepths.ordinality() == 0)
|
|
|
- lexer->reportError(returnToken, ERR_TMPLT_EXTRAEND,"#END doesn't match a # command");
|
|
|
- else
|
|
|
- depth = lexer->endNestedHash();
|
|
|
- if (lexer->skipping)
|
|
|
- {
|
|
|
- lexer->skipping -= depth;
|
|
|
- return(HASHEND);
|
|
|
- }
|
|
|
-
|
|
|
- return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
+ if (lexer->macroGathering)
|
|
|
+ return SKIPPED;
|
|
|
+ return lexer->doEnd(returnToken, lookup, activeState);
|
|
|
}
|
|
|
#{letter}{alphanum}* {
|
|
|
//Trap any unknown #commands
|
|
|
/* otherwise, unknown # command */
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping)
|
|
|
+ if (lexer->skipNesting)
|
|
|
return SKIPPED;
|
|
|
StringBuffer msg("Unknown # command: ");
|
|
|
msg.append(CUR_TOKEN_TEXT);
|
|
@@ -1009,7 +998,7 @@ __STAND_ALONE__ {
|
|
|
|
|
|
{percent}{alphanumcolon}*{percent} {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doPreprocessorLookup(returnToken, false, 0);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
@@ -1017,14 +1006,14 @@ __STAND_ALONE__ {
|
|
|
|
|
|
{percent}'{alphanumcolon}*'{percent} {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doPreprocessorLookup(returnToken, true, 1);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
|
};
|
|
|
{percent}\{{xpathseq}\}{percent} {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doPreprocessorLookup(returnToken, false, 1);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|
|
@@ -1032,7 +1021,7 @@ __STAND_ALONE__ {
|
|
|
|
|
|
{percent}'\{{xpathseq}\}'{percent} {
|
|
|
setupdatepos;
|
|
|
- if (lexer->skipping || lexer->macroGathering)
|
|
|
+ if (lexer->skipNesting || lexer->macroGathering)
|
|
|
return SKIPPED;
|
|
|
lexer->doPreprocessorLookup(returnToken, true, 2);
|
|
|
return lexer->yyLex(returnToken, lookup, activeState);
|