35 #define QLALR_NO_DEBUG_NULLABLES
36 #define QLALR_NO_DEBUG_LOOKBACKS
37 #define QLALR_NO_DEBUG_DIRECT_READS
38 #define QLALR_NO_DEBUG_READS
39 #define QLALR_NO_DEBUG_INCLUDES
40 #define QLALR_NO_DEBUG_LOOKAHEADS
104 out << *
r.lhs <<
" ::=";
118 if (
n !=
ns.begin ())
143 out << *
r->lhs <<
":";
154 if (
item.isReduceItem ())
161 defaultReduce (
g->rules.
end ())
229 fprintf (stderr,
"*** Warning. Symbol `%s' is not defined\n", qPrintable (*
name));
312 if (nn ==
rule->rhs.end ())
317 #ifndef QLALR_NO_DEBUG_NULLABLES
352 if (!
state->closure.empty ())
357 bucket_map_type buckets;
365 while (! working_list.
empty ())
370 if (
item->isReduceItem ())
388 working_list.
push (
r.first);
407 while (! todo.
empty ())
432 q =
q->bundle.value (*dot,
states.end ());
438 for (;
item !=
q->closure.end (); ++
item)
444 if (
item ==
q->closure.end ())
449 for (
item =
q->closure.begin ();
item !=
q->closure.end (); ++
item)
460 #ifndef QLALR_NO_DEBUG_LOOKBACKS
486 q->reads [
a.key ()].insert (sym);
490 #ifndef QLALR_NO_DEBUG_DIRECT_READS
492 qerr() <<
"*** DR(" <<
id (
q) <<
", " << dr.key () <<
") = " << dr.value () <<
Qt::endl;
520 #ifndef QLALR_NO_DEBUG_READS
556 int N =
node->dfn = ++_M_reads_dfn;
559 #ifndef QLALR_NO_DEBUG_INCLUDES
569 node->dfn = qMin (
N,
r->dfn);
581 tos = _M_reads_stack.
top ();
582 _M_reads_stack.
pop ();
584 }
while (tos !=
node);
591 p->follows =
p->reads;
639 #ifndef QLALR_NO_DEBUG_INCLUDES
640 qerr() <<
"*** (" <<
id (
p) <<
", " << *
A <<
") includes (" <<
id (pp) <<
", " << *
name <<
")" <<
Qt::endl;
646 p =
p->bundle.value (*
A);
652 if (first_not_nullable !=
rule->rhs.end ())
661 #ifndef QLALR_NO_DEBUG_INCLUDES
662 qerr() <<
"*** (" <<
id (
p) <<
", " << *
A <<
") includes (" <<
id (pp) <<
", " << *
name <<
")" <<
Qt::endl;
675 int N =
node->dfn = ++_M_includes_dfn;
678 #ifndef QLALR_NO_DEBUG_INCLUDES
688 node->dfn = qMin (
N,
r->dfn);
690 #ifndef QLALR_NO_DEBUG_INCLUDES
691 qerr() <<
"*** Merge. follows";
693 qerr() <<
" += follows";
709 tos = _M_includes_stack.
top ();
710 _M_includes_stack.
pop ();
712 }
while (tos !=
node);
728 #ifndef QLALR_NO_DEBUG_LOOKAHEADS
729 qerr() <<
"(" <<
id (
p) <<
", " << *
item->rule <<
") lookbacks ";
731 qerr() <<
" with follows (" <<
id (
q) <<
", " << lookback.
nt <<
") = " <<
q->follows [lookback.
nt] <<
Qt::endl;
742 for (; k !=
p->kernel.end (); ++k, ++
c)
760 if (def ==
state->closure.end () || la >
size)
767 if (def !=
state->closure.end ())
770 state->defaultReduce = def->rule;
777 out <<
"(" <<
id (incl->data.state) <<
", " << incl->data.nt <<
")";
782 out <<
"(" <<
id (
rd->data.state) <<
", " <<
rd->data.nt <<
")";
ReadsGraph::iterator ReadNode
void buildDefaultReduceActions()
void visitReadNode(ReadNode node)
void dump(QTextStream &out, IncludeNode incl)
void buildIncludesDigraph()
IncludesGraph::iterator IncludeNode
void buildIncludesAndFollows()
QPair< StatePointer, bool > internState(const State &state)
void visitIncludeNode(IncludeNode node)
QMultiMap< ItemPointer, Lookback > lookbacks
void closure(StatePointer state)
QMap< ItemPointer, NameSet > lookaheads
QMap< Name, QString > spells
int expected_reduce_reduce
bool isNonTerminal(Name name) const
std::list< QString > names
bool isTerminal(Name name) const
void buildExtendedGrammar()
Name intern(const QString &id)
int expected_shift_reduce
bool operator<(const Include &other) const
bool isReduceItem() const
bool operator<(const Lookback &other) const
static iterator get(_Tp data)
static iterator begin_nodes()
std::list< iterator >::iterator edge_iterator
Repository::iterator iterator
static iterator end_nodes()
operator<<(QDataStream &ds, qfloat16 f)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
bool empty() const noexcept
void push_back(parameter_type t)
void pop_front() noexcept
iterator insert(const Key &key, const T &value)
iterator find(const Key &key)
iterator insert(const Key &key, const T &value)
The QStack class is a template class that provides a stack.
The QString class provides a Unicode character string.
The QTextStream class provides a convenient interface for reading and writing text.
bool operator<(const Read &other) const
QT_BEGIN_NAMESPACE QTextStream & qerr()
ItemList::iterator ItemPointer
StateList::iterator StatePointer
debug_infot::iterator RulePointer
typename C::const_iterator const_iterator
typename C::iterator iterator
QTextStream & endl(QTextStream &stream)
int distance(TestIterator &a, TestIterator &b)
bool operator<(Name a, Name b)
std::pair< T1, T2 > QPair
DBusConnection const char * rule
GLboolean GLboolean GLboolean b
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLsizei GLchar * source
GLdouble GLdouble GLdouble GLdouble q
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
QRandomGenerator64 rd
[10]
QTextStream out(stdout)
[7]
std::list< ItemPointer > items
State toState(Automaton *aut)
void insert(ItemPointer item)
NotNullable(Automaton *aut)
bool operator()(Name name) const
QPair< ItemPointer, bool > insertClosure(const Item &item)
QPair< ItemPointer, bool > insert(const Item &item)
QDomElement find(const QString &tagName, const QDomElement &e)