mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improved separation of scanner/parser debug selection
- now use debug 2 for scanner and debug 4 for parser. Provided better feedback about what is being parsed (debug mode) - relocate debug application to applications/tools/foamExprParserInfo
This commit is contained in:
@ -395,7 +395,8 @@ public:
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Execute the parser
|
||||
//- Execute the parser.
|
||||
// The return value currently has no meaning.
|
||||
virtual unsigned parse
|
||||
(
|
||||
const std::string& expr,
|
||||
|
||||
@ -39,6 +39,9 @@ Description
|
||||
rand | Random field | 0/1 |
|
||||
\endtable
|
||||
|
||||
Note
|
||||
Use namespace debug switch \c fieldExpr for scanner (2), parser (4)
|
||||
|
||||
SourceFiles
|
||||
fieldExprDriver.C
|
||||
fieldExprDriverFields.C
|
||||
@ -133,6 +136,7 @@ public:
|
||||
using genericRagelLemonDriver::content;
|
||||
|
||||
//- Execute the parser
|
||||
// The return value currently has no meaning.
|
||||
virtual unsigned parse
|
||||
(
|
||||
const std::string& expr,
|
||||
|
||||
@ -381,7 +381,7 @@ void Foam::expressions::fieldExpr::parser::start(parseDriver& driver_)
|
||||
this->stop();
|
||||
lemon_ = ParseAlloc(::operator new, &driver_);
|
||||
|
||||
if (debug || driver_.debugParser())
|
||||
if ((debug & 0x4) || driver_.debugParser())
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
ParseTrace(stderr, const_cast<char*>(prompt_));
|
||||
|
||||
@ -42,7 +42,7 @@ Description
|
||||
|
||||
// Debugging to stderr
|
||||
#undef DebugInfo
|
||||
#define DebugInfo if (debug) InfoErr
|
||||
#define DebugInfo if (debug & 0x2) InfoErr
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -157,7 +157,7 @@ static int driverTokenType
|
||||
|
||||
#define EMIT_TOKEN(T) \
|
||||
driver_.parsePosition() = (ts-buf); \
|
||||
DebugInfo<< STRINGIFY(T) << ": " << driver_.parsePosition() << nl; \
|
||||
DebugInfo<< STRINGIFY(T) << " at " << driver_.parsePosition() << nl; \
|
||||
parser_->parse(TOKEN_OF(T), nullptr); \
|
||||
driver_.parsePosition() = (p-buf);
|
||||
|
||||
@ -349,9 +349,14 @@ bool Foam::expressions::fieldExpr::scanner::process
|
||||
// Save debug value
|
||||
const int oldDebug = debug;
|
||||
|
||||
if (driver_.debugScanner())
|
||||
if (driver_.debugScanner()) { debug |= 0x2; }
|
||||
if (driver_.debugParser()) { debug |= 0x4; }
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
debug |= 4;
|
||||
InfoErr
|
||||
<< "Begin parse {"
|
||||
<< str.substr(strBeg, strLen).c_str() << '}' << nl;
|
||||
}
|
||||
|
||||
if (!parser_)
|
||||
@ -383,12 +388,12 @@ bool Foam::expressions::fieldExpr::scanner::process
|
||||
// Scan token type
|
||||
scanToken scanTok;
|
||||
|
||||
// Ragel token start/end (required naming)
|
||||
// Token start/end (Ragel naming)
|
||||
const char* ts;
|
||||
const char* te;
|
||||
|
||||
// Local buffer data.
|
||||
// - p, pe, eof are required Ragel naming
|
||||
// - p, pe, eof are Ragel naming
|
||||
// - buf is our own naming
|
||||
|
||||
const char* buf = &(str[strBeg]);
|
||||
@ -398,7 +403,7 @@ bool Foam::expressions::fieldExpr::scanner::process
|
||||
|
||||
// Initialize FSM variables
|
||||
|
||||
#line 402 "fieldExprScanner.cc"
|
||||
#line 407 "fieldExprScanner.cc"
|
||||
{
|
||||
cs = fieldExpr_start;
|
||||
ts = 0;
|
||||
@ -406,11 +411,11 @@ bool Foam::expressions::fieldExpr::scanner::process
|
||||
act = 0;
|
||||
}
|
||||
|
||||
#line 528 "fieldExprScanner.rl"
|
||||
#line 533 "fieldExprScanner.rl"
|
||||
/* ^^^ FSM initialization here ^^^ */;
|
||||
|
||||
|
||||
#line 414 "fieldExprScanner.cc"
|
||||
#line 419 "fieldExprScanner.cc"
|
||||
{
|
||||
if ( p == pe )
|
||||
goto _test_eof;
|
||||
@ -748,7 +753,7 @@ st11:
|
||||
case 11:
|
||||
#line 1 "NONE"
|
||||
{ts = p;}
|
||||
#line 752 "fieldExprScanner.cc"
|
||||
#line 757 "fieldExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 32: goto st12;
|
||||
case 33: goto st13;
|
||||
@ -875,7 +880,7 @@ st16:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof16;
|
||||
case 16:
|
||||
#line 879 "fieldExprScanner.cc"
|
||||
#line 884 "fieldExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 69: goto st5;
|
||||
case 101: goto st5;
|
||||
@ -926,7 +931,7 @@ st19:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof19;
|
||||
case 19:
|
||||
#line 930 "fieldExprScanner.cc"
|
||||
#line 935 "fieldExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr57;
|
||||
case 69: goto st5;
|
||||
@ -1163,7 +1168,7 @@ st23:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof23;
|
||||
case 23:
|
||||
#line 1167 "fieldExprScanner.cc"
|
||||
#line 1172 "fieldExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr67;
|
||||
case 95: goto tr67;
|
||||
@ -2929,7 +2934,7 @@ st120:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof120;
|
||||
case 120:
|
||||
#line 2933 "fieldExprScanner.cc"
|
||||
#line 2938 "fieldExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr67;
|
||||
case 58: goto st8;
|
||||
@ -3350,7 +3355,7 @@ case 10:
|
||||
_out: {}
|
||||
}
|
||||
|
||||
#line 530 "fieldExprScanner.rl"
|
||||
#line 535 "fieldExprScanner.rl"
|
||||
/* ^^^ FSM execution here ^^^ */;
|
||||
|
||||
if (0 == cs)
|
||||
@ -3367,6 +3372,11 @@ case 10:
|
||||
parser_->parse(0, nullptr);
|
||||
parser_->stop();
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
InfoErr<< "Done parse." << nl;
|
||||
}
|
||||
|
||||
// Restore debug value
|
||||
debug = oldDebug;
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ Description
|
||||
|
||||
// Debugging to stderr
|
||||
#undef DebugInfo
|
||||
#define DebugInfo if (debug) InfoErr
|
||||
#define DebugInfo if (debug & 0x2) InfoErr
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -155,7 +155,7 @@ static int driverTokenType
|
||||
|
||||
#define EMIT_TOKEN(T) \
|
||||
driver_.parsePosition() = (ts-buf); \
|
||||
DebugInfo<< STRINGIFY(T) << ": " << driver_.parsePosition() << nl; \
|
||||
DebugInfo<< STRINGIFY(T) << " at " << driver_.parsePosition() << nl; \
|
||||
parser_->parse(TOKEN_OF(T), nullptr); \
|
||||
driver_.parsePosition() = (p-buf);
|
||||
|
||||
@ -477,9 +477,14 @@ bool Foam::expressions::fieldExpr::scanner::process
|
||||
// Save debug value
|
||||
const int oldDebug = debug;
|
||||
|
||||
if (driver_.debugScanner())
|
||||
if (driver_.debugScanner()) { debug |= 0x2; }
|
||||
if (driver_.debugParser()) { debug |= 0x4; }
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
debug |= 4;
|
||||
InfoErr
|
||||
<< "Begin parse {"
|
||||
<< str.substr(strBeg, strLen).c_str() << '}' << nl;
|
||||
}
|
||||
|
||||
if (!parser_)
|
||||
@ -511,12 +516,12 @@ bool Foam::expressions::fieldExpr::scanner::process
|
||||
// Scan token type
|
||||
scanToken scanTok;
|
||||
|
||||
// Ragel token start/end (required naming)
|
||||
// Token start/end (Ragel naming)
|
||||
const char* ts;
|
||||
const char* te;
|
||||
|
||||
// Local buffer data.
|
||||
// - p, pe, eof are required Ragel naming
|
||||
// - p, pe, eof are Ragel naming
|
||||
// - buf is our own naming
|
||||
|
||||
const char* buf = &(str[strBeg]);
|
||||
@ -543,6 +548,11 @@ bool Foam::expressions::fieldExpr::scanner::process
|
||||
parser_->parse(0, nullptr);
|
||||
parser_->stop();
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
InfoErr<< "Done parse." << nl;
|
||||
}
|
||||
|
||||
// Restore debug value
|
||||
debug = oldDebug;
|
||||
|
||||
|
||||
@ -30,13 +30,12 @@ Description
|
||||
Driver for patch expressions
|
||||
|
||||
In addition to the standard mathematical functions, operations and
|
||||
logical and relational operations, the volume expression support the
|
||||
logical and relational operations, the patch expressions support the
|
||||
following driver-specific functions:
|
||||
|
||||
Functions
|
||||
\table
|
||||
Function | Description | Number of arguments |
|
||||
vol | The cell volumes | 0 |
|
||||
pos | The face centres | 0 |
|
||||
pts | The face points | 0 |
|
||||
area | The face area magnitudes | 0 |
|
||||
@ -49,6 +48,10 @@ Description
|
||||
rand | Random field | 0/1 |
|
||||
\endtable
|
||||
|
||||
Note
|
||||
Use namespace debug switch \c patchExpr for scanner (2), parser (4)
|
||||
or dictionary controls as per Foam::expressions::exprDriver.
|
||||
|
||||
SourceFiles
|
||||
patchExprDriver.C
|
||||
patchExprDriverFields.C
|
||||
@ -176,7 +179,8 @@ public:
|
||||
//- Perform parsing on (sub) string
|
||||
using genericRagelLemonDriver::content;
|
||||
|
||||
//- Execute the parser
|
||||
//- Execute the parser.
|
||||
// The return value currently has no meaning.
|
||||
virtual unsigned parse
|
||||
(
|
||||
const std::string& expr,
|
||||
|
||||
@ -527,7 +527,7 @@ void Foam::expressions::patchExpr::parser::start(parseDriver& driver_)
|
||||
this->stop();
|
||||
lemon_ = ParseAlloc(::operator new, &driver_);
|
||||
|
||||
if (debug || driver_.debugParser())
|
||||
if ((debug & 0x4) || driver_.debugParser())
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
ParseTrace(stderr, const_cast<char*>(prompt_));
|
||||
|
||||
@ -42,7 +42,7 @@ Description
|
||||
|
||||
// Debugging to stderr
|
||||
#undef DebugInfo
|
||||
#define DebugInfo if (debug) InfoErr
|
||||
#define DebugInfo if (debug & 0x2) InfoErr
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -281,7 +281,7 @@ static int driverTokenType
|
||||
|
||||
#define EMIT_TOKEN(T) \
|
||||
driver_.parsePosition() = (ts-buf); \
|
||||
DebugInfo<< STRINGIFY(T) << ": " << driver_.parsePosition() << nl; \
|
||||
DebugInfo<< STRINGIFY(T) << " at " << driver_.parsePosition() << nl; \
|
||||
parser_->parse(TOKEN_OF(T), nullptr); \
|
||||
driver_.parsePosition() = (p-buf);
|
||||
|
||||
@ -473,9 +473,14 @@ bool Foam::expressions::patchExpr::scanner::process
|
||||
// Save debug value
|
||||
const int oldDebug = debug;
|
||||
|
||||
if (driver_.debugScanner())
|
||||
if (driver_.debugScanner()) { debug |= 0x2; }
|
||||
if (driver_.debugParser()) { debug |= 0x4; }
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
debug |= 4;
|
||||
InfoErr
|
||||
<< "Begin parse {"
|
||||
<< str.substr(strBeg, strLen).c_str() << '}' << nl;
|
||||
}
|
||||
|
||||
if (!parser_)
|
||||
@ -507,12 +512,12 @@ bool Foam::expressions::patchExpr::scanner::process
|
||||
// Scan token type
|
||||
scanToken scanTok;
|
||||
|
||||
// Ragel token start/end (required naming)
|
||||
// Token start/end (Ragel naming)
|
||||
const char* ts;
|
||||
const char* te;
|
||||
|
||||
// Local buffer data.
|
||||
// - p, pe, eof are required Ragel naming
|
||||
// - p, pe, eof are Ragel naming
|
||||
// - buf is our own naming
|
||||
|
||||
const char* buf = &(str[strBeg]);
|
||||
@ -522,7 +527,7 @@ bool Foam::expressions::patchExpr::scanner::process
|
||||
|
||||
// Initialize FSM variables
|
||||
|
||||
#line 526 "patchExprScanner.cc"
|
||||
#line 531 "patchExprScanner.cc"
|
||||
{
|
||||
cs = patchExpr_start;
|
||||
ts = 0;
|
||||
@ -530,11 +535,11 @@ bool Foam::expressions::patchExpr::scanner::process
|
||||
act = 0;
|
||||
}
|
||||
|
||||
#line 654 "patchExprScanner.rl"
|
||||
#line 659 "patchExprScanner.rl"
|
||||
/* ^^^ FSM initialization here ^^^ */;
|
||||
|
||||
|
||||
#line 538 "patchExprScanner.cc"
|
||||
#line 543 "patchExprScanner.cc"
|
||||
{
|
||||
if ( p == pe )
|
||||
goto _test_eof;
|
||||
@ -881,7 +886,7 @@ st11:
|
||||
case 11:
|
||||
#line 1 "NONE"
|
||||
{ts = p;}
|
||||
#line 885 "patchExprScanner.cc"
|
||||
#line 890 "patchExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 32: goto st12;
|
||||
case 33: goto st13;
|
||||
@ -1009,7 +1014,7 @@ st16:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof16;
|
||||
case 16:
|
||||
#line 1013 "patchExprScanner.cc"
|
||||
#line 1018 "patchExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 69: goto st5;
|
||||
case 101: goto st5;
|
||||
@ -1060,7 +1065,7 @@ st19:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof19;
|
||||
case 19:
|
||||
#line 1064 "patchExprScanner.cc"
|
||||
#line 1069 "patchExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr58;
|
||||
case 69: goto st5;
|
||||
@ -1315,7 +1320,7 @@ st23:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof23;
|
||||
case 23:
|
||||
#line 1319 "patchExprScanner.cc"
|
||||
#line 1324 "patchExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr68;
|
||||
case 95: goto tr68;
|
||||
@ -3082,7 +3087,7 @@ st120:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof120;
|
||||
case 120:
|
||||
#line 3086 "patchExprScanner.cc"
|
||||
#line 3091 "patchExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr68;
|
||||
case 58: goto st8;
|
||||
@ -3824,7 +3829,7 @@ case 10:
|
||||
_out: {}
|
||||
}
|
||||
|
||||
#line 656 "patchExprScanner.rl"
|
||||
#line 661 "patchExprScanner.rl"
|
||||
/* ^^^ FSM execution here ^^^ */;
|
||||
|
||||
if (0 == cs)
|
||||
@ -3841,6 +3846,11 @@ case 10:
|
||||
parser_->parse(0, nullptr);
|
||||
parser_->stop();
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
InfoErr<< "Done parse." << nl;
|
||||
}
|
||||
|
||||
// Restore debug value
|
||||
debug = oldDebug;
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ Description
|
||||
|
||||
// Debugging to stderr
|
||||
#undef DebugInfo
|
||||
#define DebugInfo if (debug) InfoErr
|
||||
#define DebugInfo if (debug & 0x2) InfoErr
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -279,7 +279,7 @@ static int driverTokenType
|
||||
|
||||
#define EMIT_TOKEN(T) \
|
||||
driver_.parsePosition() = (ts-buf); \
|
||||
DebugInfo<< STRINGIFY(T) << ": " << driver_.parsePosition() << nl; \
|
||||
DebugInfo<< STRINGIFY(T) << " at " << driver_.parsePosition() << nl; \
|
||||
parser_->parse(TOKEN_OF(T), nullptr); \
|
||||
driver_.parsePosition() = (p-buf);
|
||||
|
||||
@ -603,9 +603,14 @@ bool Foam::expressions::patchExpr::scanner::process
|
||||
// Save debug value
|
||||
const int oldDebug = debug;
|
||||
|
||||
if (driver_.debugScanner())
|
||||
if (driver_.debugScanner()) { debug |= 0x2; }
|
||||
if (driver_.debugParser()) { debug |= 0x4; }
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
debug |= 4;
|
||||
InfoErr
|
||||
<< "Begin parse {"
|
||||
<< str.substr(strBeg, strLen).c_str() << '}' << nl;
|
||||
}
|
||||
|
||||
if (!parser_)
|
||||
@ -637,12 +642,12 @@ bool Foam::expressions::patchExpr::scanner::process
|
||||
// Scan token type
|
||||
scanToken scanTok;
|
||||
|
||||
// Ragel token start/end (required naming)
|
||||
// Token start/end (Ragel naming)
|
||||
const char* ts;
|
||||
const char* te;
|
||||
|
||||
// Local buffer data.
|
||||
// - p, pe, eof are required Ragel naming
|
||||
// - p, pe, eof are Ragel naming
|
||||
// - buf is our own naming
|
||||
|
||||
const char* buf = &(str[strBeg]);
|
||||
@ -669,6 +674,11 @@ bool Foam::expressions::patchExpr::scanner::process
|
||||
parser_->parse(0, nullptr);
|
||||
parser_->stop();
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
InfoErr<< "Done parse." << nl;
|
||||
}
|
||||
|
||||
// Restore debug value
|
||||
debug = oldDebug;
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ Description
|
||||
\endtable
|
||||
|
||||
In addition to the standard mathematical functions, operations and
|
||||
logical and relational operations, the volume expression support the
|
||||
logical and relational operations, the volume expressions support the
|
||||
following driver-specific functions:
|
||||
|
||||
Functions
|
||||
@ -70,6 +70,10 @@ Description
|
||||
pzone | Logical point field corresponding to pointZone| 1 |
|
||||
\endtable
|
||||
|
||||
Note
|
||||
Use namespace debug switch \c volumeExpr for scanner (2), parser (4)
|
||||
or dictionary controls as per Foam::expressions::exprDriver.
|
||||
|
||||
SourceFiles
|
||||
volumeExprDriver.C
|
||||
|
||||
@ -242,7 +246,8 @@ public:
|
||||
//- Perform parsing on (sub) string
|
||||
using genericRagelLemonDriver::content;
|
||||
|
||||
//- Execute the parser
|
||||
//- Execute the parser.
|
||||
// The return value currently has no meaning.
|
||||
virtual unsigned parse
|
||||
(
|
||||
const std::string& expr,
|
||||
|
||||
@ -790,7 +790,7 @@ void Foam::expressions::volumeExpr::parser::start(parseDriver& driver_)
|
||||
this->stop();
|
||||
lemon_ = ParseAlloc(::operator new, &driver_);
|
||||
|
||||
if (debug || driver_.debugParser())
|
||||
if ((debug & 0x4) || driver_.debugParser())
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
ParseTrace(stderr, const_cast<char*>(prompt_));
|
||||
|
||||
@ -42,7 +42,7 @@ Description
|
||||
|
||||
// Debugging to stderr
|
||||
#undef DebugInfo
|
||||
#define DebugInfo if (debug) InfoErr
|
||||
#define DebugInfo if (debug & 0x2) InfoErr
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -310,7 +310,7 @@ static int driverTokenType
|
||||
|
||||
#define EMIT_TOKEN(T) \
|
||||
driver_.parsePosition() = (ts-buf); \
|
||||
DebugInfo<< STRINGIFY(T) << ": " << driver_.parsePosition() << nl; \
|
||||
DebugInfo<< STRINGIFY(T) << " at " << driver_.parsePosition() << nl; \
|
||||
parser_->parse(TOKEN_OF(T), nullptr); \
|
||||
driver_.parsePosition() = (p-buf);
|
||||
|
||||
@ -502,9 +502,14 @@ bool Foam::expressions::volumeExpr::scanner::process
|
||||
// Save debug value
|
||||
const int oldDebug = debug;
|
||||
|
||||
if (driver_.debugScanner())
|
||||
if (driver_.debugScanner()) { debug |= 0x2; }
|
||||
if (driver_.debugParser()) { debug |= 0x4; }
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
debug |= 4;
|
||||
InfoErr
|
||||
<< "Begin parse {"
|
||||
<< str.substr(strBeg, strLen).c_str() << '}' << nl;
|
||||
}
|
||||
|
||||
if (!parser_)
|
||||
@ -536,12 +541,12 @@ bool Foam::expressions::volumeExpr::scanner::process
|
||||
// Scan token type
|
||||
scanToken scanTok;
|
||||
|
||||
// Ragel token start/end (required naming)
|
||||
// Token start/end (Ragel naming)
|
||||
const char* ts;
|
||||
const char* te;
|
||||
|
||||
// Local buffer data.
|
||||
// - p, pe, eof are required Ragel naming
|
||||
// - p, pe, eof are Ragel naming
|
||||
// - buf is our own naming
|
||||
|
||||
const char* buf = &(str[strBeg]);
|
||||
@ -551,7 +556,7 @@ bool Foam::expressions::volumeExpr::scanner::process
|
||||
|
||||
// Initialize FSM variables
|
||||
|
||||
#line 555 "volumeExprScanner.cc"
|
||||
#line 560 "volumeExprScanner.cc"
|
||||
{
|
||||
cs = volumeExpr_start;
|
||||
ts = 0;
|
||||
@ -559,11 +564,11 @@ bool Foam::expressions::volumeExpr::scanner::process
|
||||
act = 0;
|
||||
}
|
||||
|
||||
#line 683 "volumeExprScanner.rl"
|
||||
#line 688 "volumeExprScanner.rl"
|
||||
/* ^^^ FSM initialization here ^^^ */;
|
||||
|
||||
|
||||
#line 567 "volumeExprScanner.cc"
|
||||
#line 572 "volumeExprScanner.cc"
|
||||
{
|
||||
if ( p == pe )
|
||||
goto _test_eof;
|
||||
@ -910,7 +915,7 @@ st11:
|
||||
case 11:
|
||||
#line 1 "NONE"
|
||||
{ts = p;}
|
||||
#line 914 "volumeExprScanner.cc"
|
||||
#line 919 "volumeExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 32: goto st12;
|
||||
case 33: goto st13;
|
||||
@ -1038,7 +1043,7 @@ st16:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof16;
|
||||
case 16:
|
||||
#line 1042 "volumeExprScanner.cc"
|
||||
#line 1047 "volumeExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 69: goto st5;
|
||||
case 101: goto st5;
|
||||
@ -1089,7 +1094,7 @@ st19:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof19;
|
||||
case 19:
|
||||
#line 1093 "volumeExprScanner.cc"
|
||||
#line 1098 "volumeExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr58;
|
||||
case 69: goto st5;
|
||||
@ -1344,7 +1349,7 @@ st23:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof23;
|
||||
case 23:
|
||||
#line 1348 "volumeExprScanner.cc"
|
||||
#line 1353 "volumeExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr68;
|
||||
case 95: goto tr68;
|
||||
@ -3111,7 +3116,7 @@ st120:
|
||||
if ( ++p == pe )
|
||||
goto _test_eof120;
|
||||
case 120:
|
||||
#line 3115 "volumeExprScanner.cc"
|
||||
#line 3120 "volumeExprScanner.cc"
|
||||
switch( (*p) ) {
|
||||
case 46: goto tr68;
|
||||
case 58: goto st8;
|
||||
@ -3853,7 +3858,7 @@ case 10:
|
||||
_out: {}
|
||||
}
|
||||
|
||||
#line 685 "volumeExprScanner.rl"
|
||||
#line 690 "volumeExprScanner.rl"
|
||||
/* ^^^ FSM execution here ^^^ */;
|
||||
|
||||
if (0 == cs)
|
||||
@ -3870,6 +3875,11 @@ case 10:
|
||||
parser_->parse(0, nullptr);
|
||||
parser_->stop();
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
InfoErr<< "Done parse." << nl;
|
||||
}
|
||||
|
||||
// Restore debug value
|
||||
debug = oldDebug;
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ Description
|
||||
|
||||
// Debugging to stderr
|
||||
#undef DebugInfo
|
||||
#define DebugInfo if (debug) InfoErr
|
||||
#define DebugInfo if (debug & 0x2) InfoErr
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -308,7 +308,7 @@ static int driverTokenType
|
||||
|
||||
#define EMIT_TOKEN(T) \
|
||||
driver_.parsePosition() = (ts-buf); \
|
||||
DebugInfo<< STRINGIFY(T) << ": " << driver_.parsePosition() << nl; \
|
||||
DebugInfo<< STRINGIFY(T) << " at " << driver_.parsePosition() << nl; \
|
||||
parser_->parse(TOKEN_OF(T), nullptr); \
|
||||
driver_.parsePosition() = (p-buf);
|
||||
|
||||
@ -632,9 +632,14 @@ bool Foam::expressions::volumeExpr::scanner::process
|
||||
// Save debug value
|
||||
const int oldDebug = debug;
|
||||
|
||||
if (driver_.debugScanner())
|
||||
if (driver_.debugScanner()) { debug |= 0x2; }
|
||||
if (driver_.debugParser()) { debug |= 0x4; }
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
debug |= 4;
|
||||
InfoErr
|
||||
<< "Begin parse {"
|
||||
<< str.substr(strBeg, strLen).c_str() << '}' << nl;
|
||||
}
|
||||
|
||||
if (!parser_)
|
||||
@ -666,12 +671,12 @@ bool Foam::expressions::volumeExpr::scanner::process
|
||||
// Scan token type
|
||||
scanToken scanTok;
|
||||
|
||||
// Ragel token start/end (required naming)
|
||||
// Token start/end (Ragel naming)
|
||||
const char* ts;
|
||||
const char* te;
|
||||
|
||||
// Local buffer data.
|
||||
// - p, pe, eof are required Ragel naming
|
||||
// - p, pe, eof are Ragel naming
|
||||
// - buf is our own naming
|
||||
|
||||
const char* buf = &(str[strBeg]);
|
||||
@ -698,6 +703,11 @@ bool Foam::expressions::volumeExpr::scanner::process
|
||||
parser_->parse(0, nullptr);
|
||||
parser_->stop();
|
||||
|
||||
if (debug & 0x6)
|
||||
{
|
||||
InfoErr<< "Done parse." << nl;
|
||||
}
|
||||
|
||||
// Restore debug value
|
||||
debug = oldDebug;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user