COPASI API  4.16.103
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CChemEqParser Class Reference

#include <CChemEqParser.h>

Inheritance diagram for CChemEqParser:
Inheritance graph
[legend]
Collaboration diagram for CChemEqParser:
Collaboration graph
[legend]

Public Member Functions

 CChemEqParser (std::istream *arg_yyin=0, std::ostream *arg_yyout=0)
 
virtual void switch_streams (std::istream *new_in, std::ostream *new_out)
 
struct yy_buffer_stateyy_create_buffer (std::istream *s, int size)
 
void yy_delete_buffer (struct yy_buffer_state *b)
 
void yy_switch_to_buffer (struct yy_buffer_state *new_buffer)
 
virtual int yylex ()
 
void yypop_buffer_state (void)
 
void yypush_buffer_state (struct yy_buffer_state *new_buffer)
 
void yyrestart (std::istream *s)
 
virtual int yywrap ()
 
virtual ~CChemEqParser ()
 
- Public Member Functions inherited from FlexLexer
int debug () const
 
int lineno () const
 
void set_debug (int flag)
 
int YYLeng () const
 
int yylex (std::istream *new_in, std::ostream *new_out=0)
 
const char * YYText () const
 
virtual ~FlexLexer ()
 
- Public Member Functions inherited from CChemEqParserBase
 CChemEqParserBase ()
 
const std::vector< std::string > & getModifierCompartments () const
 
const std::vector< C_FLOAT64 > & getModifierMulitplicities () const
 
const std::vector< std::string > & getModifierNames () const
 
const std::vector< std::string > & getProductCompartments () const
 
const std::vector< C_FLOAT64 > & getProductMulitplicities () const
 
const std::vector< std::string > & getProductNames () const
 
const std::vector< std::string > & getSubstrateCompartments () const
 
const std::vector< C_FLOAT64 > & getSubstrateMulitplicities () const
 
const std::vector< std::string > & getSubstrateNames () const
 
const bool & isReversible () const
 
virtual int yyparse ()
 
virtual ~CChemEqParserBase ()
 

Protected Member Functions

virtual void LexerError (const char *msg)
 
virtual int LexerInput (char *buf, int max_size)
 
virtual void LexerOutput (const char *buf, int size)
 
void yy_flush_buffer (struct yy_buffer_state *b)
 
int yy_get_next_buffer ()
 
yy_state_type yy_get_previous_state ()
 
void yy_init_buffer (struct yy_buffer_state *b, std::istream *s)
 
void yy_load_buffer_state ()
 
void yy_pop_state ()
 
void yy_push_state (int new_state)
 
int yy_top_state ()
 
yy_state_type yy_try_NUL_trans (yy_state_type current_state)
 
void yyensure_buffer_stack (void)
 
int yyinput ()
 
void yyunput (int c, char *buf_ptr)
 
- Protected Member Functions inherited from CChemEqParserBase
void correctErrorPosition ()
 

Protected Attributes

struct yy_buffer_state ** yy_buffer_stack
 
size_t yy_buffer_stack_max
 
size_t yy_buffer_stack_top
 
char * yy_c_buf_p
 
struct yy_buffer_stateyy_current_buffer
 
int yy_did_buffer_switch_on_eof
 
int yy_full_lp
 
char * yy_full_match
 
int * yy_full_state
 
char yy_hold_char
 
int yy_init
 
char * yy_last_accepting_cpos
 
yy_state_type yy_last_accepting_state
 
int yy_looking_for_trail_begin
 
int yy_lp
 
int yy_more_flag
 
int yy_more_len
 
int yy_more_offset
 
int yy_n_chars
 
int yy_prev_more_offset
 
int yy_start
 
int * yy_start_stack
 
int yy_start_stack_depth
 
int yy_start_stack_ptr
 
yy_state_typeyy_state_buf
 
yy_state_typeyy_state_ptr
 
std::istream * yyin
 
std::ostream * yyout
 
- Protected Attributes inherited from FlexLexer
int yy_flex_debug
 
int yyleng
 
int yylineno
 
char * yytext
 
- Protected Attributes inherited from CChemEqParserBase
std::vector< std::string > mModifierCompartments
 
std::vector< C_FLOAT64mModifierMult
 
std::vector< std::string > mModifierNames
 
DatampData
 
unsigned C_INT32 mPosition
 
std::vector< std::string > mProductCompartments
 
std::vector< C_FLOAT64mProductMult
 
std::vector< std::string > mProductNames
 
bool mReversibility
 
std::vector< std::string > mSubstrateCompartments
 
std::vector< C_FLOAT64mSubstrateMult
 
std::vector< std::string > mSubstrateNames
 

Detailed Description

Definition at line 110 of file CChemEqParser.h.

Constructor & Destructor Documentation

CChemEqParser::CChemEqParser ( std::istream *  arg_yyin = 0,
std::ostream *  arg_yyout = 0 
)

Definition at line 924 of file CChemEqParser_lex.cpp.

References yyFlexLexer::yy_buffer_stack, yyFlexLexer::yy_buffer_stack_max, yyFlexLexer::yy_buffer_stack_top, yyFlexLexer::yy_c_buf_p, yyFlexLexer::yy_did_buffer_switch_on_eof, FlexLexer::yy_flex_debug, yyFlexLexer::yy_init, yyFlexLexer::yy_looking_for_trail_begin, yyFlexLexer::yy_more_flag, yyFlexLexer::yy_more_len, yyFlexLexer::yy_more_offset, yyFlexLexer::yy_prev_more_offset, yyFlexLexer::yy_start, yyFlexLexer::yy_start_stack, yyFlexLexer::yy_start_stack_depth, yyFlexLexer::yy_start_stack_ptr, yyFlexLexer::yy_state_buf, yyFlexLexer::yyin, FlexLexer::yylineno, and yyFlexLexer::yyout.

925 {
926  yyin = arg_yyin;
927  yyout = arg_yyout;
928  yy_c_buf_p = 0;
929  yy_init = 0;
930  yy_start = 0;
931  yy_flex_debug = 0;
932  yylineno = 1; // this will only get updated if %option yylineno
933 
935 
937  yy_more_flag = 0;
938  yy_more_len = 0;
940 
942  yy_start_stack = NULL;
943 
944  yy_buffer_stack = 0;
947 
948  yy_state_buf = 0;
949 }
int yy_flex_debug
Definition: FlexLexer.h:113
size_t yy_buffer_stack_max
std::ostream * yyout
size_t yy_buffer_stack_top
int yy_start_stack_depth
int yylineno
Definition: FlexLexer.h:112
int * yy_start_stack
struct yy_buffer_state ** yy_buffer_stack
std::istream * yyin
int yy_did_buffer_switch_on_eof
int yy_looking_for_trail_begin
yy_state_type * yy_state_buf
CChemEqParser::~CChemEqParser ( )
virtual

Definition at line 953 of file CChemEqParser_lex.cpp.

References CChemEqParserfree(), yyFlexLexer::yy_buffer_stack, YY_CURRENT_BUFFER, yyFlexLexer::yy_delete_buffer(), yyFlexLexer::yy_start_stack, and yyFlexLexer::yy_state_buf.

954 {
955  delete [] yy_state_buf;
959 }
void CChemEqParserfree(void *)
#define YY_CURRENT_BUFFER
int * yy_start_stack
struct yy_buffer_state ** yy_buffer_stack
void yy_delete_buffer(struct yy_buffer_state *b)
yy_state_type * yy_state_buf

Member Function Documentation

void CChemEqParser::LexerError ( const char *  msg)
protectedvirtual

Definition at line 1640 of file CChemEqParser_lex.cpp.

References YY_EXIT_FAILURE.

1641 {
1642  std::cerr << msg << std::endl;
1643  exit(YY_EXIT_FAILURE);
1644 }
#define YY_EXIT_FAILURE
int CChemEqParser::LexerInput ( char *  buf,
int  max_size 
)
protectedvirtual

Definition at line 978 of file CChemEqParser_lex.cpp.

References void().

980 {
981  if (yyin->eof() || yyin->fail())
982  return 0;
983 
984 #ifdef YY_INTERACTIVE
985  yyin->get(buf[0]);
986 
987  if (yyin->eof())
988  return 0;
989 
990  if (yyin->bad())
991  return -1;
992 
993  return 1;
994 
995 #else
996  (void) yyin->read(buf, max_size);
997 
998  if (yyin->bad())
999  return -1;
1000  else
1001  return yyin->gcount();
1002 
1003 #endif
1004 }
std::istream * yyin
() void(yyvaluep))
void CChemEqParser::LexerOutput ( const char *  buf,
int  size 
)
protectedvirtual

Definition at line 1006 of file CChemEqParser_lex.cpp.

References void(), and yyFlexLexer::yyout.

1007 {
1008  (void) yyout->write(buf, size);
1009 }
std::ostream * yyout
() void(yyvaluep))
void CChemEqParser::switch_streams ( std::istream *  new_in,
std::ostream *  new_out 
)
virtual

Implements FlexLexer.

Definition at line 963 of file CChemEqParser_lex.cpp.

References YY_BUF_SIZE, yyFlexLexer::yy_create_buffer(), YY_CURRENT_BUFFER, yyFlexLexer::yy_delete_buffer(), yyFlexLexer::yy_switch_to_buffer(), and yyFlexLexer::yyout.

964 {
965  if (new_in)
966  {
969  }
970 
971  if (new_out)
972  yyout = new_out;
973 }
std::ostream * yyout
struct yy_buffer_state * yy_create_buffer(std::istream *s, int size)
#define YY_CURRENT_BUFFER
void yy_delete_buffer(struct yy_buffer_state *b)
void yy_switch_to_buffer(struct yy_buffer_state *new_buffer)
#define YY_BUF_SIZE
YY_BUFFER_STATE CChemEqParser::yy_create_buffer ( std::istream *  file,
int  size 
)
virtual

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
Returns
the allocated buffer state.

Implements FlexLexer.

Definition at line 1394 of file CChemEqParser_lex.cpp.

References CChemEqParseralloc(), yy_buffer_state::yy_buf_size, yy_buffer_state::yy_ch_buf, YY_FATAL_ERROR, yyFlexLexer::yy_init_buffer(), and yy_buffer_state::yy_is_our_buffer.

1395 {
1396  YY_BUFFER_STATE b;
1397 
1398  b = (YY_BUFFER_STATE) CChemEqParseralloc(sizeof(struct yy_buffer_state));
1399 
1400  if (! b)
1401  YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1402 
1403  b->yy_buf_size = size;
1404 
1405  /* yy_ch_buf has to be 2 characters longer than the size given because
1406  * we need to put in 2 end-of-buffer characters.
1407  */
1408  b->yy_ch_buf = (char *) CChemEqParseralloc(b->yy_buf_size + 2);
1409 
1410  if (! b->yy_ch_buf)
1411  YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1412 
1413  b->yy_is_our_buffer = 1;
1414 
1415  yy_init_buffer(b, file);
1416 
1417  return b;
1418 }
struct yy_buffer_state * YY_BUFFER_STATE
void * CChemEqParseralloc(yy_size_t)
void yy_init_buffer(struct yy_buffer_state *b, std::istream *s)
#define YY_FATAL_ERROR(msg)
void CChemEqParser::yy_delete_buffer ( struct yy_buffer_state b)
virtual

Destroy the buffer.

Parameters
ba buffer created with yy_create_buffer()

Implements FlexLexer.

Definition at line 1424 of file CChemEqParser_lex.cpp.

References CChemEqParserfree(), yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yy_buffer_state::yy_is_our_buffer.

1425 {
1426 
1427  if (! b)
1428  return;
1429 
1430  if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
1432 
1433  if (b->yy_is_our_buffer)
1434  CChemEqParserfree((void *) b->yy_ch_buf);
1435 
1436  CChemEqParserfree((void *) b);
1437 }
struct yy_buffer_state * YY_BUFFER_STATE
void CChemEqParserfree(void *)
#define YY_CURRENT_BUFFER
#define YY_CURRENT_BUFFER_LVALUE
void CChemEqParser::yy_flush_buffer ( struct yy_buffer_state b)
protected

Discard all buffered characters. On the next scan, YY_INPUT will be called.

Parameters
bthe buffer state to be flushed, usually YY_CURRENT_BUFFER.

Definition at line 1471 of file CChemEqParser_lex.cpp.

References yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, yyFlexLexer::yy_load_buffer_state(), and yy_buffer_state::yy_n_chars.

1472 {
1473  if (! b)
1474  return;
1475 
1476  b->yy_n_chars = 0;
1477 
1478  /* We always need two end-of-buffer characters. The first causes
1479  * a transition to the end-of-buffer state. The second causes
1480  * a jam in that state.
1481  */
1484 
1485  b->yy_buf_pos = &b->yy_ch_buf[0];
1486 
1487  b->yy_at_bol = 1;
1489 
1490  if (b == YY_CURRENT_BUFFER)
1492 }
#define YY_BUFFER_NEW
#define YY_CURRENT_BUFFER
#define YY_END_OF_BUFFER_CHAR
int CChemEqParser::yy_get_next_buffer ( )
protected

Definition at line 1018 of file CChemEqParser_lex.cpp.

References CChemEqParserrealloc(), EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yy_buffer_state::yy_buf_size, YY_BUFFER_EOF_PENDING, yyFlexLexer::yy_c_buf_p, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, YY_INPUT, yy_buffer_state::yy_is_our_buffer, YY_MORE_ADJ, yyFlexLexer::yy_n_chars, YY_READ_BUF_SIZE, yyFlexLexer::yyin, yyFlexLexer::yyrestart(), and yytext_ptr.

1019 {
1020  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1021  register char *source = (yytext_ptr);
1022  register int number_to_move, i;
1023  int ret_val;
1024 
1025  if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
1027  "fatal flex scanner internal error--end of buffer missed");
1028 
1029  if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0)
1030  {
1031  /* Don't try to fill the buffer, so this is an EOF. */
1032  if ((yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1)
1033  {
1034  /* We matched a single character, the EOB, so
1035  * treat this as a final EOF.
1036  */
1037  return EOB_ACT_END_OF_FILE;
1038  }
1039 
1040  else
1041  {
1042  /* We matched some text prior to the EOB, first
1043  * process it.
1044  */
1045  return EOB_ACT_LAST_MATCH;
1046  }
1047  }
1048 
1049  /* Try to read more data. */
1050 
1051  /* First move last chars to start of buffer. */
1052  number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)) - 1;
1053 
1054  for (i = 0; i < number_to_move; ++i)
1055  *(dest++) = *(source++);
1056 
1057  if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
1058  /* don't do the read, it's not guaranteed to return an EOF,
1059  * just force an EOF
1060  */
1061  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1062 
1063  else
1064  {
1065  int num_to_read =
1066  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1067 
1068  while (num_to_read <= 0)
1069  {
1070  /* Not enough room in the buffer - grow it. */
1071 
1072  /* just a shorter name for the current buffer */
1074 
1075  int yy_c_buf_p_offset =
1076  (int)((yy_c_buf_p) - b->yy_ch_buf);
1077 
1078  if (b->yy_is_our_buffer)
1079  {
1080  int new_size = b->yy_buf_size * 2;
1081 
1082  if (new_size <= 0)
1083  b->yy_buf_size += b->yy_buf_size / 8;
1084  else
1085  b->yy_buf_size *= 2;
1086 
1087  b->yy_ch_buf = (char *)
1088  /* Include room in for 2 EOB chars. */
1089  CChemEqParserrealloc((void *) b->yy_ch_buf, b->yy_buf_size + 2);
1090  }
1091  else
1092  /* Can't grow it, we don't own it. */
1093  b->yy_ch_buf = 0;
1094 
1095  if (! b->yy_ch_buf)
1097  "fatal error - scanner input buffer overflow");
1098 
1099  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1100 
1101  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1102  number_to_move - 1;
1103  }
1104 
1105  if (num_to_read > YY_READ_BUF_SIZE)
1106  num_to_read = YY_READ_BUF_SIZE;
1107 
1108  /* Read in more data. */
1109  YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1110  (yy_n_chars), (size_t) num_to_read);
1111 
1112  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1113  }
1114 
1115  if ((yy_n_chars) == 0)
1116  {
1117  if (number_to_move == YY_MORE_ADJ)
1118  {
1119  ret_val = EOB_ACT_END_OF_FILE;
1120  yyrestart(yyin);
1121  }
1122 
1123  else
1124  {
1125  ret_val = EOB_ACT_LAST_MATCH;
1126  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1128  }
1129  }
1130 
1131  else
1132  ret_val = EOB_ACT_CONTINUE_SCAN;
1133 
1134  if ((yy_size_t)((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size)
1135  {
1136  /* Extend the array by 50%, plus the number we really need. */
1137  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1138  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) CChemEqParserrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size);
1139 
1140  if (! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1141  YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1142  }
1143 
1144  (yy_n_chars) += number_to_move;
1147 
1148  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1149 
1150  return ret_val;
1151 }
#define EOB_ACT_LAST_MATCH
size_t yy_size_t
#define EOB_ACT_CONTINUE_SCAN
#define YY_CURRENT_BUFFER
#define YY_FATAL_ERROR(msg)
#define yytext_ptr
#define YY_MORE_ADJ
void yyrestart(std::istream *s)
#define YY_END_OF_BUFFER_CHAR
std::istream * yyin
#define EOB_ACT_END_OF_FILE
void * CChemEqParserrealloc(void *, yy_size_t)
#define YY_CURRENT_BUFFER_LVALUE
#define YY_BUFFER_EOF_PENDING
#define YY_READ_BUF_SIZE
#define YY_INPUT(buf, result, max_size)
yy_state_type CChemEqParser::yy_get_previous_state ( )
protected

Definition at line 1155 of file CChemEqParser_lex.cpp.

References yy_accept, yy_base, yyFlexLexer::yy_c_buf_p, yy_chk, yy_def, yy_ec, yyFlexLexer::yy_last_accepting_cpos, yyFlexLexer::yy_last_accepting_state, yy_meta, YY_MORE_ADJ, yy_nxt, YY_SC_TO_UI, yyFlexLexer::yy_start, and yytext_ptr.

1156 {
1157  register yy_state_type yy_current_state;
1158  register char *yy_cp;
1159 
1160  yy_current_state = (yy_start);
1161 
1162  for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp)
1163  {
1164  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1165 
1166  if (yy_accept[yy_current_state])
1167  {
1168  (yy_last_accepting_state) = yy_current_state;
1169  (yy_last_accepting_cpos) = yy_cp;
1170  }
1171 
1172  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
1173  {
1174  yy_current_state = (int) yy_def[yy_current_state];
1175 
1176  if (yy_current_state >= 32)
1177  yy_c = yy_meta[(unsigned int) yy_c];
1178  }
1179 
1180  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1181  }
1182 
1183  return yy_current_state;
1184 }
static flex_int32_t yy_ec[256]
static flex_int16_t yy_accept[32]
#define YY_SC_TO_UI(c)
yy_state_type yy_last_accepting_state
unsigned char YY_CHAR
#define yytext_ptr
#define YY_MORE_ADJ
static flex_int16_t yy_def[35]
static flex_int16_t yy_nxt[83]
int yy_state_type
Definition: FlexLexer.h:72
char * yy_last_accepting_cpos
static flex_int16_t yy_base[35]
static flex_int32_t yy_meta[19]
static flex_int16_t yy_chk[83]
void CChemEqParser::yy_init_buffer ( struct yy_buffer_state b,
std::istream *  s 
)
protected

Definition at line 1443 of file CChemEqParser_lex.cpp.

References yy_buffer_state::yy_bs_column, yy_buffer_state::yy_bs_lineno, YY_CURRENT_BUFFER, yy_buffer_state::yy_fill_buffer, yyFlexLexer::yy_flush_buffer(), yy_buffer_state::yy_input_file, and yy_buffer_state::yy_is_interactive.

1445 {
1446  int oerrno = errno;
1447 
1448  yy_flush_buffer(b);
1449 
1450  b->yy_input_file = file;
1451  b->yy_fill_buffer = 1;
1452 
1453  /* If b is the current buffer, then yy_init_buffer was _probably_
1454  * called from yyrestart() or through yy_get_next_buffer.
1455  * In that case, we don't want to reset the lineno or column.
1456  */
1457  if (b != YY_CURRENT_BUFFER)
1458  {
1459  b->yy_bs_lineno = 1;
1460  b->yy_bs_column = 0;
1461  }
1462 
1463  b->yy_is_interactive = 0;
1464  errno = oerrno;
1465 }
#define YY_CURRENT_BUFFER
std::istream * yy_input_file
void yy_flush_buffer(struct yy_buffer_state *b)
void CChemEqParser::yy_load_buffer_state ( )
protected

Definition at line 1380 of file CChemEqParser_lex.cpp.

References yyFlexLexer::yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yyFlexLexer::yy_hold_char, yyFlexLexer::yy_n_chars, yyFlexLexer::yyin, and yytext_ptr.

1381 {
1382  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1383  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1384  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1385  (yy_hold_char) = *(yy_c_buf_p);
1386 }
#define yytext_ptr
std::istream * yyin
#define YY_CURRENT_BUFFER_LVALUE
void CChemEqParser::yy_pop_state ( )
protected

Definition at line 1623 of file CChemEqParser_lex.cpp.

References BEGIN, YY_FATAL_ERROR, yyFlexLexer::yy_start_stack, and yyFlexLexer::yy_start_stack_ptr.

1624 {
1625  if (--(yy_start_stack_ptr) < 0)
1626  YY_FATAL_ERROR("start-condition stack underflow");
1627 
1629 }
#define YY_FATAL_ERROR(msg)
int * yy_start_stack
#define BEGIN
void CChemEqParser::yy_push_state ( int  new_state)
protected

Definition at line 1599 of file CChemEqParser_lex.cpp.

References BEGIN, CChemEqParseralloc(), CChemEqParserrealloc(), YY_FATAL_ERROR, YY_START, yyFlexLexer::yy_start_stack, yyFlexLexer::yy_start_stack_depth, YY_START_STACK_INCR, and yyFlexLexer::yy_start_stack_ptr.

1600 {
1602  {
1603  yy_size_t new_size;
1604 
1606  new_size = (yy_start_stack_depth) * sizeof(int);
1607 
1608  if (!(yy_start_stack))
1609  (yy_start_stack) = (int *) CChemEqParseralloc(new_size);
1610 
1611  else
1612  (yy_start_stack) = (int *) CChemEqParserrealloc((void *)(yy_start_stack), new_size);
1613 
1614  if (!(yy_start_stack))
1615  YY_FATAL_ERROR("out of memory expanding start-condition stack");
1616  }
1617 
1619 
1620  BEGIN(new_state);
1621 }
void * CChemEqParseralloc(yy_size_t)
size_t yy_size_t
#define YY_START_STACK_INCR
#define YY_FATAL_ERROR(msg)
int yy_start_stack_depth
int * yy_start_stack
#define BEGIN
void * CChemEqParserrealloc(void *, yy_size_t)
#define YY_START
void CChemEqParser::yy_switch_to_buffer ( struct yy_buffer_state new_buffer)
virtual

Switch to a different input buffer.

Parameters
new_bufferThe new input buffer.

Implements FlexLexer.

Definition at line 1348 of file CChemEqParser_lex.cpp.

References yyFlexLexer::yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyFlexLexer::yy_did_buffer_switch_on_eof, yyFlexLexer::yy_hold_char, yyFlexLexer::yy_load_buffer_state(), yyFlexLexer::yy_n_chars, and yyFlexLexer::yyensure_buffer_stack().

1349 {
1350 
1351  /* TODO. We should be able to replace this entire function body
1352  * with
1353  * yypop_buffer_state();
1354  * yypush_buffer_state(new_buffer);
1355  */
1357 
1358  if (YY_CURRENT_BUFFER == new_buffer)
1359  return;
1360 
1361  if (YY_CURRENT_BUFFER)
1362  {
1363  /* Flush out information for old buffer. */
1364  *(yy_c_buf_p) = (yy_hold_char);
1365  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1366  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1367  }
1368 
1369  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1371 
1372  /* We don't actually know whether we did this switch during
1373  * EOF (yywrap()) processing, but the only time this flag
1374  * is looked at is after yywrap() is called, so it's safe
1375  * to go ahead and always set it.
1376  */
1378 }
#define YY_CURRENT_BUFFER
void yyensure_buffer_stack(void)
#define YY_CURRENT_BUFFER_LVALUE
int yy_did_buffer_switch_on_eof
int CChemEqParser::yy_top_state ( )
protected

Definition at line 1631 of file CChemEqParser_lex.cpp.

References yyFlexLexer::yy_start_stack, and yyFlexLexer::yy_start_stack_ptr.

1632 {
1633  return (yy_start_stack)[(yy_start_stack_ptr) - 1];
1634 }
int * yy_start_stack
yy_state_type CChemEqParser::yy_try_NUL_trans ( yy_state_type  current_state)
protected

Definition at line 1191 of file CChemEqParser_lex.cpp.

References yy_accept, yy_base, yyFlexLexer::yy_c_buf_p, yy_chk, yy_def, yyFlexLexer::yy_last_accepting_cpos, yyFlexLexer::yy_last_accepting_state, yy_meta, and yy_nxt.

1192 {
1193  register int yy_is_jam;
1194  register char *yy_cp = (yy_c_buf_p);
1195 
1196  register YY_CHAR yy_c = 1;
1197 
1198  if (yy_accept[yy_current_state])
1199  {
1200  (yy_last_accepting_state) = yy_current_state;
1201  (yy_last_accepting_cpos) = yy_cp;
1202  }
1203 
1204  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
1205  {
1206  yy_current_state = (int) yy_def[yy_current_state];
1207 
1208  if (yy_current_state >= 32)
1209  yy_c = yy_meta[(unsigned int) yy_c];
1210  }
1211 
1212  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1213  yy_is_jam = (yy_current_state == 31);
1214 
1215  return yy_is_jam ? 0 : yy_current_state;
1216 }
static flex_int16_t yy_accept[32]
yy_state_type yy_last_accepting_state
unsigned char YY_CHAR
static flex_int16_t yy_def[35]
static flex_int16_t yy_nxt[83]
char * yy_last_accepting_cpos
static flex_int16_t yy_base[35]
static flex_int32_t yy_meta[19]
static flex_int16_t yy_chk[83]
void CChemEqParser::yyensure_buffer_stack ( void  )
protected

Definition at line 1552 of file CChemEqParser_lex.cpp.

References CChemEqParseralloc(), CChemEqParserrealloc(), yyFlexLexer::yy_buffer_stack, yyFlexLexer::yy_buffer_stack_max, yyFlexLexer::yy_buffer_stack_top, and YY_FATAL_ERROR.

1553 {
1554  int num_to_alloc;
1555 
1556  if (!(yy_buffer_stack))
1557  {
1558 
1559  /* First allocation is just for 2 elements, since we don't know if this
1560  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1561  * immediate realloc on the next call.
1562  */
1563  num_to_alloc = 1;
1565  (num_to_alloc * sizeof(struct yy_buffer_state*)
1566  );
1567 
1568  if (!(yy_buffer_stack))
1569  YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1570 
1571  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1572 
1573  (yy_buffer_stack_max) = num_to_alloc;
1574  (yy_buffer_stack_top) = 0;
1575  return;
1576  }
1577 
1578  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1)
1579  {
1580 
1581  /* Increase the buffer to prepare for a possible push. */
1582  int grow_size = 8 /* arbitrary grow size */;
1583 
1584  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1586  ((yy_buffer_stack),
1587  num_to_alloc * sizeof(struct yy_buffer_state*)
1588  );
1589 
1590  if (!(yy_buffer_stack))
1591  YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1592 
1593  /* zero only the new slots.*/
1594  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1595  (yy_buffer_stack_max) = num_to_alloc;
1596  }
1597 }
size_t yy_buffer_stack_max
void * CChemEqParseralloc(yy_size_t)
#define YY_FATAL_ERROR(msg)
size_t yy_buffer_stack_top
struct yy_buffer_state ** yy_buffer_stack
void * CChemEqParserrealloc(void *, yy_size_t)
int CChemEqParser::yyinput ( )
protected

Definition at line 1256 of file CChemEqParser_lex.cpp.

References EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yyFlexLexer::yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yyFlexLexer::yy_did_buffer_switch_on_eof, YY_END_OF_BUFFER_CHAR, yyFlexLexer::yy_get_next_buffer(), yyFlexLexer::yy_hold_char, yyFlexLexer::yy_n_chars, YY_NEW_FILE, yyFlexLexer::yyin, yyFlexLexer::yyinput(), yyFlexLexer::yyrestart(), yytext_ptr, and yyFlexLexer::yywrap().

1257 {
1258  int c;
1259 
1260  *(yy_c_buf_p) = (yy_hold_char);
1261 
1263  {
1264  /* yy_c_buf_p now points to the character we want to return.
1265  * If this occurs *before* the EOB characters, then it's a
1266  * valid NUL; if not, then we've hit the end of the buffer.
1267  */
1268  if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
1269  /* This was really a NUL. */
1270  *(yy_c_buf_p) = '\0';
1271 
1272  else
1273  {
1274  /* need more input */
1275  int offset = (yy_c_buf_p) - (yytext_ptr);
1276  ++(yy_c_buf_p);
1277 
1278  switch (yy_get_next_buffer())
1279  {
1280  case EOB_ACT_LAST_MATCH:
1281  /* This happens because yy_g_n_b()
1282  * sees that we've accumulated a
1283  * token and flags that we need to
1284  * try matching the token before
1285  * proceeding. But for input(),
1286  * there's no matching to consider.
1287  * So convert the EOB_ACT_LAST_MATCH
1288  * to EOB_ACT_END_OF_FILE.
1289  */
1290 
1291  /* Reset buffer status. */
1292  yyrestart(yyin);
1293 
1294  /*FALLTHROUGH*/
1295 
1296  case EOB_ACT_END_OF_FILE:
1297  {
1298  if (yywrap())
1299  return EOF;
1300 
1302  YY_NEW_FILE;
1303 
1304 #ifdef __cplusplus
1305  return yyinput();
1306 #else
1307  return input();
1308 #endif
1309  }
1310 
1311  case EOB_ACT_CONTINUE_SCAN:
1312  (yy_c_buf_p) = (yytext_ptr) + offset;
1313  break;
1314  }
1315  }
1316  }
1317 
1318  c = *(unsigned char *)(yy_c_buf_p); /* cast for 8-bit char's */
1319  *(yy_c_buf_p) = '\0'; /* preserve yytext */
1320  (yy_hold_char) = *++(yy_c_buf_p);
1321 
1322  return c;
1323 }
#define EOB_ACT_LAST_MATCH
#define EOB_ACT_CONTINUE_SCAN
virtual int yywrap()
#define yytext_ptr
void yyrestart(std::istream *s)
#define YY_END_OF_BUFFER_CHAR
#define YY_NEW_FILE
std::istream * yyin
#define EOB_ACT_END_OF_FILE
#define YY_CURRENT_BUFFER_LVALUE
int yy_did_buffer_switch_on_eof
int CChemEqParser::yylex ( )
virtual

The main scanner function which does all the work.

Implements FlexLexer.

Definition at line 579 of file CChemEqParser_lex.cpp.

References COMMON_ACTION, ECHO, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, CCopasiMessage::ERROR, INITIAL, MCFunction, mpData, CChemEqParserBase::Data::name, TOKEN_BEGIN_COMPARTMENT, TOKEN_BEGIN_MODIFIERS, TOKEN_BEGIN_PRODUCTS, TOKEN_END_COMPARTMENT, TOKEN_MULTIPLY, TOKEN_NAME, TOKEN_NUMBER, TOKEN_PLUS, unQuote(), yy_accept, yy_base, YY_BREAK, YY_BUF_SIZE, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yy_chk, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_def, YY_DO_BEFORE_ACTION, yy_ec, YY_END_OF_BUFFER, YY_FATAL_ERROR, yy_meta, YY_MORE_ADJ, YY_NEW_FILE, yy_nxt, YY_RESTORE_YY_MORE_OFFSET, YY_RULE_SETUP, YY_SC_TO_UI, YY_START, YY_STATE_EOF, YY_USER_INIT, YYERRCODE, yyleng, and yytext_ptr.

580 {
581  register yy_state_type yy_current_state;
582  register char * yy_cp, *yy_bp;
583  register int yy_act;
584 
585 #line 36 "model/CChemEqParser.lpp"
586 
587 #line 570 "CChemEqParser_lex.cpp"
588 
589  if (!(yy_init))
590  {
591  (yy_init) = 1;
592 
593 #ifdef YY_USER_INIT
594  YY_USER_INIT;
595 #endif
596 
597  if (!(yy_start))
598  (yy_start) = 1; /* first start state */
599 
600  if (! yyin)
601  yyin = & std::cin;
602 
603  if (! yyout)
604  yyout = & std::cout;
605 
606  if (! YY_CURRENT_BUFFER)
607  {
611  }
612 
614  }
615 
616  while (1) /* loops until end-of-file is reached */
617  {
618  yy_cp = (yy_c_buf_p);
619 
620  /* Support of yytext. */
621  *yy_cp = (yy_hold_char);
622 
623  /* yy_bp points to the position in yy_ch_buf of the start of
624  * the current run.
625  */
626  yy_bp = yy_cp;
627 
628  yy_current_state = (yy_start);
629 yy_match:
630 
631  do
632  {
633  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
634 
635  if (yy_accept[yy_current_state])
636  {
637  (yy_last_accepting_state) = yy_current_state;
638  (yy_last_accepting_cpos) = yy_cp;
639  }
640 
641  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
642  {
643  yy_current_state = (int) yy_def[yy_current_state];
644 
645  if (yy_current_state >= 32)
646  yy_c = yy_meta[(unsigned int) yy_c];
647  }
648 
649  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
650  ++yy_cp;
651  }
652  while (yy_current_state != 31);
653 
654  yy_cp = (yy_last_accepting_cpos);
655  yy_current_state = (yy_last_accepting_state);
656 
657 yy_find_action:
658  yy_act = yy_accept[yy_current_state];
659 
661 
662 do_action: /* This label is used only to access EOF actions. */
663 
664  switch (yy_act)
665  {
666  /* beginning of action switch */
667  case 0: /* must back up */
668  /* undo the effects of YY_DO_BEFORE_ACTION */
669  *yy_cp = (yy_hold_char);
670  yy_cp = (yy_last_accepting_cpos);
671  yy_current_state = (yy_last_accepting_state);
672  goto yy_find_action;
673 
674  case 1:
676 #line 37 "model/CChemEqParser.lpp"
677 
679  return TOKEN_NUMBER;
680 
681  YY_BREAK
682 
683  case 2:
685 #line 42 "model/CChemEqParser.lpp"
686 
688  return TOKEN_PLUS;
689 
690  YY_BREAK
691 
692  case 3:
694 #line 47 "model/CChemEqParser.lpp"
695 
697  return TOKEN_MULTIPLY;
698 
699  YY_BREAK
700 
701  case 4:
703 #line 52 "model/CChemEqParser.lpp"
704 
707 
708  YY_BREAK
709 
710  case 5:
712 #line 57 "model/CChemEqParser.lpp"
713 
715  return TOKEN_END_COMPARTMENT;
716 
717  YY_BREAK
718 
719  case 6:
721 #line 62 "model/CChemEqParser.lpp"
722 
724  return TOKEN_BEGIN_MODIFIERS;
725 
726  YY_BREAK
727 
728  case 7:
730 #line 67 "model/CChemEqParser.lpp"
731 
733  return TOKEN_BEGIN_PRODUCTS;
734 
735  YY_BREAK
736 
737  case 8:
738  /* rule 8 can match eol */
740 #line 72 "model/CChemEqParser.lpp"
741 
744  return TOKEN_NAME;
745 
746  YY_BREAK
747 
748  case 9:
749  /* rule 9 can match eol */
751 #line 78 "model/CChemEqParser.lpp"
752 
754  return TOKEN_NAME;
755 
756  YY_BREAK
757 
758  case 10:
759  /* rule 10 can match eol */
761 #line 83 "model/CChemEqParser.lpp"
762 
763  mPosition += yyleng;
764  //COMMON_ACTION;
765 
766  YY_BREAK
767 
768  case YY_STATE_EOF(INITIAL):
769 #line 87 "model/CChemEqParser.lpp"
770  return 0;
771  YY_BREAK
772 
773  case 11:
775 #line 89 "model/CChemEqParser.lpp"
776 
778  return YYERRCODE;
779 
780  YY_BREAK
781 
782  case 12:
784 #line 94 "model/CChemEqParser.lpp"
785  ECHO;
786  YY_BREAK
787 #line 749 "CChemEqParser_lex.cpp"
788 
789  case YY_END_OF_BUFFER:
790  {
791  /* Amount of text matched not including the EOB char. */
792  int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1;
793 
794  /* Undo the effects of YY_DO_BEFORE_ACTION. */
795  *yy_cp = (yy_hold_char);
797 
798  if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW)
799  {
800  /* We're scanning a new file or input source. It's
801  * possible that this happened because the user
802  * just pointed yyin at a new source and called
803  * yylex(). If so, then we have to assure
804  * consistency between YY_CURRENT_BUFFER and our
805  * globals. Here is the right place to do so, because
806  * this is the first action (other than possibly a
807  * back-up) that will match for the new input source.
808  */
809  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
810  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
811  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
812  }
813 
814  /* Note that here we test for yy_c_buf_p "<=" to the position
815  * of the first EOB in the buffer, since yy_c_buf_p will
816  * already have been incremented past the NUL character
817  * (since all states make transitions on EOB to the
818  * end-of-buffer state). Contrast this with the test
819  * in input().
820  */
821  if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
822  {
823  /* This was really a NUL. */
824  yy_state_type yy_next_state;
825 
826  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
827 
828  yy_current_state = yy_get_previous_state();
829 
830  /* Okay, we're now positioned to make the NUL
831  * transition. We couldn't have
832  * yy_get_previous_state() go ahead and do it
833  * for us because it doesn't know how to deal
834  * with the possibility of jamming (and we don't
835  * want to build jamming into it because then it
836  * will run more slowly).
837  */
838 
839  yy_next_state = yy_try_NUL_trans(yy_current_state);
840 
841  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
842 
843  if (yy_next_state)
844  {
845  /* Consume the NUL. */
846  yy_cp = ++(yy_c_buf_p);
847  yy_current_state = yy_next_state;
848  goto yy_match;
849  }
850 
851  else
852  {
853  yy_cp = (yy_last_accepting_cpos);
854  yy_current_state = (yy_last_accepting_state);
855  goto yy_find_action;
856  }
857  }
858 
859  else switch (yy_get_next_buffer())
860  {
861  case EOB_ACT_END_OF_FILE:
862  {
864 
865  if (yywrap())
866  {
867  /* Note: because we've taken care in
868  * yy_get_next_buffer() to have set up
869  * yytext, we can now set up
870  * yy_c_buf_p so that if some total
871  * hoser (like flex itself) wants to
872  * call the scanner after we return the
873  * YY_NULL, it'll still work - another
874  * YY_NULL will get returned.
875  */
877 
878  yy_act = YY_STATE_EOF(YY_START);
879  goto do_action;
880  }
881 
882  else
883  {
885  YY_NEW_FILE;
886  }
887 
888  break;
889  }
890 
892  (yy_c_buf_p) =
893  (yytext_ptr) + yy_amount_of_matched_text;
894 
895  yy_current_state = yy_get_previous_state();
896 
897  yy_cp = (yy_c_buf_p);
898  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
899  goto yy_match;
900 
901  case EOB_ACT_LAST_MATCH:
902  (yy_c_buf_p) =
903  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
904 
905  yy_current_state = yy_get_previous_state();
906 
907  yy_cp = (yy_c_buf_p);
908  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
909  goto yy_find_action;
910  }
911 
912  break;
913  }
914 
915  default:
917  "fatal flex scanner internal error--no action found");
918  } /* end of action switch */
919  } /* end of scanning one token */
920 } /* end of yylex */
std::string unQuote(const std::string &name)
Definition: utility.cpp:120
#define YY_BUFFER_NEW
#define EOB_ACT_LAST_MATCH
static flex_int32_t yy_ec[256]
static flex_int16_t yy_accept[32]
#define YYERRCODE
#define YY_DO_BEFORE_ACTION
#define YY_SC_TO_UI(c)
#define YY_USER_INIT
unsigned C_INT32 mPosition
Definition: CChemEqParser.h:94
#define MCFunction
yy_state_type yy_last_accepting_state
std::ostream * yyout
yy_state_type yy_get_previous_state()
#define EOB_ACT_CONTINUE_SCAN
struct yy_buffer_state * yy_create_buffer(std::istream *s, int size)
#define YY_RESTORE_YY_MORE_OFFSET
unsigned char YY_CHAR
#define YY_CURRENT_BUFFER
int yyleng
Definition: FlexLexer.h:111
#define YY_FATAL_ERROR(msg)
#define YY_END_OF_BUFFER
virtual int yywrap()
#define ECHO
#define yytext_ptr
#define COMMON_ACTION
#define YY_MORE_ADJ
static flex_int16_t yy_def[35]
static flex_int16_t yy_nxt[83]
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
int yy_state_type
Definition: FlexLexer.h:72
char * yy_last_accepting_cpos
static flex_int16_t yy_base[35]
void yyensure_buffer_stack(void)
#define YY_NEW_FILE
std::istream * yyin
#define EOB_ACT_END_OF_FILE
#define TOKEN_NUMBER
#define YY_BREAK
#define YY_CURRENT_BUFFER_LVALUE
static flex_int32_t yy_meta[19]
#define INITIAL
#define YY_RULE_SETUP
#define YY_STATE_EOF(state)
#define YY_BUFFER_NORMAL
int yy_did_buffer_switch_on_eof
static flex_int16_t yy_chk[83]
#define YY_BUF_SIZE
#define YY_START
void CChemEqParser::yypop_buffer_state ( void  )

Removes and deletes the top of the stack, if present. The next element becomes the new top.

Definition at line 1531 of file CChemEqParser_lex.cpp.

References yyFlexLexer::yy_buffer_stack_top, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyFlexLexer::yy_delete_buffer(), yyFlexLexer::yy_did_buffer_switch_on_eof, and yyFlexLexer::yy_load_buffer_state().

1532 {
1533  if (!YY_CURRENT_BUFFER)
1534  return;
1535 
1537  YY_CURRENT_BUFFER_LVALUE = NULL;
1538 
1539  if ((yy_buffer_stack_top) > 0)
1540  --(yy_buffer_stack_top);
1541 
1542  if (YY_CURRENT_BUFFER)
1543  {
1546  }
1547 }
#define YY_CURRENT_BUFFER
size_t yy_buffer_stack_top
void yy_delete_buffer(struct yy_buffer_state *b)
#define YY_CURRENT_BUFFER_LVALUE
int yy_did_buffer_switch_on_eof
void CChemEqParser::yypush_buffer_state ( struct yy_buffer_state new_buffer)

Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.

Parameters
new_bufferThe new state.

Definition at line 1500 of file CChemEqParser_lex.cpp.

References yyFlexLexer::yy_buffer_stack_top, yyFlexLexer::yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyFlexLexer::yy_did_buffer_switch_on_eof, yyFlexLexer::yy_hold_char, yyFlexLexer::yy_load_buffer_state(), yyFlexLexer::yy_n_chars, and yyFlexLexer::yyensure_buffer_stack().

1501 {
1502  if (new_buffer == NULL)
1503  return;
1504 
1506 
1507  /* This block is copied from yy_switch_to_buffer. */
1508  if (YY_CURRENT_BUFFER)
1509  {
1510  /* Flush out information for old buffer. */
1511  *(yy_c_buf_p) = (yy_hold_char);
1512  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1513  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1514  }
1515 
1516  /* Only push if top exists. Otherwise, replace top. */
1517  if (YY_CURRENT_BUFFER)
1518  (yy_buffer_stack_top)++;
1519 
1520  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1521 
1522  /* copied from yy_switch_to_buffer. */
1525 }
#define YY_CURRENT_BUFFER
size_t yy_buffer_stack_top
void yyensure_buffer_stack(void)
#define YY_CURRENT_BUFFER_LVALUE
int yy_did_buffer_switch_on_eof
void CChemEqParser::yyrestart ( std::istream *  input_file)
virtual

Immediately switch to a different input stream.

Parameters
input_fileA readable stream.
Note
This function does not reset the start condition to INITIAL .

Implements FlexLexer.

Definition at line 1330 of file CChemEqParser_lex.cpp.

References YY_BUF_SIZE, yyFlexLexer::yy_create_buffer(), YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyFlexLexer::yy_init_buffer(), yyFlexLexer::yy_load_buffer_state(), yyFlexLexer::yyensure_buffer_stack(), and yyFlexLexer::yyin.

1331 {
1332 
1333  if (! YY_CURRENT_BUFFER)
1334  {
1338  }
1339 
1340  yy_init_buffer(YY_CURRENT_BUFFER, input_file);
1342 }
void yy_init_buffer(struct yy_buffer_state *b, std::istream *s)
struct yy_buffer_state * yy_create_buffer(std::istream *s, int size)
#define YY_CURRENT_BUFFER
void yyensure_buffer_stack(void)
std::istream * yyin
#define YY_CURRENT_BUFFER_LVALUE
#define YY_BUF_SIZE
void CChemEqParser::yyunput ( int  c,
char *  buf_ptr 
)
protected

Definition at line 1218 of file CChemEqParser_lex.cpp.

References if(), yyFlexLexer::yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, YY_FATAL_ERROR, yyFlexLexer::yy_hold_char, yyFlexLexer::yy_n_chars, and yytext_ptr.

1219 {
1220  register char *yy_cp;
1221 
1222  yy_cp = (yy_c_buf_p);
1223 
1224  /* undo effects of setting up yytext */
1225  *yy_cp = (yy_hold_char);
1226 
1227  if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1228  {
1229  /* need to shift things up to make room */
1230  /* +2 for EOB chars. */
1231  register int number_to_move = (yy_n_chars) + 2;
1232  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1233  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1234  register char *source =
1235  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1236 
1237  while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1238  *--dest = *--source;
1239 
1240  yy_cp += (int)(dest - source);
1241  yy_bp += (int)(dest - source);
1242  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1243  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1244 
1245  if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1246  YY_FATAL_ERROR("flex scanner push-back overflow");
1247  }
1248 
1249  *--yy_cp = (char) c;
1250 
1251  (yytext_ptr) = yy_bp;
1252  (yy_hold_char) = *yy_cp;
1253  (yy_c_buf_p) = yy_cp;
1254 }
#define YY_FATAL_ERROR(msg)
#define yytext_ptr
#define YY_CURRENT_BUFFER_LVALUE
if(!yymsg) yymsg
int CChemEqParser::yywrap ( )
virtual

Definition at line 59 of file CChemEqParser.cpp.

60 {return 1;}

Member Data Documentation

struct yy_buffer_state** CChemEqParser::yy_buffer_stack
protected

Stack as an array.

Definition at line 182 of file CChemEqParser.h.

size_t CChemEqParser::yy_buffer_stack_max
protected

capacity of stack.

Definition at line 181 of file CChemEqParser.h.

size_t CChemEqParser::yy_buffer_stack_top
protected

index of top of stack.

Definition at line 180 of file CChemEqParser.h.

char* CChemEqParser::yy_c_buf_p
protected

Definition at line 171 of file CChemEqParser.h.

struct yy_buffer_state* CChemEqParser::yy_current_buffer
protected

Definition at line 162 of file CChemEqParser.h.

int CChemEqParser::yy_did_buffer_switch_on_eof
protected

Definition at line 178 of file CChemEqParser.h.

int CChemEqParser::yy_full_lp
protected

Definition at line 196 of file CChemEqParser.h.

char* CChemEqParser::yy_full_match
protected

Definition at line 194 of file CChemEqParser.h.

int* CChemEqParser::yy_full_state
protected

Definition at line 195 of file CChemEqParser.h.

char CChemEqParser::yy_hold_char
protected

Definition at line 165 of file CChemEqParser.h.

int CChemEqParser::yy_init
protected

Definition at line 173 of file CChemEqParser.h.

char* CChemEqParser::yy_last_accepting_cpos
protected

Definition at line 189 of file CChemEqParser.h.

yy_state_type CChemEqParser::yy_last_accepting_state
protected

Definition at line 188 of file CChemEqParser.h.

int CChemEqParser::yy_looking_for_trail_begin
protected

Definition at line 199 of file CChemEqParser.h.

int CChemEqParser::yy_lp
protected

Definition at line 198 of file CChemEqParser.h.

int CChemEqParser::yy_more_flag
protected

Definition at line 201 of file CChemEqParser.h.

int CChemEqParser::yy_more_len
protected

Definition at line 202 of file CChemEqParser.h.

int CChemEqParser::yy_more_offset
protected

Definition at line 203 of file CChemEqParser.h.

int CChemEqParser::yy_n_chars
protected

Definition at line 168 of file CChemEqParser.h.

int CChemEqParser::yy_prev_more_offset
protected

Definition at line 204 of file CChemEqParser.h.

int CChemEqParser::yy_start
protected

Definition at line 174 of file CChemEqParser.h.

int* CChemEqParser::yy_start_stack
protected

Definition at line 149 of file CChemEqParser.h.

int CChemEqParser::yy_start_stack_depth
protected

Definition at line 148 of file CChemEqParser.h.

int CChemEqParser::yy_start_stack_ptr
protected

Definition at line 147 of file CChemEqParser.h.

yy_state_type* CChemEqParser::yy_state_buf
protected

Definition at line 191 of file CChemEqParser.h.

yy_state_type* CChemEqParser::yy_state_ptr
protected

Definition at line 192 of file CChemEqParser.h.

std::istream* CChemEqParser::yyin
protected

Definition at line 159 of file CChemEqParser.h.

std::ostream* CChemEqParser::yyout
protected

Definition at line 160 of file CChemEqParser.h.


The documentation for this class was generated from the following files: