The ConstExpressionParser
Class Reference
constant expression parser used for the C preprocessor More...
Declaration
class ConstExpressionParser { ... }
Included Headers
#include <src/constexp.h>
Public Constructors Index
ConstExpressionParser () | |
Public Destructor Index
~ConstExpressionParser () | |
Public Member Functions Index
bool | parse (const char *fileName, int line, const std::string &expression, const std::string &orgExpression) |
Private Member Attributes Index
std::unique_ptr< Private > | p |
Description
constant expression parser used for the C preprocessor
Definition at line 25 of file constexp.h.
Public Constructors
ConstExpressionParser()
|
Declaration at line 28 of file constexp.h, definition at line 129 of file constexp.l.
Reference p.
Public Destructor
~ConstExpressionParser()
|
Declaration at line 29 of file constexp.h, definition at line 134 of file constexp.l.
Reference p.
Public Member Functions
parse()
|
Declaration at line 31 of file constexp.h, definition at line 139 of file constexp.l.
139bool ConstExpressionParser::parse(const char *fileName,int lineNr,const std::string &s, const std::string &orgStr)
140{
141 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
142
143#ifdef FLEX_DEBUG
144 constexpYYset_debug(Debug::isFlagSet(Debug::Lex_constexp)?1:0,p->yyscanner);
145#endif
146
147 yyextra->constExpFileName = fileName;
148 yyextra->constExpLineNr = lineNr;
149 yyextra->orgString = orgStr;
150 yyextra->inputString = s;
151 yyextra->inputPosition = 0;
152 constexpYYrestart( yyin, p->yyscanner );
153
154 DebugLex debugLex(Debug::Lex_constexp, __FILE__, fileName);
155 //printf("Expression: '%s'\n",qPrint(s));
156
157 constexpYYparse(p->yyscanner);
158
159 //printf("Result: %ld\n",(long)g_resultValue);
160 bool result = static_cast<long>(yyextra->resultValue)!=0;
161
162 return result;
163}
References constexpYYparse, Debug::isFlagSet, Debug::Lex_constexp and p.
Private Member Attributes
p
|
Definition at line 34 of file constexp.h.
Referenced by ConstExpressionParser, parse and ~ConstExpressionParser.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus by Doxygen 1.14.0.