in = &i;
output_version_time (o.source);
- o.source << sourceFileInfo;
+ output_line_info (o.source.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
output_version_time (o.header);
Enc encodingOld = encoding;
}
}
}
- o.source << sourceFileInfo;
+ output_line_info (o.source.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
/* restore original char handling mode*/
encoding = encodingOld;
}
-/* Generated by re2c 0.14.1.dev on Tue Feb 24 15:15:39 2015 */
+/* Generated by re2c 0.14.1.dev on Thu Feb 26 12:59:58 2015*/
#include <stdlib.h>
#include <string.h>
#include <iostream>
out << "\n";
out.insert_types ();
out << "\n";
- out << sourceFileInfo;
+ output_line_info (out.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
}
goto echo;
}
{
if (ignore_cnt)
{
- out << "\n" << sourceFileInfo;
+ out << "\n";
+ output_line_info (out.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
}
ignore_eoc = false;
ignore_cnt = 0;
{
if (ignore_cnt)
{
- out << sourceFileInfo;
+ output_line_info (out.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
}
ignore_eoc = false;
ignore_cnt = 0;
genSetCondition(o, ind, rule->code->newcond);
}
- RuleLine rl(*rule);
-
if (!yySetupRule.empty() && !rule->code->autogen)
{
o << indent(ind) << yySetupRule << "\n";
}
- o << file_info(rule->code->source, &rl);
+ output_line_info (o.fragment (), rule->code->line, rule->code->source.c_str ());
o << indent(ind);
if (rule->code->autogen)
{
namespace re2c
{
-OutputFragment & operator << (OutputFragment & o, const file_info & i)
-{
- if (i.ln && !iFlag)
- {
- o << "#line " << i.ln->get_line () << " \"" << i.fname << "\"\n";
- }
- return o;
-}
-
uint OutputFragment::count_lines ()
{
uint lines = 0;
return u;
}
-OutputFile & operator << (OutputFile & u, const file_info & i)
-{
- u.fragment () << i;
- return u;
-}
-
OutputFile & operator << (OutputFile & u, const Str & s)
{
u.fragment () << s;
namespace re2c
{
-struct file_info;
struct Str;
struct Setw
uint count_lines ();
};
-OutputFragment & operator << (OutputFragment & f, const file_info & info);
-
struct OutputBlock
{
std::vector<OutputFragment *> fragments;
friend OutputFile & operator << (OutputFile & o, uint n);
friend OutputFile & operator << (OutputFile & o, const std::string & s);
friend OutputFile & operator << (OutputFile & o, const char * s);
- friend OutputFile & operator << (OutputFile & o, const file_info & i);
friend OutputFile & operator << (OutputFile & o, const Str & s);
friend OutputFile & operator << (OutputFile & o, const Setw & s);
in = &i;
output_version_time (o.source);
- o.source << sourceFileInfo;
+ output_line_info (o.source.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
output_version_time (o.header);
Enc encodingOld = encoding;
}
}
}
- o.source << sourceFileInfo;
+ output_line_info (o.source.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
/* restore original char handling mode*/
encoding = encodingOld;
}
#endif
};
-class RuleLine: public line_number
-{
-public:
-
- RuleLine(const RuleOp& _op)
- : op(_op)
- {
- }
-
- uint get_line() const
- {
- return op.code->line;
- }
-
- const RuleOp& op;
-};
-
RegExp *doAlt(RegExp*, RegExp*);
RegExp *mkAlt(RegExp*, RegExp*);
out << "\n";
out.insert_types ();
out << "\n";
- out << sourceFileInfo;
+ output_line_info (out.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
}
goto echo;
}
{
if (ignore_cnt)
{
- out << sourceFileInfo;
+ output_line_info (out.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
}
ignore_eoc = false;
ignore_cnt = 0;
{
if (ignore_cnt)
{
- out << "\n" << sourceFileInfo;
+ out << "\n";
+ output_line_info (out.fragment (), sourceFileInfo.ln->get_line (), sourceFileInfo.fname.c_str ());
}
ignore_eoc = false;
ignore_cnt = 0;