Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at diam_dict.c:1917

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

DiamDictlex

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/diam_dict.c)expand/collapse
Show more  
 1195  YY_DECL 
 1196  {
 1197          register yy_state_type yy_current_state;
 1198          register char *yy_cp, *yy_bp;
 1199          register int yy_act;
 1200       
 1201  #line 193 "diam_dict.l"
 1202   
 1203  #line 1204 "diam_dict.c"
 1204   
 1205          if ( !(yy_init) )
 1206                  {
 1207                  (yy_init) = 1;
 1208   
 1209  #ifdef YY_USER_INIT 
 1210                  YY_USER_INIT;
 1211  #endif
 1212   
 1213                  if ( ! (yy_start) )
 1214                          (yy_start) = 1; /* first start state */
 1215   
 1216                  if ( ! DiamDictin )
 1217                          DiamDictin = stdin;
 1218   
 1219                  if ( ! DiamDictout )
 1220                          DiamDictout = stdout;
 1221   
 1222                  if ( ! YY_CURRENT_BUFFER ) {
 1223                          DiamDictensure_buffer_stack ();
 1224                          YY_CURRENT_BUFFER_LVALUE =
 1225                                  DiamDict_create_buffer(DiamDictin,YY_BUF_SIZE );
 1226                  }
 1227   
 1228                  DiamDict_load_buffer_state( );
 1229                  }
 1230   
 1231          while ( 1 )             /* loops until end-of-file is reached */
 1232                  {
 1233                  yy_cp = (yy_c_buf_p);
 1234   
 1235                  /* Support of DiamDicttext. */
 1236                  *yy_cp = (yy_hold_char);
 1237   
 1238                  /* yy_bp points to the position in yy_ch_buf of the start of 
 1239                   * the current run.
 1240                   */
 1241                  yy_bp = yy_cp;
 1242   
 1243                  yy_current_state = (yy_start);
 1244  yy_match:
 1245                  do 
 1246                          {
 1247                          register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 1248                          if ( yy_accept[yy_current_state] )
 1249                                  {
 1250                                  (yy_last_accepting_state) = yy_current_state;
 1251                                  (yy_last_accepting_cpos) = yy_cp;
 1252                                  }
 1253                          while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 1254                                  {
 1255                                  yy_current_state = (int) yy_def[yy_current_state];
 1256                                  if ( yy_current_state >= 473 )
 1257                                          yy_c = yy_meta[(unsigned int) yy_c];
 1258                                  }
 1259                          yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 1260                          ++yy_cp;
 1261                          }
 1262                  while ( yy_current_state != 472 );
 1263                  yy_cp = (yy_last_accepting_cpos);
 1264                  yy_current_state = (yy_last_accepting_state);
 1265   
 1266  yy_find_action:
 1267                  yy_act = yy_accept[yy_current_state];
 1268   
 1269                  YY_DO_BEFORE_ACTION;
 1270   
 1271  do_action:      /* This label is used only to access EOF actions. */
 1272   
 1273                  switch ( yy_act )
 1274          { /* beginning of action switch */
 1275                          case 0: /* must back up */
 1276                          /* undo the effects of YY_DO_BEFORE_ACTION */
 1277                          *yy_cp = (yy_hold_char);
 1278                          yy_cp = (yy_last_accepting_cpos);
 1279                          yy_current_state = (yy_last_accepting_state);
 1280                          goto yy_find_action;
 1281   
 1282  case 1:
 1283  /* rule 1 can match eol */
 1284  YY_RULE_SETUP 
 1285  #line 194 "diam_dict.l"
 1286  ;
 1287          YY_BREAK 
 1288  case 2:
 1289  /* rule 2 can match eol */
 1290  YY_RULE_SETUP 
 1291  #line 195 "diam_dict.l"
 1292  ;
 1293          YY_BREAK 
 1294  case 3:
 1295  /* rule 3 can match eol */
 1296  YY_RULE_SETUP 
 1297  #line 197 "diam_dict.l"
 1298  BEGIN LOADING_COMMENT;
 1299          YY_BREAK 
 1300  case 4:
 1301  YY_RULE_SETUP 
 1302  #line 198 "diam_dict.l"
 1303  ;
 1304          YY_BREAK 
 1305  case 5:
 1306  /* rule 5 can match eol */
 1307  YY_RULE_SETUP 
 1308  #line 199 "diam_dict.l"
 1309  BEGIN LOADING;
 1310          YY_BREAK 
 1311  case 6:
 1312  /* rule 6 can match eol */
 1313  YY_RULE_SETUP 
 1314  #line 201 "diam_dict.l"
 1315  BEGIN LOADING_XMLPI;
 1316          YY_BREAK 
 1317  case 7:
 1318  /* rule 7 can match eol */
 1319  YY_RULE_SETUP 
 1320  #line 202 "diam_dict.l"
 1321  ;
 1322          YY_BREAK 
 1323  case 8:
 1324  YY_RULE_SETUP 
 1325  #line 203 "diam_dict.l"
 1326  {
 1327          xmlpi = g_malloc(sizeof(ddict_xmlpi_t));
 1328          xmlpi->name = g_strdup(DiamDicttext);
 1329          xmlpi->key = NULL;
 1330          xmlpi->value = NULL;
 1331          xmlpi->next = NULL;
 1332   
 1333          if (!dict->xmlpis) last_xmlpi = dict->xmlpis = xmlpi;
 1334          else last_xmlpi = last_xmlpi->next = xmlpi;
 1335   
 1336          BEGIN XMLPI_ATTRS;
 1337  }
 1338          YY_BREAK 
 1339  case 9:
 1340  /* rule 9 can match eol */
 1341  YY_RULE_SETUP 
 1342  #line 216 "diam_dict.l"
 1343  BEGIN XMLPI_GETKEY;
 1344          YY_BREAK 
 1345  case 10:
 1346  /* rule 10 can match eol */
 1347  YY_RULE_SETUP 
 1348  #line 217 "diam_dict.l"
 1349  { xmlpi->key = strdup(DiamDicttext); BEGIN XMLPI_ATTRS; }
 1350          YY_BREAK 
 1351  case 11:
 1352  /* rule 11 can match eol */
 1353  YY_RULE_SETUP 
 1354  #line 219 "diam_dict.l"
 1355  BEGIN XMLPI_GETVAL;
 1356          YY_BREAK 
 1357  case 12:
 1358  /* rule 12 can match eol */
 1359  YY_RULE_SETUP 
 1360  #line 220 "diam_dict.l"
 1361  { xmlpi->value = strdup(DiamDicttext); BEGIN XMLPI_ATTRS; }
 1362          YY_BREAK 
 1363  case 13:
 1364  YY_RULE_SETUP 
 1365  #line 222 "diam_dict.l"
 1366   
 1367          YY_BREAK 
 1368  case 14:
 1369  /* rule 14 can match eol */
 1370  YY_RULE_SETUP 
 1371  #line 223 "diam_dict.l"
 1372  BEGIN LOADING;
 1373          YY_BREAK 
 1374  case 15:
 1375  /* rule 15 can match eol */
 1376  YY_RULE_SETUP 
 1377  #line 226 "diam_dict.l"
 1378  BEGIN ENTITY;
 1379          YY_BREAK 
 1380  case 16:
 1381  YY_RULE_SETUP 
 1382  #line 227 "diam_dict.l"
 1383  {
 1384          entity_t* e = g_malloc(sizeof(entity_t));
 1385          e->name = strdup(DiamDicttext);
 1386          e->next = ents.next;
 1387          ents.next = e;
 1388          BEGIN GET_SYSTEM;
 1389          };
 1390          YY_BREAK 
 1391  case 17:
 1392  /* rule 17 can match eol */
 1393  YY_RULE_SETUP 
 1394  #line 234 "diam_dict.l"
 1395  BEGIN GET_FILE;
 1396          YY_BREAK 
 1397  case 18:
 1398  /* rule 18 can match eol */
 1399  YY_RULE_SETUP 
 1400  #line 235 "diam_dict.l"
 1401  {
 1402                  ents.next->file = strdup(DiamDicttext);
 1403                  BEGIN END_ENTITY;
 1404          }
 1405          YY_BREAK 
 1406  case 19:
 1407  /* rule 19 can match eol */
 1408  YY_RULE_SETUP 
 1409  #line 239 "diam_dict.l"
 1410  BEGIN LOADING;
 1411          YY_BREAK 
 1412  case 20:
 1413  /* rule 20 can match eol */
 1414  YY_RULE_SETUP 
 1415  #line 241 "diam_dict.l"
 1416  APPEND("<",1);
 1417          YY_BREAK 
 1418  case 21:
 1419  /* rule 21 can match eol */
 1420  YY_RULE_SETUP 
 1421  #line 243 "diam_dict.l"
 1422  APPEND(">",1);
 1423          YY_BREAK 
 1424  case 22:
 1425  /* rule 22 can match eol */
 1426  YY_RULE_SETUP 
 1427  #line 245 "diam_dict.l"
 1428  APPEND("/>",2);
 1429          YY_BREAK 
 1430  case 23:
 1431  /* rule 23 can match eol */
 1432  YY_RULE_SETUP 
 1433  #line 247 "diam_dict.l"
 1434  APPEND("</",2);
 1435          YY_BREAK 
 1436  case 24:
 1437  /* rule 24 can match eol */
 1438  YY_RULE_SETUP 
 1439  #line 249 "diam_dict.l"
 1440  APPEND(" ",1);
 1441          YY_BREAK 
 1442  case 25:
 1443  /* rule 25 can match eol */
 1444  YY_RULE_SETUP 
 1445  #line 251 "diam_dict.l"
 1446  APPEND(DiamDicttext,DiamDictleng);
 1447          YY_BREAK 
 1448  case 26:
 1449  /* rule 26 can match eol */
 1450  YY_RULE_SETUP 
 1451  #line 253 "diam_dict.l"
 1452  APPEND("=",1);
 1453          YY_BREAK 
 1454  case 27:
 1455  YY_RULE_SETUP 
 1456  #line 255 "diam_dict.l"
 1457  APPEND(DiamDicttext,DiamDictleng);
 1458          YY_BREAK 
 1459  case 28:
 1460  YY_RULE_SETUP 
 1461  #line 257 "diam_dict.l"
 1462  {
 1463          char* p = ++DiamDicttext;
 1464          entity_t* e;
 1465   
 1466          while(*p != ';') p++;
 1467   
 1468          *p = '\0';
 1469   
 1470          D(("looking for entity: %s\n",DiamDicttext));
 1471   
 1472          if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
 1473                  fprintf(stderr, "included files nested to deeply\n");
 1474                  yyterminate();
 1475          }
 1476   
 1477          include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
 1478   
 1479   
 1480          for (e = ents.next; e; e = e->next) {
 1481                  if (strcmp(e->name,DiamDicttext) == 0) {
 1482                          DiamDictin = ddict_open(sys_dir,e->file);
 1483                          D(("entity: %s filename: %s DiamDictin: %p\n",e->name,e->file,DiamDictin));
 1484                          if (!DiamDictin) {
 1485                                  if (errno) {
 1486                                          fprintf(stderr, "Could not open file: '%s', error: %s\n", e->file, strerror(errno) );
 1487                                          yyterminate();
 1488                                  }
 1489                          } else {
 1490                                  DiamDict_switch_to_buffer(DiamDict_create_buffer(DiamDictin,YY_BUF_SIZE ) );
 1491                                  BEGIN LOADING;
 1492                          }
 1493                          break;
 1494                  }
 1495          }
 1496   
 1497          if (!e) {
 1498                  fprintf(stderr, "Could not find entity: '%s'", e->name );
 1499                  yyterminate();
 1500          }
 1501   
 1502  }
 1503          YY_BREAK 
 1504  case YY_STATE_EOF(INITIAL):
 1505  case YY_STATE_EOF(LOADING):
 1506  case YY_STATE_EOF(LOADING_COMMENT):
 1507  case YY_STATE_EOF(LOADING_XMLPI):
 1508  case YY_STATE_EOF(ENTITY):
 1509  case YY_STATE_EOF(GET_SYSTEM):
 1510  case YY_STATE_EOF(GET_FILE):
 1511  case YY_STATE_EOF(END_ENTITY):
 1512  case YY_STATE_EOF(GET_ATTR):
 1513  case YY_STATE_EOF(GET_UINT_ATTR):
 1514  case YY_STATE_EOF(END_ATTR):
 1515  case YY_STATE_EOF(OUTSIDE):
 1516  case YY_STATE_EOF(IN_DICT):
 1517  case YY_STATE_EOF(IN_APPL):
 1518  case YY_STATE_EOF(IN_AVP):
 1519  case YY_STATE_EOF(APPL_ATTRS):
 1520  case YY_STATE_EOF(IGNORE_ATTR):
 1521  case YY_STATE_EOF(TYPE_ATTRS):
 1522  case YY_STATE_EOF(GAVP_ATTRS):
 1523  case YY_STATE_EOF(ENUM_ATTRS):
 1524  case YY_STATE_EOF(AVP_ATTRS):
 1525  case YY_STATE_EOF(VENDOR_ATTRS):
 1526  case YY_STATE_EOF(COMMAND_ATTRS):
 1527  case YY_STATE_EOF(TYPEDEFN_ATTRS):
 1528  case YY_STATE_EOF(XMLPI_ATTRS):
 1529  case YY_STATE_EOF(XMLPI_GETKEY):
 1530  case YY_STATE_EOF(XMLPI_GETVAL):
 1531  case YY_STATE_EOF(XMLPI_ENDATTR):
 1532  #line 299 "diam_dict.l"
 1533  {
 1534          if (!DiamDictin) yyterminate();
 1535   
 1536          fclose(DiamDictin);
 1537          D(("closing: %p %i\n",DiamDictin,include_stack_ptr));
 1538   
 1539          if ( --include_stack_ptr < 0 ) {
 1540                  D(("DONE READING\n"));
 1541                  DiamDictin = NULL;
 1542                  yyterminate();
 1543          } else {
 1544                  DiamDict_delete_buffer(YY_CURRENT_BUFFER );
 1545                  DiamDict_switch_to_buffer(include_stack[include_stack_ptr]);
 1546                  BEGIN LOADING;
 1547          }
 1548  }
 1549          YY_BREAK 
 1550  case 29:
 1551  /* rule 29 can match eol */
 1552  YY_RULE_SETUP 
 1553  #line 317 "diam_dict.l"
 1554  {
 1555          *attr_str = strdup(DiamDicttext);
 1556          D(("%s\n",DiamDicttext));
 1557          attr_str = NULL;
 1558          BEGIN END_ATTR;
 1559  }
 1560          YY_BREAK 
 1561  case 30:
 1562  YY_RULE_SETUP 
 1563  #line 324 "diam_dict.l"
 1564  {
 1565          *attr_uint = strtoul(DiamDicttext,NULL,10);
 1566          D(("%s\n",DiamDicttext););
 1567          attr_uint = NULL;
 1568          BEGIN END_ATTR;
 1569  }
 1570          YY_BREAK 
 1571  case 31:
 1572  YY_RULE_SETUP 
 1573  #line 331 "diam_dict.l"
 1574  {       yy_pop_state(); }
 1575          YY_BREAK 
 1576  case 32:
 1577  YY_RULE_SETUP 
 1578  #line 333 "diam_dict.l"
 1579  {
 1580          /* XXX: should go?*/
 1581          D(("{%s}",DiamDicttext));
 1582  }
 1583          YY_BREAK 
 1584  case 33:
 1585  /* rule 33 can match eol */
 1586  YY_RULE_SETUP 
 1587  #line 338 "diam_dict.l"
 1588  {
 1589          D(("=>%s<=\n",DiamDicttext));
 1590          yy_pop_state();
 1591  }
 1592          YY_BREAK 
 1593  case 34:
 1594  YY_RULE_SETUP 
 1595  #line 343 "diam_dict.l"
 1596  {
 1597          D(("dictionary_start\n"));
 1598   
 1599          BEGIN IN_DICT;
 1600  }
 1601          YY_BREAK 
 1602  case 35:
 1603  /* rule 35 can match eol */
 1604  YY_RULE_SETUP 
 1605  #line 349 "diam_dict.l"
 1606  {
 1607          D(("base_start\n"));
 1608          BEGIN IN_APPL;
 1609  }
 1610          YY_BREAK 
 1611  case 36:
 1612  YY_RULE_SETUP 
 1613  #line 354 "diam_dict.l"
 1614  {
 1615          D(("applictation_start\n"));
 1616   
 1617          appl = g_malloc(sizeof(ddict_application_t));
 1618          appl->name = NULL;
 1619          appl->code = 0;
 1620          appl->next = NULL;
 1621   
 1622          if (!dict->applications) last_appl = dict->applications = appl;
 1623          else last_appl = last_appl->next = appl;
 1624   
 1625          BEGIN APPL_ATTRS;
 1626  }
 1627          YY_BREAK 
 1628  case 37:
 1629  YY_RULE_SETUP 
 1630  #line 368 "diam_dict.l"
 1631  { ATTR_STR(appl->name); }
 1632          YY_BREAK 
 1633  case 38:
 1634  YY_RULE_SETUP 
 1635  #line 369 "diam_dict.l"
 1636  { ATTR_UINT(appl->code); }
 1637          YY_BREAK 
 1638  case 39:
 1639  YY_RULE_SETUP 
 1640  #line 371 "diam_dict.l"
 1641  BEGIN IN_APPL;
 1642          YY_BREAK 
 1643  case 40:
 1644  YY_RULE_SETUP 
 1645  #line 372 "diam_dict.l"
 1646  BEGIN IN_DICT;
 1647          YY_BREAK 
 1648  case 41:
 1649  YY_RULE_SETUP 
 1650  #line 374 "diam_dict.l"
 1651  ;
 1652          YY_BREAK 
 1653  case 42:
 1654  YY_RULE_SETUP 
 1655  #line 376 "diam_dict.l"
 1656  {
 1657          D(("command_start\n"));
 1658   
 1659          cmd = g_malloc(sizeof(ddict_cmd_t));
 1660          cmd->name = NULL;
 1661          cmd->vendor = NULL;
 1662          cmd->code = 0;
 1663          cmd->next = NULL;
 1664   
 1665          if (!dict->cmds) last_cmd = dict->cmds = cmd;
 1666          else last_cmd = last_cmd->next = cmd;
 1667   
 1668          BEGIN COMMAND_ATTRS;
 1669  }
 1670          YY_BREAK 
 1671  case 43:
 1672  YY_RULE_SETUP 
 1673  #line 391 "diam_dict.l"
 1674  { ATTR_STR(cmd->name); }
 1675          YY_BREAK 
 1676  case 44:
 1677  YY_RULE_SETUP 
 1678  #line 392 "diam_dict.l"
 1679  { ATTR_STR(cmd->vendor); }
 1680          YY_BREAK 
 1681  case 45:
 1682  YY_RULE_SETUP 
 1683  #line 393 "diam_dict.l"
 1684  { ATTR_UINT(cmd->code); }
 1685          YY_BREAK 
 1686  case 46:
 1687  #line 395 "diam_dict.l"
 1688  case 47:
 1689  YY_RULE_SETUP 
 1690  #line 395 "diam_dict.l"
 1691  { BEGIN IN_APPL; }
 1692          YY_BREAK 
 1693  case 48:
 1694  YY_RULE_SETUP 
 1695  #line 397 "diam_dict.l"
 1696  {
 1697          D(("vendor_start\n"));
 1698   
 1699          vnd = g_malloc(sizeof(ddict_vendor_t));
 1700          vnd->name = NULL;
 1701          vnd->code = 0;
 1702          vnd->next = NULL;
 1703   
 1704          if (!dict->vendors) last_vnd = dict->vendors = vnd;
 1705          else last_vnd = last_vnd->next = vnd;
 1706   
 1707          BEGIN VENDOR_ATTRS;
 1708  }
 1709          YY_BREAK 
 1710  case 49:
 1711  YY_RULE_SETUP 
 1712  #line 411 "diam_dict.l"
 1713  { ATTR_STR(vnd->desc); }
 1714          YY_BREAK 
 1715  case 50:
 1716  YY_RULE_SETUP 
 1717  #line 412 "diam_dict.l"
 1718  { ATTR_STR(vnd->name); }
 1719          YY_BREAK 
 1720  case 51:
 1721  YY_RULE_SETUP 
 1722  #line 413 "diam_dict.l"
 1723  { ATTR_UINT(vnd->code); }
 1724          YY_BREAK 
 1725  case 52:
 1726  #line 415 "diam_dict.l"
 1727  case 53:
 1728  YY_RULE_SETUP 
 1729  #line 415 "diam_dict.l"
 1730  { BEGIN IN_APPL; }
 1731          YY_BREAK 
 1732  case 54:
 1733  YY_RULE_SETUP 
 1734  #line 417 "diam_dict.l"
 1735  {
 1736          D(("typedefn_start\n"));
 1737   
 1738          typedefn = g_malloc(sizeof(ddict_typedefn_t));
 1739          typedefn->name = NULL;
 1740          typedefn->parent = NULL;
 1741          typedefn->next = NULL;
 1742   
 1743          if (!dict->typedefns) last_typedefn = dict->typedefns = typedefn;
 1744          else last_typedefn = last_typedefn->next = typedefn;
 1745   
 1746          BEGIN TYPEDEFN_ATTRS;
 1747  }
 1748          YY_BREAK 
 1749  case 55:
 1750  YY_RULE_SETUP 
 1751  #line 431 "diam_dict.l"
 1752  { ATTR_STR(typedefn->name); }
 1753          YY_BREAK 
 1754  case 56:
 1755  YY_RULE_SETUP 
 1756  #line 432 "diam_dict.l"
 1757  { ATTR_STR(typedefn->parent); }
 1758          YY_BREAK 
 1759  case 57:
 1760  #line 434 "diam_dict.l"
 1761  case 58:
 1762  YY_RULE_SETUP 
 1763  #line 434 "diam_dict.l"
 1764  { BEGIN IN_APPL; }
 1765          YY_BREAK 
 1766  case 59:
 1767  YY_RULE_SETUP 
 1768  #line 437 "diam_dict.l"
 1769  {
 1770          D(("avp_start\n"));
 1771   
 1772          avp = g_malloc(sizeof(ddict_avp_t));
 1773          avp->name = NULL;
 1774          avp->description = NULL;
 1775          avp->vendor = NULL;
 1776          avp->code = 0;
 1777          avp->type = NULL;
 1778          avp->enums = NULL;
 1779          avp->gavps = NULL;
 1780          avp->next = NULL;
 1781   
 1782          if (! dict->avps ) last_avp = dict->avps = avp;
 1783          else last_avp = last_avp->next = avp;
 1784   
 1785          BEGIN AVP_ATTRS;
 1786  }
 1787          YY_BREAK 
 1788  case 60:
 1789  YY_RULE_SETUP 
 1790  #line 456 "diam_dict.l"
 1791  { ATTR_STR(avp->name); }
 1792          YY_BREAK 
 1793  case 61:
 1794  YY_RULE_SETUP 
 1795  #line 457 "diam_dict.l"
 1796  { ATTR_STR(avp->description); }
 1797          YY_BREAK 
 1798  case 62:
 1799  YY_RULE_SETUP 
 1800  #line 458 "diam_dict.l"
 1801  { ATTR_STR(avp->vendor); }
 1802          YY_BREAK 
 1803  case 63:
 1804  YY_RULE_SETUP 
 1805  #line 459 "diam_dict.l"
 1806  { ATTR_UINT(avp->code); }
 1807          YY_BREAK 
 1808  case 64:
 1809  YY_RULE_SETUP 
 1810  #line 460 "diam_dict.l"
 1811  { BEGIN IN_AVP;  }
 1812          YY_BREAK 
 1813  case 65:
 1814  YY_RULE_SETUP 
 1815  #line 461 "diam_dict.l"
 1816  { BEGIN IN_APPL; }
 1817          YY_BREAK 
 1818  case 66:
 1819  YY_RULE_SETUP 
 1820  #line 464 "diam_dict.l"
 1821  { avp->type = strdup("Grouped"); };
 1822          YY_BREAK 
 1823  case 67:
 1824  YY_RULE_SETUP 
 1825  #line 465 "diam_dict.l"
 1826  ;
 1827          YY_BREAK 
 1828  case 68:
 1829  YY_RULE_SETUP 
 1830  #line 467 "diam_dict.l"
 1831  { BEGIN TYPE_ATTRS; }
 1832          YY_BREAK 
 1833  case 69:
 1834  YY_RULE_SETUP 
 1835  #line 468 "diam_dict.l"
 1836  { ATTR_STR(avp->type); }
 1837          YY_BREAK 
 1838  case 70:
 1839  YY_RULE_SETUP 
 1840  #line 470 "diam_dict.l"
 1841  {
 1842          D(("gavp_start\n"));
 1843   
 1844          gavp = g_malloc(sizeof(ddict_gavp_t));
 1845          gavp->name = NULL;
 1846          gavp->code = 0;
 1847          gavp->next = NULL;
 1848   
 1849          if (!avp->gavps) last_gavp = avp->gavps = gavp;
 1850          else last_gavp = last_gavp->next = gavp;
 1851   
 1852          BEGIN GAVP_ATTRS;
 1853  }
 1854          YY_BREAK 
 1855  case 71:
 1856  YY_RULE_SETUP 
 1857  #line 485 "diam_dict.l"
 1858  { ATTR_STR(gavp->name); }
 1859          YY_BREAK 
 1860  case 72:
 1861  YY_RULE_SETUP 
 1862  #line 488 "diam_dict.l"
 1863  {
 1864          D(("enum_start\n"));
 1865   
 1866          enumitem = g_malloc(sizeof(ddict_enum_t));
 1867          enumitem->name = NULL;
 1868          enumitem->code = 0;
 1869          enumitem->next = NULL;
 1870   
 1871          if (!avp->enums) last_enumitem = avp->enums = enumitem;
 1872          else last_enumitem = last_enumitem->next = enumitem;
 1873   
 1874          BEGIN ENUM_ATTRS;
 1875  }
 1876          YY_BREAK 
 1877  case 73:
 1878  YY_RULE_SETUP 
 1879  #line 503 "diam_dict.l"
 1880  { ATTR_STR(enumitem->name); }
 1881          YY_BREAK 
 1882  case 74:
 1883  YY_RULE_SETUP 
 1884  #line 504 "diam_dict.l"
 1885  { ATTR_UINT(enumitem->code); }
 1886          YY_BREAK 
 1887  case 75:
 1888  YY_RULE_SETUP 
 1889  #line 506 "diam_dict.l"
 1890  { BEGIN IN_AVP; }
 1891          YY_BREAK 
 1892  case 76:
 1893  YY_RULE_SETUP 
 1894  #line 507 "diam_dict.l"
 1895  { BEGIN IN_AVP; }
 1896          YY_BREAK 
 1897  case 77:
 1898  YY_RULE_SETUP 
 1899  #line 509 "diam_dict.l"
 1900  { D(("avp_end")); BEGIN IN_APPL; }
 1901          YY_BREAK 
 1902  case 78:
 1903  #line 512 "diam_dict.l"
 1904  case 79:
 1905  YY_RULE_SETUP 
 1906  #line 512 "diam_dict.l"
 1907  {
 1908          BEGIN IN_DICT;
 1909  }
 1910          YY_BREAK 
 1911  case 80:
 1912  YY_RULE_SETUP 
 1913  #line 516 "diam_dict.l"
 1914  {
 1915          yyterminate();
 1916  }
 1917          YY_BREAK 
 1918  case 81:
 1919  YY_RULE_SETUP 
 1920  #line 520 "diam_dict.l"
 1921  IGNORE();
 1922          YY_BREAK 
 1923  case 82:
 1924  YY_RULE_SETUP 
 1925  #line 522 "diam_dict.l"
 1926  ;
 1927          YY_BREAK 
 1928  case 83:
 1929  YY_RULE_SETUP 
 1930  #line 529 "diam_dict.l"
 1931  ECHO;
 1932          YY_BREAK 
 1933  #line 1934 "diam_dict.c"
 1934   
 1935          case YY_END_OF_BUFFER:
 1936                  {
 1937                  /* Amount of text matched not including the EOB char. */
 1938                  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 1939   
 1940                  /* Undo the effects of YY_DO_BEFORE_ACTION. */
 1941                  *yy_cp = (yy_hold_char);
 1942                  YY_RESTORE_YY_MORE_OFFSET 
 1943   
 1944                  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 1945                          {
 1946                          /* We're scanning a new file or input source.  It's
 1947                           * possible that this happened because the user 
 1948                           * just pointed DiamDictin at a new source and called 
 1949                           * DiamDictlex().  If so, then we have to assure 
 1950                           * consistency between YY_CURRENT_BUFFER and our 
 1951                           * globals.  Here is the right place to do so, because 
 1952                           * this is the first action (other than possibly a 
 1953                           * back-up) that will match for the new input source.
 1954                           */
 1955                          (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 1956                          YY_CURRENT_BUFFER_LVALUE->yy_input_file = DiamDictin;
 1957                          YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 1958                          }
 1959   
 1960                  /* Note that here we test for yy_c_buf_p "<=" to the position 
 1961                   * of the first EOB in the buffer, since yy_c_buf_p will 
 1962                   * already have been incremented past the NUL character
 1963                   * (since all states make transitions on EOB to the
 1964                   * end-of-buffer state).  Contrast this with the test
 1965                   * in input().
 1966                   */
 1967                  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 1968                          { /* This was really a NUL. */
 1969                          yy_state_type yy_next_state;
 1970   
 1971                          (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 1972   
 1973                          yy_current_state = yy_get_previous_state(  );
 1974   
 1975                          /* Okay, we're now positioned to make the NUL
 1976                           * transition.  We couldn't have 
 1977                           * yy_get_previous_state() go ahead and do it 
 1978                           * for us because it doesn't know how to deal
 1979                           * with the possibility of jamming (and we don't
 1980                           * want to build jamming into it because then it 
 1981                           * will run more slowly).
 1982                           */
 1983   
 1984                          yy_next_state = yy_try_NUL_trans( yy_current_state );
 1985   
 1986                          yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1987   
 1988                          if ( yy_next_state )
 1989                                  {
 1990                                  /* Consume the NUL. */
 1991                                  yy_cp = ++(yy_c_buf_p);
 1992                                  yy_current_state = yy_next_state;
 1993                                  goto yy_match;
 1994                                  }
 1995   
 1996                          else 
 1997                                  {
 1998                                  yy_cp = (yy_last_accepting_cpos);
 1999                                  yy_current_state = (yy_last_accepting_state);
 2000                                  goto yy_find_action;
 2001                                  }
 2002                          }
 2003   
 2004                  else switch ( yy_get_next_buffer(  ) )
 2005                          {
 2006                          case EOB_ACT_END_OF_FILE:
 2007                                  {
 2008                                  (yy_did_buffer_switch_on_eof) = 0;
 2009   
 2010                                  if ( DiamDictwrap( ) )
 2011                                          {
 2012                                          /* Note: because we've taken care in 
 2013                                           * yy_get_next_buffer() to have set up
 2014                                           * DiamDicttext, we can now set up 
 2015                                           * yy_c_buf_p so that if some total
 2016                                           * hoser (like flex itself) wants to
 2017                                           * call the scanner after we return the 
 2018                                           * YY_NULL, it'll still work - another 
 2019                                           * YY_NULL will get returned.
 2020                                           */
 2021                                          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 2022   
 2023                                          yy_act = YY_STATE_EOF(YY_START);
 2024                                          goto do_action;
 2025                                          }
 2026   
 2027                                  else 
 2028                                          {
 2029                                          if ( ! (yy_did_buffer_switch_on_eof) )
 2030                                                  YY_NEW_FILE;
 2031                                          }
 2032                                  break;
 2033                                  }
 2034   
 2035                          case EOB_ACT_CONTINUE_SCAN:
 2036                                  (yy_c_buf_p) =
 2037                                          (yytext_ptr) + yy_amount_of_matched_text;
 2038   
 2039                                  yy_current_state = yy_get_previous_state(  );
 2040   
 2041                                  yy_cp = (yy_c_buf_p);
 2042                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 2043                                  goto yy_match;
 2044   
 2045                          case EOB_ACT_LAST_MATCH:
 2046                                  (yy_c_buf_p) =
 2047                                  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 2048   
 2049                                  yy_current_state = yy_get_previous_state(  );
 2050   
 2051                                  yy_cp = (yy_c_buf_p);
 2052                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 2053                                  goto yy_find_action;
 2054                          }
 2055                  break;
 2056                  }
 2057   
 2058          default:
 2059                  YY_FATAL_ERROR(
 2060                          "fatal flex scanner internal error--no action found" );
 2061          } /* end of action switch */
 2062                  } /* end of scanning one token */
 2063  } /* end of DiamDictlex */
Show more  




Change Warning 2297.30355 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: