COPASI API  4.16.103
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
CEvaluationParserBase Class Referenceabstract

#include <CEvaluationLexer.h>

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

Public Member Functions

 CEvaluationParserBase ()
 
size_t getErrorPosition ()
 
std::vector< CEvaluationNode * > * getNodeList ()
 
CEvaluationNodegetRootNode ()
 
bool isBoolean () const
 
virtual int yylex ()=0
 
virtual int yyparse ()
 
virtual ~CEvaluationParserBase ()
 

Static Public Member Functions

static void freeNodeList (std::vector< CEvaluationNode * > *pNodeList)
 

Protected Attributes

bool mBoolean
 
CEvaluationNodempNode
 
std::vector< CEvaluationNode * > * mpNodeList
 
size_t mPosition
 
CEvaluationNodempRootNode
 

Private Member Functions

void correctErrorPosition ()
 

Detailed Description

This is a base class for the CEvaluationLexer adding member attributes to enhance the internal functionality.

Definition at line 39 of file CEvaluationLexer.h.

Constructor & Destructor Documentation

CEvaluationParserBase::CEvaluationParserBase ( )
inline

Default constructor

Definition at line 45 of file CEvaluationLexer.h.

45  :
46  mpNode(NULL),
47  mpRootNode(NULL),
48  mBoolean(false),
49  mpNodeList(NULL),
50  mPosition(0)
51  {}
CEvaluationNode * mpRootNode
std::vector< CEvaluationNode * > * mpNodeList
CEvaluationNode * mpNode
virtual CEvaluationParserBase::~CEvaluationParserBase ( )
inlinevirtual

Destructor

Definition at line 56 of file CEvaluationLexer.h.

56 {}

Member Function Documentation

void CEvaluationParserBase::correctErrorPosition ( )
inlineprivate

Definition at line 108 of file CEvaluationLexer.h.

109  {
110  std::vector< CEvaluationNode * >::iterator it
111  = mpNodeList->begin();
112  std::vector< CEvaluationNode * >::iterator end
113  = mpNodeList->end();
114  size_t oldPosition = mPosition;
115  mPosition = 0;
116 
117  for (; it != end && mPosition < oldPosition; ++it)
118  mPosition += (*it)->getData().length();
119 
120  if (mPosition > 0)
121  mPosition -= (*--it)->getData().length();
122  }
std::vector< CEvaluationNode * > * mpNodeList
static void CEvaluationParserBase::freeNodeList ( std::vector< CEvaluationNode * > *  pNodeList)
inlinestatic

Convenient function to free the list of generated nodes.

Parameters
std::vector<CEvaluationNode * > * pNodeList

Definition at line 73 of file CEvaluationLexer.h.

References pdelete.

Referenced by CEvaluationTree::parse(), CEvaluationTree::setRoot(), CEvaluationTree::updateTree(), and CEvaluationTree::~CEvaluationTree().

74  {
75  if (pNodeList == NULL) return;
76 
77  std::vector< CEvaluationNode * >::iterator it;
78  std::vector< CEvaluationNode * >::iterator end = pNodeList->end();
79 
80  for (it = pNodeList->begin(); it != end; ++it)
81  if (*it && (*it)->getParent())
82  (*it)->getParent()->removeChild(*it);
83 
84  for (it = pNodeList->begin(); it != end; ++it)
85  pdelete(*it);
86 
87  pdelete(pNodeList);
88  }
#define pdelete(p)
Definition: copasi.h:215
size_t CEvaluationParserBase::getErrorPosition ( )
inline

Definition at line 98 of file CEvaluationLexer.h.

Referenced by CEvaluationTree::parse().

98 {return mPosition;}
std::vector< CEvaluationNode * >* CEvaluationParserBase::getNodeList ( )
inline

Retrieve the generated list of nodes. The user owns the list and is repsonsible for the destruction. To delete the list please use freeNodeList. Please note that each call to yylex() creates a new list which must be destoyed.

Returns
std::vector< CEvaluationNode * > * pNodeList

Definition at line 66 of file CEvaluationLexer.h.

Referenced by CEvaluationTree::parse().

67  {return mpNodeList;}
std::vector< CEvaluationNode * > * mpNodeList
CEvaluationNode* CEvaluationParserBase::getRootNode ( )
inline

Definition at line 94 of file CEvaluationLexer.h.

Referenced by CEvaluationTree::parse().

94 {return mpRootNode;}
CEvaluationNode * mpRootNode
bool CEvaluationParserBase::isBoolean ( ) const
inline

Definition at line 96 of file CEvaluationLexer.h.

96 {return mBoolean;}
virtual int CEvaluationParserBase::yylex ( )
pure virtual

Implemented in CEvaluationLexer.

int CEvaluationParserBase::yyparse ( )
virtual

Definition at line 1324 of file CEvaluationParser_yacc.cpp.

References setBooleanRequired(), YY_, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerror, YYFINAL, YYID, YYINITDEPTH, YYLAST, YYLEX, yylval, YYMAXDEPTH, yynerrs, YYNTOKENS, yypact_value_is_default, YYPOPSTACK, YYSIZE_T, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, YYSTYPE, yytable_value_is_error, YYTERROR, YYTRANSLATE, and yyalloc::yyvs_alloc.

Referenced by CEvaluationTree::parse().

1328 {
1329  int yystate;
1330  /* Number of tokens to shift before error messages enabled. */
1331  int yyerrstatus;
1332 
1333  /* The stacks and their tools:
1334  `yyss': related to states.
1335  `yyvs': related to semantic values.
1336 
1337  Refer to the stacks through separate pointers, to allow yyoverflow
1338  to reallocate them elsewhere. */
1339 
1340  /* The state stack. */
1341  yytype_int16 yyssa[YYINITDEPTH];
1342  yytype_int16 *yyss;
1343  yytype_int16 *yyssp;
1344 
1345  /* The semantic value stack. */
1346  YYSTYPE yyvsa[YYINITDEPTH];
1347  YYSTYPE *yyvs;
1348  YYSTYPE *yyvsp;
1349 
1350  YYSIZE_T yystacksize;
1351 
1352  int yyn;
1353  int yyresult;
1354  /* Lookahead token as an internal (translated) token number. */
1355  int yytoken = 0;
1356  /* The variables used to return semantic value and location from the
1357  action routines. */
1358  YYSTYPE yyval;
1359 
1360 #if YYERROR_VERBOSE
1361  /* Buffer for error messages, and its allocated size. */
1362  char yymsgbuf[128];
1363  char *yymsg = yymsgbuf;
1364  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1365 #endif
1366 
1367 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1368 
1369  /* The number of symbols on the RHS of the reduced rule.
1370  Keep to zero when no symbol should be popped. */
1371  int yylen = 0;
1372 
1373  yyssp = yyss = yyssa;
1374  yyvsp = yyvs = yyvsa;
1375  yystacksize = YYINITDEPTH;
1376 
1377  YYDPRINTF((stderr, "Starting parse\n"));
1378 
1379  yystate = 0;
1380  yyerrstatus = 0;
1381  yynerrs = 0;
1382  yychar = YYEMPTY; /* Cause a token to be read. */
1383  goto yysetstate;
1384 
1385  /*------------------------------------------------------------.
1386  | yynewstate -- Push a new state, which is found in yystate. |
1387  `------------------------------------------------------------*/
1388 yynewstate:
1389  /* In all cases, when you get here, the value and location stacks
1390  have just been pushed. So pushing a state here evens the stacks. */
1391  yyssp++;
1392 
1393 yysetstate:
1394  *yyssp = yystate;
1395 
1396  if (yyss + yystacksize - 1 <= yyssp)
1397  {
1398  /* Get the current used size of the three stacks, in elements. */
1399  YYSIZE_T yysize = yyssp - yyss + 1;
1400 
1401 #ifdef yyoverflow
1402  {
1403  /* Give user a chance to reallocate the stack. Use copies of
1404  these so that the &'s don't force the real ones into
1405  memory. */
1406  YYSTYPE *yyvs1 = yyvs;
1407  yytype_int16 *yyss1 = yyss;
1408 
1409  /* Each stack pointer address is followed by the size of the
1410  data in use in that stack, in bytes. This used to be a
1411  conditional around just the two extra args, but that might
1412  be undefined if yyoverflow is a macro. */
1413  yyoverflow(YY_("memory exhausted"),
1414  &yyss1, yysize * sizeof(*yyssp),
1415  &yyvs1, yysize * sizeof(*yyvsp),
1416  &yystacksize);
1417 
1418  yyss = yyss1;
1419  yyvs = yyvs1;
1420  }
1421 #else /* no yyoverflow */
1422 # ifndef YYSTACK_RELOCATE
1423  goto yyexhaustedlab;
1424 # else
1425 
1426  /* Extend the stack our own way. */
1427  if (YYMAXDEPTH <= yystacksize)
1428  goto yyexhaustedlab;
1429 
1430  yystacksize *= 2;
1431 
1432  if (YYMAXDEPTH < yystacksize)
1433  yystacksize = YYMAXDEPTH;
1434 
1435  {
1436  yytype_int16 *yyss1 = yyss;
1437  union yyalloc *yyptr =
1438  (union yyalloc *) YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
1439 
1440  if (! yyptr)
1441  goto yyexhaustedlab;
1442 
1445 # undef YYSTACK_RELOCATE
1446 
1447  if (yyss1 != yyssa)
1448  YYSTACK_FREE(yyss1);
1449  }
1450 # endif
1451 #endif /* no yyoverflow */
1452 
1453  yyssp = yyss + yysize - 1;
1454  yyvsp = yyvs + yysize - 1;
1455 
1456  YYDPRINTF((stderr, "Stack size increased to %lu\n",
1457  (unsigned long int) yystacksize));
1458 
1459  if (yyss + yystacksize - 1 <= yyssp)
1460  YYABORT;
1461  }
1462 
1463  YYDPRINTF((stderr, "Entering state %d\n", yystate));
1464 
1465  if (yystate == YYFINAL)
1466  YYACCEPT;
1467 
1468  goto yybackup;
1469 
1470  /*-----------.
1471  | yybackup. |
1472  `-----------*/
1473 yybackup:
1474 
1475  /* Do appropriate processing given the current state. Read a
1476  lookahead token if we need one and don't already have one. */
1477 
1478  /* First try to decide what to do without reference to lookahead token. */
1479  yyn = yypact[yystate];
1480 
1481  if (yypact_value_is_default(yyn))
1482  goto yydefault;
1483 
1484  /* Not known => get a lookahead token if don't already have one. */
1485 
1486  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1487  if (yychar == YYEMPTY)
1488  {
1489  YYDPRINTF((stderr, "Reading a token: "));
1490  yychar = YYLEX;
1491  }
1492 
1493  if (yychar <= YYEOF)
1494  {
1495  yychar = yytoken = YYEOF;
1496  YYDPRINTF((stderr, "Now at end of input.\n"));
1497  }
1498  else
1499  {
1500  yytoken = YYTRANSLATE(yychar);
1501  YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
1502  }
1503 
1504  /* If the proper action on seeing token YYTOKEN is to reduce or to
1505  detect an error, take that action. */
1506  yyn += yytoken;
1507 
1508  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1509  goto yydefault;
1510 
1511  yyn = yytable[yyn];
1512 
1513  if (yyn <= 0)
1514  {
1515  if (yytable_value_is_error(yyn))
1516  goto yyerrlab;
1517 
1518  yyn = -yyn;
1519  goto yyreduce;
1520  }
1521 
1522  /* Count tokens shifted since error; after three, turn off error
1523  status. */
1524  if (yyerrstatus)
1525  yyerrstatus--;
1526 
1527  /* Shift the lookahead token. */
1528  YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
1529 
1530  /* Discard the shifted token. */
1531  yychar = YYEMPTY;
1532 
1533  yystate = yyn;
1535  *++yyvsp = yylval;
1537 
1538  goto yynewstate;
1539 
1540  /*-----------------------------------------------------------.
1541  | yydefault -- do the default action for the current state. |
1542  `-----------------------------------------------------------*/
1543 yydefault:
1544  yyn = yydefact[yystate];
1545 
1546  if (yyn == 0)
1547  goto yyerrlab;
1548 
1549  goto yyreduce;
1550 
1551  /*-----------------------------.
1552  | yyreduce -- Do a reduction. |
1553  `-----------------------------*/
1554 yyreduce:
1555  /* yyn is the number of a rule to reduce with. */
1556  yylen = yyr2[yyn];
1557 
1558  /* If YYLEN is nonzero, implement the default value of the action:
1559  `$$ = $1'.
1560 
1561  Otherwise, the following line sets YYVAL to garbage.
1562  This behavior is undocumented and Bison
1563  users should not rely upon it. Assigning to YYVAL
1564  unconditionally makes the parser a bit smaller, and it avoids a
1565  GCC warning that YYVAL may be used uninitialized. */
1566  yyval = yyvsp[1 - yylen];
1567 
1568  YY_REDUCE_PRINT(yyn);
1569 
1570  switch (yyn)
1571  {
1572  case 2:
1573  /* Line 1778 of yacc.c */
1574 #line 93 "CEvaluationParser.ypp"
1575  {
1576  mBoolean = false;
1577  mpRootNode = (yyval);
1578  }
1579  break;
1580 
1581  case 3:
1582  /* Line 1778 of yacc.c */
1583 #line 98 "CEvaluationParser.ypp"
1584  {
1585  mBoolean = true;
1586  mpRootNode = (yyval);
1587  }
1588  break;
1589 
1590  case 4:
1591  /* Line 1778 of yacc.c */
1592 #line 104 "CEvaluationParser.ypp"
1593  {
1594  mpRootNode = (yyvsp[(1) - (1)]);
1595  }
1596  break;
1597 
1598  case 5:
1599  /* Line 1778 of yacc.c */
1600 #line 108 "CEvaluationParser.ypp"
1601  {
1602  mpRootNode = (yyvsp[(1) - (1)]);
1603  }
1604  break;
1605 
1606  case 6:
1607  /* Line 1778 of yacc.c */
1608 #line 112 "CEvaluationParser.ypp"
1609  {
1610  (yyval) = (yyvsp[(2) - (3)]);
1611  (yyval)->addChild((yyvsp[(1) - (3)]));
1612  (yyval)->addChild((yyvsp[(3) - (3)]));
1613  mpRootNode = (yyval);
1614  }
1615  break;
1616 
1617  case 7:
1618  /* Line 1778 of yacc.c */
1619 #line 119 "CEvaluationParser.ypp"
1620  {
1621  (yyval) = (yyvsp[(2) - (3)]);
1622  (yyval)->addChild((yyvsp[(1) - (3)]));
1623  (yyval)->addChild((yyvsp[(3) - (3)]));
1624  mpRootNode = (yyval);
1625  }
1626  break;
1627 
1628  case 8:
1629  /* Line 1778 of yacc.c */
1630 #line 126 "CEvaluationParser.ypp"
1631  {
1632  (yyval) = (yyvsp[(2) - (3)]);
1633  (yyval)->addChild((yyvsp[(1) - (3)]));
1634  (yyval)->addChild((yyvsp[(3) - (3)]));
1635  mpRootNode = (yyval);
1636  }
1637  break;
1638 
1639  case 9:
1640  /* Line 1778 of yacc.c */
1641 #line 133 "CEvaluationParser.ypp"
1642  {
1643  (yyval) = (yyvsp[(2) - (3)]);
1644  (yyval)->addChild((yyvsp[(1) - (3)]));
1645  (yyval)->addChild((yyvsp[(3) - (3)]));
1646  mpRootNode = (yyval);
1647  }
1648  break;
1649 
1650  case 10:
1651  /* Line 1778 of yacc.c */
1652 #line 140 "CEvaluationParser.ypp"
1653  {
1654  (yyval) = (yyvsp[(2) - (3)]);
1655  mpRootNode = (yyval);
1656  }
1657  break;
1658 
1659  case 11:
1660  /* Line 1778 of yacc.c */
1661 #line 145 "CEvaluationParser.ypp"
1662  {
1663  (yyval) = (yyvsp[(1) - (4)]);
1664  (yyval)->addChild((yyvsp[(3) - (4)]));
1665  mpRootNode = (yyval);
1666  }
1667  break;
1668 
1669  case 12:
1670  /* Line 1778 of yacc.c */
1671 #line 151 "CEvaluationParser.ypp"
1672  {
1673  (yyval) = (yyvsp[(1) - (6)]);
1674  (yyval)->addChild((yyvsp[(3) - (6)]));
1675  (yyval)->addChild((yyvsp[(5) - (6)]));
1676  mpRootNode = (yyval);
1677  }
1678  break;
1679 
1680  case 13:
1681  /* Line 1778 of yacc.c */
1682 #line 158 "CEvaluationParser.ypp"
1683  {
1684  (yyval) = (yyvsp[(1) - (2)]);
1685  (yyval)->addChild((yyvsp[(2) - (2)]));
1686  mpRootNode = (yyval);
1687  }
1688  break;
1689 
1690  case 14:
1691  /* Line 1778 of yacc.c */
1692 #line 164 "CEvaluationParser.ypp"
1693  {
1694  (yyval) = (yyvsp[(1) - (8)]);
1695  (yyval)->addChild((yyvsp[(3) - (8)]));
1696  (yyval)->addChild((yyvsp[(5) - (8)]));
1697  (yyval)->addChild((yyvsp[(7) - (8)]));
1698  mpRootNode = (yyval);
1699  }
1700  break;
1701 
1702  case 15:
1703  /* Line 1778 of yacc.c */
1704 #line 172 "CEvaluationParser.ypp"
1705  {
1706  (yyval) = (yyvsp[(1) - (8)]);
1707  (yyval)->addChild((yyvsp[(3) - (8)]));
1708  (yyval)->addChild((yyvsp[(5) - (8)]));
1709  (yyval)->addChild((yyvsp[(7) - (8)]));
1710  mpRootNode = (yyval);
1711  }
1712  break;
1713 
1714  case 16:
1715  /* Line 1778 of yacc.c */
1716 #line 180 "CEvaluationParser.ypp"
1717  {
1718  (yyval) = (yyvsp[(1) - (1)]);
1719  mpRootNode = (yyval);
1720  }
1721  break;
1722 
1723  case 17:
1724  /* Line 1778 of yacc.c */
1725 #line 186 "CEvaluationParser.ypp"
1726  {
1727  mpRootNode = (yyvsp[(1) - (1)]);
1728  }
1729  break;
1730 
1731  case 18:
1732  /* Line 1778 of yacc.c */
1733 #line 190 "CEvaluationParser.ypp"
1734  {
1735  (yyval) = (yyvsp[(1) - (8)]);
1736  (yyval)->addChild((yyvsp[(3) - (8)]));
1737  (yyval)->addChild((yyvsp[(5) - (8)]));
1738  (yyval)->addChild((yyvsp[(7) - (8)]));
1739  mpRootNode = (yyval);
1740  }
1741  break;
1742 
1743  case 19:
1744  /* Line 1778 of yacc.c */
1745 #line 198 "CEvaluationParser.ypp"
1746  {
1747  (yyval) = (yyvsp[(1) - (8)]);
1748  (yyval)->addChild((yyvsp[(3) - (8)]));
1749  (yyval)->addChild((yyvsp[(5) - (8)]));
1750  (yyval)->addChild((yyvsp[(7) - (8)]));
1751  mpRootNode = (yyval);
1752  }
1753  break;
1754 
1755  case 20:
1756  /* Line 1778 of yacc.c */
1757 #line 206 "CEvaluationParser.ypp"
1758  {
1759  (yyval) = (yyvsp[(2) - (3)]);
1760  (yyval)->addChild((yyvsp[(1) - (3)]));
1761  (yyval)->addChild((yyvsp[(3) - (3)]));
1762  mpRootNode = (yyval);
1763  }
1764  break;
1765 
1766  case 21:
1767  /* Line 1778 of yacc.c */
1768 #line 213 "CEvaluationParser.ypp"
1769  {
1770  setBooleanRequired((yyvsp[(1) - (3)]), true);
1771  (yyval) = (yyvsp[(2) - (3)]);
1772  (yyval)->addChild((yyvsp[(1) - (3)]));
1773  (yyval)->addChild((yyvsp[(3) - (3)]));
1774  mpRootNode = (yyval);
1775  }
1776  break;
1777 
1778  case 22:
1779  /* Line 1778 of yacc.c */
1780 #line 221 "CEvaluationParser.ypp"
1781  {
1782  setBooleanRequired((yyvsp[(3) - (3)]), true);
1783  (yyval) = (yyvsp[(2) - (3)]);
1784  (yyval)->addChild((yyvsp[(1) - (3)]));
1785  (yyval)->addChild((yyvsp[(3) - (3)]));
1786  mpRootNode = (yyval);
1787  }
1788  break;
1789 
1790  case 23:
1791  /* Line 1778 of yacc.c */
1792 #line 229 "CEvaluationParser.ypp"
1793  {
1794  (yyval) = (yyvsp[(2) - (3)]);
1795  (yyval)->addChild((yyvsp[(1) - (3)]));
1796  (yyval)->addChild((yyvsp[(3) - (3)]));
1797  mpRootNode = (yyval);
1798  }
1799  break;
1800 
1801  case 24:
1802  /* Line 1778 of yacc.c */
1803 #line 236 "CEvaluationParser.ypp"
1804  {
1805  (yyval) = (yyvsp[(2) - (3)]);
1806  (yyval)->addChild((yyvsp[(1) - (3)]));
1807  (yyval)->addChild((yyvsp[(3) - (3)]));
1808  mpRootNode = (yyval);
1809  }
1810  break;
1811 
1812  case 25:
1813  /* Line 1778 of yacc.c */
1814 #line 243 "CEvaluationParser.ypp"
1815  {
1816  setBooleanRequired((yyvsp[(1) - (3)]), true);
1817  (yyval) = (yyvsp[(2) - (3)]);
1818  (yyval)->addChild((yyvsp[(1) - (3)]));
1819  (yyval)->addChild((yyvsp[(3) - (3)]));
1820  mpRootNode = (yyval);
1821  }
1822  break;
1823 
1824  case 26:
1825  /* Line 1778 of yacc.c */
1826 #line 251 "CEvaluationParser.ypp"
1827  {
1828  setBooleanRequired((yyvsp[(3) - (3)]), true);
1829  (yyval) = (yyvsp[(2) - (3)]);
1830  (yyval)->addChild((yyvsp[(1) - (3)]));
1831  (yyval)->addChild((yyvsp[(3) - (3)]));
1832  mpRootNode = (yyval);
1833  }
1834  break;
1835 
1836  case 27:
1837  /* Line 1778 of yacc.c */
1838 #line 259 "CEvaluationParser.ypp"
1839  {
1840  (yyval) = (yyvsp[(2) - (3)]);
1841  (yyval)->addChild((yyvsp[(1) - (3)]));
1842  (yyval)->addChild((yyvsp[(3) - (3)]));
1843  mpRootNode = (yyval);
1844  }
1845  break;
1846 
1847  case 28:
1848  /* Line 1778 of yacc.c */
1849 #line 266 "CEvaluationParser.ypp"
1850  {
1851  (yyval) = (yyvsp[(2) - (3)]);
1852  (yyval)->addChild((yyvsp[(1) - (3)]));
1853  (yyval)->addChild((yyvsp[(3) - (3)]));
1854  mpRootNode = (yyval);
1855  }
1856  break;
1857 
1858  case 29:
1859  /* Line 1778 of yacc.c */
1860 #line 273 "CEvaluationParser.ypp"
1861  {
1862  (yyval) = (yyvsp[(2) - (3)]);
1863  (yyval)->addChild((yyvsp[(1) - (3)]));
1864  (yyval)->addChild((yyvsp[(3) - (3)]));
1865  mpRootNode = (yyval);
1866  }
1867  break;
1868 
1869  case 30:
1870  /* Line 1778 of yacc.c */
1871 #line 280 "CEvaluationParser.ypp"
1872  {
1873  (yyval) = (yyvsp[(2) - (3)]);
1874  (yyval)->addChild((yyvsp[(1) - (3)]));
1875  (yyval)->addChild((yyvsp[(3) - (3)]));
1876  mpRootNode = (yyval);
1877  }
1878  break;
1879 
1880  case 31:
1881  /* Line 1778 of yacc.c */
1882 #line 287 "CEvaluationParser.ypp"
1883  {
1884  (yyval) = (yyvsp[(2) - (3)]);
1885  (yyval)->addChild((yyvsp[(1) - (3)]));
1886  (yyval)->addChild((yyvsp[(3) - (3)]));
1887  mpRootNode = (yyval);
1888  }
1889  break;
1890 
1891  case 32:
1892  /* Line 1778 of yacc.c */
1893 #line 294 "CEvaluationParser.ypp"
1894  {
1895  (yyval) = (yyvsp[(2) - (3)]);
1896  (yyval)->addChild((yyvsp[(1) - (3)]));
1897  (yyval)->addChild((yyvsp[(3) - (3)]));
1898  mpRootNode = (yyval);
1899  }
1900  break;
1901 
1902  case 33:
1903  /* Line 1778 of yacc.c */
1904 #line 301 "CEvaluationParser.ypp"
1905  {
1906  setBooleanRequired((yyvsp[(1) - (3)]), true);
1907  (yyval) = (yyvsp[(2) - (3)]);
1908  (yyval)->addChild((yyvsp[(1) - (3)]));
1909  (yyval)->addChild((yyvsp[(3) - (3)]));
1910  mpRootNode = (yyval);
1911  }
1912  break;
1913 
1914  case 34:
1915  /* Line 1778 of yacc.c */
1916 #line 309 "CEvaluationParser.ypp"
1917  {
1918  setBooleanRequired((yyvsp[(3) - (3)]), true);
1919  (yyval) = (yyvsp[(2) - (3)]);
1920  (yyval)->addChild((yyvsp[(1) - (3)]));
1921  (yyval)->addChild((yyvsp[(3) - (3)]));
1922  mpRootNode = (yyval);
1923  }
1924  break;
1925 
1926  case 35:
1927  /* Line 1778 of yacc.c */
1928 #line 317 "CEvaluationParser.ypp"
1929  {
1930  setBooleanRequired((yyvsp[(1) - (3)]), true);
1931  setBooleanRequired((yyvsp[(3) - (3)]), true);
1932  (yyval) = (yyvsp[(2) - (3)]);
1933  (yyval)->addChild((yyvsp[(1) - (3)]));
1934  (yyval)->addChild((yyvsp[(3) - (3)]));
1935  mpRootNode = (yyval);
1936  }
1937  break;
1938 
1939  case 36:
1940  /* Line 1778 of yacc.c */
1941 #line 326 "CEvaluationParser.ypp"
1942  {
1943  (yyval) = (yyvsp[(2) - (3)]);
1944  (yyval)->addChild((yyvsp[(1) - (3)]));
1945  (yyval)->addChild((yyvsp[(3) - (3)]));
1946  mpRootNode = (yyval);
1947  }
1948  break;
1949 
1950  case 37:
1951  /* Line 1778 of yacc.c */
1952 #line 333 "CEvaluationParser.ypp"
1953  {
1954  setBooleanRequired((yyvsp[(1) - (3)]), true);
1955  (yyval) = (yyvsp[(2) - (3)]);
1956  (yyval)->addChild((yyvsp[(1) - (3)]));
1957  (yyval)->addChild((yyvsp[(3) - (3)]));
1958  mpRootNode = (yyval);
1959  }
1960  break;
1961 
1962  case 38:
1963  /* Line 1778 of yacc.c */
1964 #line 341 "CEvaluationParser.ypp"
1965  {
1966  setBooleanRequired((yyvsp[(3) - (3)]), true);
1967  (yyval) = (yyvsp[(2) - (3)]);
1968  (yyval)->addChild((yyvsp[(1) - (3)]));
1969  (yyval)->addChild((yyvsp[(3) - (3)]));
1970  mpRootNode = (yyval);
1971  }
1972  break;
1973 
1974  case 39:
1975  /* Line 1778 of yacc.c */
1976 #line 349 "CEvaluationParser.ypp"
1977  {
1978  setBooleanRequired((yyvsp[(1) - (3)]), true);
1979  setBooleanRequired((yyvsp[(3) - (3)]), true);
1980  (yyval) = (yyvsp[(2) - (3)]);
1981  (yyval)->addChild((yyvsp[(1) - (3)]));
1982  (yyval)->addChild((yyvsp[(3) - (3)]));
1983  mpRootNode = (yyval);
1984  }
1985  break;
1986 
1987  case 40:
1988  /* Line 1778 of yacc.c */
1989 #line 358 "CEvaluationParser.ypp"
1990  {
1991  (yyval) = (yyvsp[(2) - (3)]);
1992  (yyval)->addChild((yyvsp[(1) - (3)]));
1993  (yyval)->addChild((yyvsp[(3) - (3)]));
1994  mpRootNode = (yyval);
1995  }
1996  break;
1997 
1998  case 41:
1999  /* Line 1778 of yacc.c */
2000 #line 365 "CEvaluationParser.ypp"
2001  {
2002  setBooleanRequired((yyvsp[(1) - (3)]), true);
2003  (yyval) = (yyvsp[(2) - (3)]);
2004  (yyval)->addChild((yyvsp[(1) - (3)]));
2005  (yyval)->addChild((yyvsp[(3) - (3)]));
2006  mpRootNode = (yyval);
2007  }
2008  break;
2009 
2010  case 42:
2011  /* Line 1778 of yacc.c */
2012 #line 373 "CEvaluationParser.ypp"
2013  {
2014  setBooleanRequired((yyvsp[(3) - (3)]), true);
2015  (yyval) = (yyvsp[(2) - (3)]);
2016  (yyval)->addChild((yyvsp[(1) - (3)]));
2017  (yyval)->addChild((yyvsp[(3) - (3)]));
2018  mpRootNode = (yyval);
2019  }
2020  break;
2021 
2022  case 43:
2023  /* Line 1778 of yacc.c */
2024 #line 381 "CEvaluationParser.ypp"
2025  {
2026  setBooleanRequired((yyvsp[(1) - (3)]), true);
2027  setBooleanRequired((yyvsp[(3) - (3)]), true);
2028  (yyval) = (yyvsp[(2) - (3)]);
2029  (yyval)->addChild((yyvsp[(1) - (3)]));
2030  (yyval)->addChild((yyvsp[(3) - (3)]));
2031  mpRootNode = (yyval);
2032  }
2033  break;
2034 
2035  case 44:
2036  /* Line 1778 of yacc.c */
2037 #line 390 "CEvaluationParser.ypp"
2038  {
2039  (yyval) = (yyvsp[(2) - (3)]);
2040  mpRootNode = (yyval);
2041  }
2042  break;
2043 
2044  case 45:
2045  /* Line 1778 of yacc.c */
2046 #line 395 "CEvaluationParser.ypp"
2047  {
2048  (yyval) = (yyvsp[(1) - (2)]);
2049  (yyval)->addChild((yyvsp[(2) - (2)]));
2050  mpRootNode = (yyval);
2051  }
2052  break;
2053 
2054  case 46:
2055  /* Line 1778 of yacc.c */
2056 #line 401 "CEvaluationParser.ypp"
2057  {
2058  setBooleanRequired((yyvsp[(2) - (2)]), true);
2059  (yyval) = (yyvsp[(1) - (2)]);
2060  (yyval)->addChild((yyvsp[(2) - (2)]));
2061  mpRootNode = (yyval);
2062  }
2063  break;
2064 
2065  case 47:
2066  /* Line 1778 of yacc.c */
2067 #line 409 "CEvaluationParser.ypp"
2068  {
2069  (yyval) = new CEvaluationNodeVector();
2070  mpNodeList->push_back((yyval));
2071  }
2072  break;
2073 
2074  case 48:
2075  /* Line 1778 of yacc.c */
2076 #line 414 "CEvaluationParser.ypp"
2077  {
2078  (yyval) = (yyvsp[(1) - (2)]);
2079  }
2080  break;
2081 
2082  case 49:
2083  /* Line 1778 of yacc.c */
2084 #line 420 "CEvaluationParser.ypp"
2085  {
2086  (yyval) = new CEvaluationNodeVector();
2087  mpNodeList->push_back((yyval));
2088  (yyval)->addChild((yyvsp[(2) - (2)]));
2089  }
2090  break;
2091 
2092  case 50:
2093  /* Line 1778 of yacc.c */
2094 #line 426 "CEvaluationParser.ypp"
2095  {
2096  (yyval) = new CEvaluationNodeVector();
2097  mpNodeList->push_back((yyval));
2098  (yyval)->addChild((yyvsp[(2) - (2)]));
2099  }
2100  break;
2101 
2102  case 51:
2103  /* Line 1778 of yacc.c */
2104 #line 432 "CEvaluationParser.ypp"
2105  {
2106  (yyval)->addChild((yyvsp[(3) - (3)]));
2107  }
2108  break;
2109 
2110  case 52:
2111  /* Line 1778 of yacc.c */
2112 #line 436 "CEvaluationParser.ypp"
2113  {
2114  (yyval)->addChild((yyvsp[(3) - (3)]));
2115  }
2116  break;
2117 
2118  case 53:
2119  /* Line 1778 of yacc.c */
2120 #line 441 "CEvaluationParser.ypp"
2121  {
2122  (yyval) = (yyvsp[(1) - (2)]);
2123  }
2124  break;
2125 
2126  case 54:
2127  /* Line 1778 of yacc.c */
2128 #line 445 "CEvaluationParser.ypp"
2129  {
2130  (yyval) = (yyvsp[(1) - (3)]);
2131  (yyval)->addChild((yyvsp[(2) - (3)]));
2132  }
2133  break;
2134 
2135  case 55:
2136  /* Line 1778 of yacc.c */
2137 #line 450 "CEvaluationParser.ypp"
2138  {
2139  (yyval) = (yyvsp[(1) - (3)]);
2140  (yyval)->addChild((yyvsp[(2) - (3)]));
2141  }
2142  break;
2143 
2144  case 56:
2145  /* Line 1778 of yacc.c */
2146 #line 456 "CEvaluationParser.ypp"
2147  {
2148  (yyval) = (yyvsp[(1) - (1)]);
2149  }
2150  break;
2151 
2152  case 57:
2153  /* Line 1778 of yacc.c */
2154 #line 460 "CEvaluationParser.ypp"
2155  {
2156  (yyval) = (yyvsp[(1) - (3)]);
2157  (yyval)->addChild((yyvsp[(2) - (3)]));
2158  }
2159  break;
2160 
2161  case 58:
2162  /* Line 1778 of yacc.c */
2163 #line 465 "CEvaluationParser.ypp"
2164  {
2165  (yyval) = (yyvsp[(1) - (3)]);
2166  (yyval)->addChild((yyvsp[(2) - (3)]));
2167  }
2168  break;
2169 
2170  /* Line 1778 of yacc.c */
2171 #line 2145 "CEvaluationParser_yacc.cpppp"
2172 
2173  default: break;
2174  }
2175 
2176  /* User semantic actions sometimes alter yychar, and that requires
2177  that yytoken be updated with the new translation. We take the
2178  approach of translating immediately before every use of yytoken.
2179  One alternative is translating here after every semantic action,
2180  but that translation would be missed if the semantic action invokes
2181  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2182  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2183  incorrect destructor might then be invoked immediately. In the
2184  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2185  to an incorrect destructor call or verbose syntax error message
2186  before the lookahead is translated. */
2187  YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2188 
2189  YYPOPSTACK(yylen);
2190  yylen = 0;
2191  YY_STACK_PRINT(yyss, yyssp);
2192 
2193  *++yyvsp = yyval;
2194 
2195  /* Now `shift' the result of the reduction. Determine what state
2196  that goes to, based on the state we popped back to and the rule
2197  number reduced by. */
2198 
2199  yyn = yyr1[yyn];
2200 
2201  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2202 
2203  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2204  yystate = yytable[yystate];
2205  else
2206  yystate = yydefgoto[yyn - YYNTOKENS];
2207 
2208  goto yynewstate;
2209 
2210  /*------------------------------------.
2211  | yyerrlab -- here on detecting error |
2212  `------------------------------------*/
2213 yyerrlab:
2214  /* Make sure we have latest lookahead translation. See comments at
2215  user semantic actions for why this is necessary. */
2216  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar);
2217 
2218  /* If not already recovering from an error, report this error. */
2219  if (!yyerrstatus)
2220  {
2221  ++yynerrs;
2222 #if ! YYERROR_VERBOSE
2223  yyerror(YY_("syntax error"));
2224 #else
2225 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2226  yyssp, yytoken)
2227  {
2228  char const *yymsgp = YY_("syntax error");
2229  int yysyntax_error_status;
2230  yysyntax_error_status = YYSYNTAX_ERROR;
2231 
2232  if (yysyntax_error_status == 0)
2233  yymsgp = yymsg;
2234  else if (yysyntax_error_status == 1)
2235  {
2236  if (yymsg != yymsgbuf)
2237  YYSTACK_FREE(yymsg);
2238 
2239  yymsg = (char *) YYSTACK_ALLOC(yymsg_alloc);
2240 
2241  if (!yymsg)
2242  {
2243  yymsg = yymsgbuf;
2244  yymsg_alloc = sizeof yymsgbuf;
2245  yysyntax_error_status = 2;
2246  }
2247  else
2248  {
2249  yysyntax_error_status = YYSYNTAX_ERROR;
2250  yymsgp = yymsg;
2251  }
2252  }
2253 
2254  yyerror(yymsgp);
2255 
2256  if (yysyntax_error_status == 2)
2257  goto yyexhaustedlab;
2258  }
2259 # undef YYSYNTAX_ERROR
2260 #endif
2261  }
2262 
2263  if (yyerrstatus == 3)
2264  {
2265  /* If just tried and failed to reuse lookahead token after an
2266  error, discard it. */
2267 
2268  if (yychar <= YYEOF)
2269  {
2270  /* Return failure if at end of input. */
2271  if (yychar == YYEOF)
2272  YYABORT;
2273  }
2274  else
2275  {
2276  yydestruct("Error: discarding",
2277  yytoken, &yylval);
2278  yychar = YYEMPTY;
2279  }
2280  }
2281 
2282  /* Else will try to reuse lookahead token after shifting the error
2283  token. */
2284  goto yyerrlab1;
2285 
2286  /*---------------------------------------------------.
2287  | yyerrorlab -- error raised explicitly by YYERROR. |
2288  `---------------------------------------------------*/
2289 yyerrorlab:
2290 
2291  /* Pacify compilers like GCC when the user code never invokes
2292  YYERROR and the label yyerrorlab therefore never appears in user
2293  code. */
2294  if (/*CONSTCOND*/ 0)
2295  goto yyerrorlab;
2296 
2297  /* Do not reclaim the symbols of the rule which action triggered
2298  this YYERROR. */
2299  YYPOPSTACK(yylen);
2300  yylen = 0;
2301  YY_STACK_PRINT(yyss, yyssp);
2302  yystate = *yyssp;
2303  goto yyerrlab1;
2304 
2305  /*-------------------------------------------------------------.
2306  | yyerrlab1 -- common code for both syntax error and YYERROR. |
2307  `-------------------------------------------------------------*/
2308 yyerrlab1:
2309  yyerrstatus = 3; /* Each real token shifted decrements this. */
2310 
2311  for (;;)
2312  {
2313  yyn = yypact[yystate];
2314 
2315  if (!yypact_value_is_default(yyn))
2316  {
2317  yyn += YYTERROR;
2318 
2319  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2320  {
2321  yyn = yytable[yyn];
2322 
2323  if (0 < yyn)
2324  break;
2325  }
2326  }
2327 
2328  /* Pop the current state because it cannot handle the error token. */
2329  if (yyssp == yyss)
2330  YYABORT;
2331 
2332  yydestruct("Error: popping",
2333  yystos[yystate], yyvsp);
2334  YYPOPSTACK(1);
2335  yystate = *yyssp;
2336  YY_STACK_PRINT(yyss, yyssp);
2337  }
2338 
2340  *++yyvsp = yylval;
2342 
2343  /* Shift the error token. */
2344  YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
2345 
2346  yystate = yyn;
2347  goto yynewstate;
2348 
2349  /*-------------------------------------.
2350  | yyacceptlab -- YYACCEPT comes here. |
2351  `-------------------------------------*/
2352 yyacceptlab:
2353  yyresult = 0;
2354  goto yyreturn;
2355 
2356  /*-----------------------------------.
2357  | yyabortlab -- YYABORT comes here. |
2358  `-----------------------------------*/
2359 yyabortlab:
2360  yyresult = 1;
2361  goto yyreturn;
2362 
2363 #if !defined yyoverflow || YYERROR_VERBOSE
2364  /*-------------------------------------------------.
2365  | yyexhaustedlab -- memory exhaustion comes here. |
2366  `-------------------------------------------------*/
2367 yyexhaustedlab:
2368  yyerror(YY_("memory exhausted"));
2369  yyresult = 2;
2370  /* Fall through. */
2371 #endif
2372 
2373 yyreturn:
2374 
2375  if (yychar != YYEMPTY)
2376  {
2377  /* Make sure we have latest lookahead translation. See comments at
2378  user semantic actions for why this is necessary. */
2379  yytoken = YYTRANSLATE(yychar);
2380  yydestruct("Cleanup: discarding lookahead",
2381  yytoken, &yylval);
2382  }
2383 
2384  /* Do not reclaim the symbols of the rule which action triggered
2385  this YYABORT or YYACCEPT. */
2386  YYPOPSTACK(yylen);
2387  YY_STACK_PRINT(yyss, yyssp);
2388 
2389  while (yyssp != yyss)
2390  {
2391  yydestruct("Cleanup: popping",
2392  yystos[*yyssp], yyvsp);
2393  YYPOPSTACK(1);
2394  }
2395 
2396 #ifndef yyoverflow
2397 
2398  if (yyss != yyssa)
2399  YYSTACK_FREE(yyss);
2400 
2401 #endif
2402 #if YYERROR_VERBOSE
2403 
2404  if (yymsg != yymsgbuf)
2405  YYSTACK_FREE(yymsg);
2406 
2407 #endif
2408  /* Make sure YYID is used. */
2409  return YYID(yyresult);
2410 }
#define yytable_value_is_error(Yytable_value)
#define YYSTACK_BYTES(N)
#define yynerrs
static const yytype_int16 yytable[]
static const yytype_int8 yydefgoto[]
#define YYSTACK_ALLOC
#define YY_REDUCE_PRINT(Rule)
static const yytype_int16 yypact[]
static const yytype_int8 yycheck[]
#define YYMAXDEPTH
#define YYNTOKENS
#define YY_STACK_PRINT(Bottom, Top)
CEvaluationNode * mpRootNode
void setBooleanRequired(CEvaluationNode *pNode, const bool &booleanRequired)
#define YYTERROR
#define YYACCEPT
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define yyerror
static const yytype_uint8 yystos[]
#define YYPOPSTACK(N)
#define YYLEX
static void yydestruct(yymsg, yytype, yyvaluep) const char *yymsg
static const yytype_int8 yypgoto[]
#define YYABORT
#define YYDPRINTF(Args)
#define YYSTYPE
short int yytype_int16
yytype_int16 yyss_alloc
#define YYSIZE_T
#define yypact_value_is_default(Yystate)
#define YYEMPTY
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YYLAST
#define YYFINAL
#define YYEOF
#define YYINITDEPTH
#define YYTRANSLATE(YYX)
#define yychar
#define YY_(Msgid)
static const yytype_uint8 yydefact[]
#define YYID(N)
CEvaluationNode * yyvs_alloc
std::vector< CEvaluationNode * > * mpNodeList
#define yylval
static const yytype_uint8 yyr1[]
#define YYSTACK_FREE
static const yytype_uint8 yyr2[]
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Member Data Documentation

bool CEvaluationParserBase::mBoolean
protected

Definition at line 103 of file CEvaluationLexer.h.

CEvaluationNode* CEvaluationParserBase::mpNode
protected

Definition at line 101 of file CEvaluationLexer.h.

std::vector< CEvaluationNode * >* CEvaluationParserBase::mpNodeList
protected

Definition at line 104 of file CEvaluationLexer.h.

size_t CEvaluationParserBase::mPosition
protected

Definition at line 105 of file CEvaluationLexer.h.

CEvaluationNode* CEvaluationParserBase::mpRootNode
protected

Definition at line 102 of file CEvaluationLexer.h.


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