15 #ifndef COPASI_CEvaluationLexer
16 #define COPASI_CEvaluationLexer
23 #define yyFlexLexer CEvaluationLexer
26 #define yyYaccParser CEvaluationParserBase
30 # define YYDEBUG 0 // Set his different from zero to trace the parser
33 #endif // COPASI_DEBUG
73 static void freeNodeList(std::vector< CEvaluationNode * > * pNodeList)
75 if (pNodeList == NULL)
return;
77 std::vector< CEvaluationNode * >::iterator it;
78 std::vector< CEvaluationNode * >::iterator end = pNodeList->end();
80 for (it = pNodeList->begin(); it != end; ++it)
81 if (*it && (*it)->getParent())
82 (*it)->getParent()->removeChild(*it);
84 for (it = pNodeList->begin(); it != end; ++it)
90 virtual int yylex() = 0;
110 std::vector< CEvaluationNode * >::iterator it
111 = mpNodeList->begin();
112 std::vector< CEvaluationNode * >::iterator end
114 size_t oldPosition = mPosition;
117 for (; it != end && mPosition < oldPosition; ++it)
118 mPosition += (*it)->getData().length();
121 mPosition -= (*--it)->getData().length();
147 virtual size_t LexerInput(
char* buf,
size_t max_size);
148 virtual void LexerOutput(
const char* buf,
size_t size);
151 void yyunput(
int c,
char* buf_ptr);
220 #endif // COPASI_CEvaluationLexer
void yyensure_buffer_stack(void)
size_t getErrorPosition()
virtual void LexerError(const char *msg)
void yy_init_buffer(struct yy_buffer_state *b, std::istream *s)
CEvaluationNode * mpRootNode
virtual void switch_streams(FLEX_STD istream *new_in, FLEX_STD ostream *new_out)
void yy_load_buffer_state()
void yy_switch_to_buffer(struct yy_buffer_state *new_buffer)
void correctErrorPosition()
virtual void LexerOutput(const char *buf, size_t size)
yy_state_type * yy_state_buf
void yy_flush_buffer(struct yy_buffer_state *b)
int yy_did_buffer_switch_on_eof
void yypush_buffer_state(struct yy_buffer_state *new_buffer)
struct yy_buffer_state * yy_current_buffer
virtual size_t LexerInput(char *buf, size_t max_size)
void yyrestart(FLEX_STD istream *s)
yy_state_type yy_get_previous_state()
CEvaluationNode * getRootNode()
size_t yy_buffer_stack_max
yy_state_type * yy_state_ptr
struct yy_buffer_state * yy_create_buffer(FLEX_STD istream *s, int size)
void yy_delete_buffer(struct yy_buffer_state *b)
void yypop_buffer_state(void)
std::vector< CEvaluationNode * > * mpNodeList
char * yy_last_accepting_cpos
struct yy_buffer_state ** yy_buffer_stack
static void freeNodeList(std::vector< CEvaluationNode * > *pNodeList)
size_t yy_buffer_stack_top
void yy_push_state(int new_state)
yy_state_type yy_last_accepting_state
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
int yy_looking_for_trail_begin
std::vector< CEvaluationNode * > * getNodeList()
void yyunput(int c, char *buf_ptr)