MCPcopy Create free account
hub / github.com/Genivia/RE-flex / parse_section_1

Method parse_section_1

src/reflex.cpp:1466–1641  ·  view source on GitHub ↗

Parse section 1 of a lex specification

Source from the content-addressed store, hash-verified

1464
1465/// Parse section 1 of a lex specification
1466void Reflex::parse_section_1()
1467{
1468 if (!get_line())
1469 return;
1470 while (!is("%%"))
1471 {
1472 if (linelen == 0)
1473 {
1474 if (!get_line())
1475 return;
1476 }
1477 else
1478 {
1479 if (is_code())
1480 {
1481 size_t pos = 0;
1482 size_t this_lineno = lineno;
1483 std::string code = get_code(pos);
1484 section_1.push_back(Code(code, infile, this_lineno));
1485 }
1486 else if (is_top_code())
1487 {
1488 size_t pos = 0;
1489 size_t this_lineno = lineno;
1490 std::string code = get_code(pos);
1491 section_top.push_back(Code(code, infile, this_lineno));
1492 }
1493 else if (is_class_code())
1494 {
1495 size_t pos = 0;
1496 size_t this_lineno = lineno;
1497 std::string code = get_code(pos);
1498 section_class.push_back(Code(code, infile, this_lineno));
1499 }
1500 else if (is_init_code())
1501 {
1502 size_t pos = 0;
1503 size_t this_lineno = lineno;
1504 std::string code = get_code(pos);
1505 section_init.push_back(Code(code, infile, this_lineno));
1506 }
1507 else if (is_begin_code())
1508 {
1509 size_t pos = 0;
1510 size_t this_lineno = lineno;
1511 std::string code = get_code(pos);
1512 section_begin.push_back(Code(code, infile, this_lineno));
1513 }
1514 else
1515 {
1516 if (linelen > 1 && line.at(0) == '%')
1517 {
1518 size_t pos = 1;
1519 if (as(pos, "include"))
1520 {
1521 do
1522 {
1523 std::string filename;

Callers

nothing calls this directly

Calls 9

CodeClass · 0.85
atMethod · 0.80
errorFunction · 0.50
emptyMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected