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

Method write_code

src/reflex.cpp:2454–2471  ·  view source on GitHub ↗

Write lines of code to lex.yy.cpp annotated with #line source info

Source from the content-addressed store, hash-verified

2452
2453/// Write lines of code to lex.yy.cpp annotated with #line source info
2454void Reflex::write_code(const Codes& codes)
2455{
2456 if (!out->good())
2457 return;
2458 size_t this_lineno = 0;
2459 for (Codes::const_iterator code = codes.begin(); code != codes.end(); ++code)
2460 {
2461 if (code->lineno != this_lineno && options["noline"].empty())
2462 {
2463 *out << "#line " << code->lineno;
2464 if (!code->file.empty())
2465 *out << " \"" << escape_bs(code->file) << "\"";
2466 *out << '\n';
2467 }
2468 *out << code->line << '\n';
2469 this_lineno = code->lineno + 1;
2470 }
2471}
2472
2473/// Write a line(s) of code to lex.yy.cpp annotated with #line source info
2474void Reflex::write_code(const Code& code)

Callers

nothing calls this directly

Calls 4

goodMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected