qlalr: Fix startup crash in static builds
Replace the global variables qout, qerr by a functions to delay the initialization. Task-number: QTBUG-68166 Change-Id: Ib023da1bccc7eabc6e633ccb8945e5f209c5765e Reviewed-by: Kevin Funk <kevin.funk@kdab.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
c580644fe9
commit
1b7337d23d
@ -186,7 +186,7 @@ void CppGenerator::operator () ()
|
|||||||
else if (u < 0)
|
else if (u < 0)
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qout << "*** Warning. Found a reduce/reduce conflict in state " << q << " on token ``" << s << "'' between rule "
|
qout() << "*** Warning. Found a reduce/reduce conflict in state " << q << " on token ``" << s << "'' between rule "
|
||||||
<< r << " and " << -u << endl;
|
<< r << " and " << -u << endl;
|
||||||
|
|
||||||
++reduce_reduce_conflict_count;
|
++reduce_reduce_conflict_count;
|
||||||
@ -194,7 +194,7 @@ void CppGenerator::operator () ()
|
|||||||
u = qMax (u, -r);
|
u = qMax (u, -r);
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qout << "\tresolved using rule " << -u << endl;
|
qout() << "\tresolved using rule " << -u << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (u > 0)
|
else if (u > 0)
|
||||||
@ -227,7 +227,7 @@ void CppGenerator::operator () ()
|
|||||||
++shift_reduce_conflict_count;
|
++shift_reduce_conflict_count;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qout << "*** Warning. Found a shift/reduce conflict in state " << q << " on token ``" << s << "'' with rule " << r << endl;
|
qout() << "*** Warning. Found a shift/reduce conflict in state " << q << " on token ``" << s << "'' with rule " << r << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,10 +238,10 @@ void CppGenerator::operator () ()
|
|||||||
{
|
{
|
||||||
if (shift_reduce_conflict_count != grammar.expected_shift_reduce
|
if (shift_reduce_conflict_count != grammar.expected_shift_reduce
|
||||||
|| reduce_reduce_conflict_count != grammar.expected_reduce_reduce)
|
|| reduce_reduce_conflict_count != grammar.expected_reduce_reduce)
|
||||||
qerr << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl;
|
qerr() << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qout << endl << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl
|
qout() << endl << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ void CppGenerator::operator () ()
|
|||||||
RulePointer rule = grammar.rules.begin () + i;
|
RulePointer rule = grammar.rules.begin () + i;
|
||||||
|
|
||||||
if (rule != grammar.goal)
|
if (rule != grammar.goal)
|
||||||
qerr << "*** Warning: Rule ``" << *rule << "'' is useless!" << endl;
|
qerr() << "*** Warning: Rule ``" << *rule << "'' is useless!" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,8 +40,17 @@
|
|||||||
#define QLALR_NO_DEBUG_LOOKAHEADS
|
#define QLALR_NO_DEBUG_LOOKAHEADS
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
QTextStream qerr (stderr, QIODevice::WriteOnly);
|
QTextStream &qerr()
|
||||||
QTextStream qout (stdout, QIODevice::WriteOnly);
|
{
|
||||||
|
static QTextStream result(stderr, QIODevice::WriteOnly);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTextStream &qout()
|
||||||
|
{
|
||||||
|
static QTextStream result(stdout, QIODevice::WriteOnly);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator < (Name a, Name b)
|
bool operator < (Name a, Name b)
|
||||||
{
|
{
|
||||||
@ -303,7 +312,7 @@ void Automaton::buildNullables ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_NULLABLES
|
#ifndef QLALR_NO_DEBUG_NULLABLES
|
||||||
qerr << "nullables = {" << nullables << endl;
|
qerr() << "nullables = {" << nullables << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,7 +455,7 @@ void Automaton::buildLookbackSets ()
|
|||||||
lookbacks.insert (item, Lookback (p, A));
|
lookbacks.insert (item, Lookback (p, A));
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_LOOKBACKS
|
#ifndef QLALR_NO_DEBUG_LOOKBACKS
|
||||||
qerr << "*** (" << id (q) << ", " << *rule << ") lookback (" << id (p) << ", " << *A << ")" << endl;
|
qerr() << "*** (" << id (q) << ", " << *rule << ") lookback (" << id (p) << ", " << *A << ")" << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -477,7 +486,7 @@ void Automaton::buildDirectReads ()
|
|||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_DIRECT_READS
|
#ifndef QLALR_NO_DEBUG_DIRECT_READS
|
||||||
for (QMap<Name, NameSet>::iterator dr = q->reads.begin (); dr != q->reads.end (); ++dr)
|
for (QMap<Name, NameSet>::iterator dr = q->reads.begin (); dr != q->reads.end (); ++dr)
|
||||||
qerr << "*** DR(" << id (q) << ", " << dr.key () << ") = " << dr.value () << endl;
|
qerr() << "*** DR(" << id (q) << ", " << dr.key () << ") = " << dr.value () << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -506,11 +515,11 @@ void Automaton::buildReadsDigraph ()
|
|||||||
source->insertEdge (target);
|
source->insertEdge (target);
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_READS
|
#ifndef QLALR_NO_DEBUG_READS
|
||||||
qerr << "*** ";
|
qerr() << "*** ";
|
||||||
dump (qerr, source);
|
dump (qerr(), source);
|
||||||
qerr << " reads ";
|
qerr() << " reads ";
|
||||||
dump (qerr, target);
|
dump (qerr(), target);
|
||||||
qerr << endl;
|
qerr() << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -545,7 +554,7 @@ void Automaton::visitReadNode (ReadNode node)
|
|||||||
_M_reads_stack.push (node);
|
_M_reads_stack.push (node);
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_INCLUDES
|
#ifndef QLALR_NO_DEBUG_INCLUDES
|
||||||
// qerr << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << endl;
|
// qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (ReadsGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
|
for (ReadsGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
|
||||||
@ -625,7 +634,7 @@ void Automaton::buildIncludesDigraph ()
|
|||||||
source->insertEdge (target);
|
source->insertEdge (target);
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_INCLUDES
|
#ifndef QLALR_NO_DEBUG_INCLUDES
|
||||||
qerr << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << endl;
|
qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << endl;
|
||||||
#endif // QLALR_NO_DEBUG_INCLUDES
|
#endif // QLALR_NO_DEBUG_INCLUDES
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@ -647,7 +656,7 @@ void Automaton::buildIncludesDigraph ()
|
|||||||
source->insertEdge (target);
|
source->insertEdge (target);
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_INCLUDES
|
#ifndef QLALR_NO_DEBUG_INCLUDES
|
||||||
qerr << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << endl;
|
qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << endl;
|
||||||
#endif // QLALR_NO_DEBUG_INCLUDES
|
#endif // QLALR_NO_DEBUG_INCLUDES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -664,7 +673,7 @@ void Automaton::visitIncludeNode (IncludeNode node)
|
|||||||
_M_includes_stack.push (node);
|
_M_includes_stack.push (node);
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_INCLUDES
|
#ifndef QLALR_NO_DEBUG_INCLUDES
|
||||||
// qerr << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << endl;
|
// qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (IncludesGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
|
for (IncludesGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
|
||||||
@ -676,11 +685,11 @@ void Automaton::visitIncludeNode (IncludeNode node)
|
|||||||
node->dfn = qMin (N, r->dfn);
|
node->dfn = qMin (N, r->dfn);
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_INCLUDES
|
#ifndef QLALR_NO_DEBUG_INCLUDES
|
||||||
qerr << "*** Merge. follows";
|
qerr() << "*** Merge. follows";
|
||||||
dump (qerr, node);
|
dump (qerr(), node);
|
||||||
qerr << " += follows";
|
qerr() << " += follows";
|
||||||
dump (qerr, r);
|
dump (qerr(), r);
|
||||||
qerr << endl;
|
qerr() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NameSet &dst = node->data.state->follows [node->data.nt];
|
NameSet &dst = node->data.state->follows [node->data.nt];
|
||||||
@ -714,9 +723,9 @@ void Automaton::buildLookaheads ()
|
|||||||
StatePointer q = lookback.state;
|
StatePointer q = lookback.state;
|
||||||
|
|
||||||
#ifndef QLALR_NO_DEBUG_LOOKAHEADS
|
#ifndef QLALR_NO_DEBUG_LOOKAHEADS
|
||||||
qerr << "(" << id (p) << ", " << *item->rule << ") lookbacks ";
|
qerr() << "(" << id (p) << ", " << *item->rule << ") lookbacks ";
|
||||||
dump (qerr, lookback);
|
dump (qerr(), lookback);
|
||||||
qerr << " with follows (" << id (q) << ", " << lookback.nt << ") = " << q->follows [lookback.nt] << endl;
|
qerr() << " with follows (" << id (q) << ", " << lookback.nt << ") = " << q->follows [lookback.nt] << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lookaheads [item].insert (q->follows [lookback.nt].begin (), q->follows [lookback.nt].end ());
|
lookaheads [item].insert (q->follows [lookback.nt].begin (), q->follows [lookback.nt].end ());
|
||||||
|
@ -261,7 +261,7 @@ int Recognizer::nextToken()
|
|||||||
if (ch == QLatin1Char ('"'))
|
if (ch == QLatin1Char ('"'))
|
||||||
inp ();
|
inp ();
|
||||||
else
|
else
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl;
|
||||||
|
|
||||||
_M_current_value = text;
|
_M_current_value = text;
|
||||||
return (token = STRING_LITERAL);
|
return (token = STRING_LITERAL);
|
||||||
@ -314,7 +314,7 @@ int Recognizer::nextToken()
|
|||||||
return (token = PREC);
|
return (token = PREC);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << endl;
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
return (token = ERROR);
|
return (token = ERROR);
|
||||||
}
|
}
|
||||||
@ -439,7 +439,7 @@ bool Recognizer::parse (const QString &input_file)
|
|||||||
QFile file(_M_input_file);
|
QFile file(_M_input_file);
|
||||||
if (! file.open(QFile::ReadOnly))
|
if (! file.open(QFile::ReadOnly))
|
||||||
{
|
{
|
||||||
qerr << "qlalr: no input file\n";
|
qerr() << "qlalr: no input file\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -659,7 +659,7 @@ case $rule_number: {
|
|||||||
|
|
||||||
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
|
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
|
||||||
{
|
{
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -683,7 +683,7 @@ case $rule_number: {
|
|||||||
|
|
||||||
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
|
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
|
||||||
{
|
{
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -712,7 +712,7 @@ case $rule_number: {
|
|||||||
Name tok = _M_grammar->intern (sym(2));
|
Name tok = _M_grammar->intern (sym(2));
|
||||||
if (! _M_grammar->isTerminal (tok))
|
if (! _M_grammar->isTerminal (tok))
|
||||||
{
|
{
|
||||||
qerr << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << endl;
|
||||||
_M_current_rule->prec = _M_grammar->names.end ();
|
_M_current_rule->prec = _M_grammar->names.end ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -758,7 +758,7 @@ case $rule_number: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Syntax error" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,9 +501,8 @@ QTextStream &operator << (QTextStream &out, const Item &item);
|
|||||||
QTextStream &operator << (QTextStream &out, const NameSet &ns);
|
QTextStream &operator << (QTextStream &out, const NameSet &ns);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
// ... hmm
|
QTextStream &qerr();
|
||||||
extern QTextStream qerr;
|
QTextStream &qout();
|
||||||
extern QTextStream qout;
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // LALR_H
|
#endif // LALR_H
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
static void help_me ()
|
static void help_me ()
|
||||||
{
|
{
|
||||||
qerr << "Usage: qlalr [options] [input file name]" << endl
|
qerr() << "Usage: qlalr [options] [input file name]" << endl
|
||||||
<< endl
|
<< endl
|
||||||
<< " --help, -h\t\tdisplay this help and exit" << endl
|
<< " --help, -h\t\tdisplay this help and exit" << endl
|
||||||
<< " --verbose, -v\t\tverbose output" << endl
|
<< " --verbose, -v\t\tverbose output" << endl
|
||||||
@ -91,7 +91,7 @@ int main (int argc, char *argv[])
|
|||||||
file_name = arg;
|
file_name = arg;
|
||||||
|
|
||||||
else
|
else
|
||||||
qerr << "*** Warning. Ignore argument `" << arg << "'" << endl;
|
qerr() << "*** Warning. Ignore argument `" << arg << "'" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_name.isEmpty ())
|
if (file_name.isEmpty ())
|
||||||
@ -108,13 +108,13 @@ int main (int argc, char *argv[])
|
|||||||
|
|
||||||
if (grammar.rules.isEmpty ())
|
if (grammar.rules.isEmpty ())
|
||||||
{
|
{
|
||||||
qerr << "*** Fatal. No rules!" << endl;
|
qerr() << "*** Fatal. No rules!" << endl;
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (grammar.start == grammar.names.end ())
|
else if (grammar.start == grammar.names.end ())
|
||||||
{
|
{
|
||||||
qerr << "*** Fatal. No start symbol!" << endl;
|
qerr() << "*** Fatal. No start symbol!" << endl;
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,13 +131,13 @@ int main (int argc, char *argv[])
|
|||||||
|
|
||||||
if (generate_dot)
|
if (generate_dot)
|
||||||
{
|
{
|
||||||
DotGraph genDotFile (qout);
|
DotGraph genDotFile (qout());
|
||||||
genDotFile (&aut);
|
genDotFile (&aut);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (generate_report)
|
else if (generate_report)
|
||||||
{
|
{
|
||||||
ParseTable genParseTable (qout);
|
ParseTable genParseTable (qout());
|
||||||
genParseTable(&aut);
|
genParseTable(&aut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ int Recognizer::nextToken()
|
|||||||
if (ch == QLatin1Char ('"'))
|
if (ch == QLatin1Char ('"'))
|
||||||
inp ();
|
inp ();
|
||||||
else
|
else
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl;
|
||||||
|
|
||||||
_M_current_value = text;
|
_M_current_value = text;
|
||||||
return (token = STRING_LITERAL);
|
return (token = STRING_LITERAL);
|
||||||
@ -150,7 +150,7 @@ int Recognizer::nextToken()
|
|||||||
return (token = PREC);
|
return (token = PREC);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << endl;
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
return (token = ERROR);
|
return (token = ERROR);
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ bool Recognizer::parse (const QString &input_file)
|
|||||||
QFile file(_M_input_file);
|
QFile file(_M_input_file);
|
||||||
if (! file.open(QFile::ReadOnly))
|
if (! file.open(QFile::ReadOnly))
|
||||||
{
|
{
|
||||||
qerr << "qlalr: no input file\n";
|
qerr() << "qlalr: no input file\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,7 +405,7 @@ case 34: {
|
|||||||
|
|
||||||
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
|
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
|
||||||
{
|
{
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ case 38: {
|
|||||||
|
|
||||||
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
|
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
|
||||||
{
|
{
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,7 +443,7 @@ case 40: {
|
|||||||
Name tok = _M_grammar->intern (sym(2));
|
Name tok = _M_grammar->intern (sym(2));
|
||||||
if (! _M_grammar->isTerminal (tok))
|
if (! _M_grammar->isTerminal (tok))
|
||||||
{
|
{
|
||||||
qerr << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << endl;
|
||||||
_M_current_rule->prec = _M_grammar->names.end ();
|
_M_current_rule->prec = _M_grammar->names.end ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -474,7 +474,7 @@ case 43: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qerr << _M_input_file << ":" << _M_line << ": Syntax error" << endl;
|
qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user