Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
lalr.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#include "lalr.h"
5
6#include <limits.h>
7
8#include <algorithm>
9
10#define QLALR_NO_DEBUG_NULLABLES
11#define QLALR_NO_DEBUG_LOOKBACKS
12#define QLALR_NO_DEBUG_DIRECT_READS
13#define QLALR_NO_DEBUG_READS
14#define QLALR_NO_DEBUG_INCLUDES
15#define QLALR_NO_DEBUG_LOOKAHEADS
16
17using namespace Qt::StringLiterals;
18
21{
22 static QTextStream result(stderr, QTextStream::WriteOnly);
23 return result;
24}
25
27{
28 static QTextStream result(stdout, QTextStream::WriteOnly);
29 return result;
30}
32
33namespace std {
35{
36 return *a < *b;
37}
38
40{
41 return &*a < &*b;
42}
43
45{
46 return &*a < &*b;
47}
48}
49
50bool Read::operator < (const Read &other) const
51{
52 if (state == other.state)
53 return nt < other.nt;
54
55 return state < other.state;
56}
57
59{
60 if (state == other.state)
61 return nt < other.nt;
62
63 return state < other.state;
64}
65
67{
68 if (state == other.state)
69 return nt < other.nt;
70
71 return state < other.state;
72}
73
75{
76 return out << *n;
77}
78
80{
81 out << *r.lhs << " ::=";
82
83 for (NameList::const_iterator name = r.rhs.begin (); name != r.rhs.end (); ++name)
84 out << " " << **name;
85
86 return out;
87}
88
90{
91 out << "{";
92
93 for (NameSet::const_iterator n = ns.begin (); n != ns.end (); ++n)
94 {
95 if (n != ns.begin ())
96 out << ", ";
97
98 out << *n;
99 }
100
101 return out << "}";
102}
103
105{
106 Q_ASSERT (! isReduceItem ());
107
108 Item n;
109 n.rule = rule;
110 n.dot = dot;
111 ++n.dot;
112
113 return n;
114}
115
117{
118 RulePointer r = item.rule;
119
120 out << *r->lhs << ":";
121 for (NameList::iterator name = r->rhs.begin (); name != r->rhs.end (); ++name)
122 {
123 out << " ";
124
125 if (item.dot == name)
126 out << ". ";
127
128 out << **name;
129 }
130
131 if (item.isReduceItem ())
132 out << " .";
133
134 return out;
135}
136
138 defaultReduce (g->rules.end ())
139{
140}
141
142std::pair<ItemPointer, bool> State::insert(const Item &item)
143{
144 ItemPointer it = std::find (kernel.begin (), kernel.end (), item);
145
146 if (it != kernel.end ())
147 return {it, false};
148
149 return {kernel.insert(it, item), true};
150}
151
152std::pair<ItemPointer, bool> State::insertClosure(const Item &item)
153{
154 ItemPointer it = std::find (closure.begin (), closure.end (), item);
155
156 if (it != closure.end ())
157 return {it, false};
158
159 return {closure.insert (it, item), true};
160}
161
162
164// Grammar
167 start (names.end ())
168{
171 current_prec = 0;
173
174 table_name = "parser_table"_L1;
175
176 tk_end = intern ("$end");
177 terminals.insert (tk_end);
178 spells.insert (tk_end, "end of file"_L1);
179
180 /*tk_error= terminals.insert (intern ("error"))*/;
181}
182
184{
185 Name name = std::find (names.begin (), names.end (), id);
186
187 if (name == names.end ())
188 name = names.insert (names.end (), id);
189
190 return name;
191}
192
194{
195 NameSet undefined;
196 for (RulePointer rule = rules.begin (); rule != rules.end (); ++rule)
197 {
198 for (NameList::iterator it = rule->rhs.begin (); it != rule->rhs.end (); ++it)
199 {
200 Name name = *it;
201 if (isTerminal (name) || declared_lhs.find (name) != declared_lhs.end ()
202 || undefined.find (name) != undefined.end ())
203 continue;
204
205 undefined.insert(name);
206 fprintf (stderr, "*** Warning. Symbol `%s' is not defined\n", qPrintable (*name));
207 }
208
209 rule_map.insert (rule->lhs, rule);
210 }
211}
212
214{
215 accept_symbol = intern ("$accept");
216 goal = rules.insert (rules.end (), Rule ());
217 goal->lhs = accept_symbol;
218 goal->rhs.push_back (start);
219 goal->rhs.push_back (tk_end);
220
222}
223
225{
228
230 _M_automaton (aut) {}
231
233 { return _M_automaton->nullables.find (name) == _M_automaton->nullables.end (); }
234};
235
237 _M_grammar (g),
238 start (states.end ())
239{
240}
241
243{
244 return 1 + std::distance (_M_grammar->rules.begin (), rule);
245}
246
248{
249 return std::distance (_M_grammar->names.begin (), name);
250}
251
253{
254 return std::distance (states.begin (), state);
255}
256
258{
259 Item item;
260 item.rule = _M_grammar->goal;
261 item.dot = _M_grammar->goal->rhs.begin ();
262
263 State tmp (_M_grammar);
264 tmp.insert (item);
265 start = internState (tmp).first;
266
267 closure (start);
268
271 buildReads ();
275}
276
278{
279 bool changed = true;
280
281 while (changed)
282 {
283 changed = false;
284
285 for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
286 {
287 NameList::iterator nn = std::find_if(rule->rhs.begin(), rule->rhs.end(), NotNullable(this));
288
289 if (nn == rule->rhs.end ())
290 changed |= nullables.insert (rule->lhs).second;
291 }
292 }
293
294#ifndef QLALR_NO_DEBUG_NULLABLES
295 qerr() << "nullables = {" << nullables << Qt::endl;
296#endif
297}
298
299std::pair<StatePointer, bool> Automaton::internState(const State &state)
300{
301 StatePointer it = std::find (states.begin (), states.end (), state);
302
303 if (it != states.end ())
304 return {it, false};
305
306 return {states.insert (it, state), true};
307}
308
310{
311 std::list<ItemPointer> items;
312
314 { items.push_back (item); }
315
317 {
318 State st (aut->_M_grammar);
319
320 for (auto &item : items)
321 st.insert(item->next());
322
323 return st;
324 }
325};
326
328{
329 if (! state->closure.empty ()) // ### not true.
330 return;
331
332 typedef QMap<Name, _Bucket> bucket_map_type;
333
334 bucket_map_type buckets;
335 QStack<ItemPointer> working_list;
336
337 for (ItemPointer item = state->kernel.begin (); item != state->kernel.end (); ++item)
338 working_list.push (item);
339
340 state->closure = state->kernel;
341
342 while (! working_list.empty ())
343 {
344 ItemPointer item = working_list.top ();
345 working_list.pop ();
346
347 if (item->isReduceItem ())
348 continue;
349
350 buckets [*item->dot].insert (item);
351
352 if (_M_grammar->isNonTerminal (*item->dot))
353 {
354 const auto range = std::as_const(_M_grammar->rule_map).equal_range(*item->dot);
355 for (auto it = range.first; it != range.second; ++it)
356 {
357 const RulePointer &rule = *it;
358 Item ii;
359 ii.rule = rule;
360 ii.dot = rule->rhs.begin ();
361
362 std::pair<ItemPointer, bool> r = state->insertClosure(ii);
363
364 if (r.second)
365 working_list.push (r.first);
366 }
367 }
368 }
369
370 QList<StatePointer> todo;
371
372 for (bucket_map_type::iterator bucket = buckets.begin (); bucket != buckets.end (); ++bucket)
373 {
374 std::pair<StatePointer, bool> r = internState(bucket->toState(this));
375
376 StatePointer target = r.first;
377
378 if (r.second)
379 todo.push_back (target);
380
381 state->bundle.insert (bucket.key(), target);
382 }
383
384 while (! todo.empty ())
385 {
386 closure (todo.front ());
387 todo.pop_front ();
388 }
389}
390
392{
393 for (StatePointer p = states.begin (); p != states.end (); ++p)
394 {
395 for (Bundle::iterator a = p->bundle.begin (); a != p->bundle.end (); ++a)
396 {
397 Name A = a.key ();
398
399 if (! _M_grammar->isNonTerminal (A))
400 continue;
401
402 const auto range = std::as_const(_M_grammar->rule_map).equal_range(A);
403 for (auto it = range.first; it != range.second; ++it)
404 {
405 const RulePointer &rule = *it;
406 StatePointer q = p;
407
408 for (NameList::iterator dot = rule->rhs.begin (); dot != rule->rhs.end (); ++dot)
409 q = q->bundle.value (*dot, states.end ());
410
411 Q_ASSERT (q != states.end ());
412
413 ItemPointer item = q->closure.begin ();
414
415 for (; item != q->closure.end (); ++item)
416 {
417 if (item->rule == rule && item->dot == item->end_rhs ())
418 break;
419 }
420
421 if (item == q->closure.end ())
422 {
423 Q_ASSERT (q == p);
424 Q_ASSERT (rule->rhs.begin () == rule->rhs.end ());
425
426 for (item = q->closure.begin (); item != q->closure.end (); ++item)
427 {
428 if (item->rule == rule && item->dot == item->end_rhs ())
429 break;
430 }
431 }
432
433 Q_ASSERT (item != q->closure.end ());
434
436
437#ifndef QLALR_NO_DEBUG_LOOKBACKS
438 qerr() << "*** (" << id (q) << ", " << *rule << ") lookback (" << id (p) << ", " << *A << ")" << Qt::endl;
439#endif
440 }
441 }
442 }
443}
444
446{
447 for (StatePointer q = states.begin (); q != states.end (); ++q)
448 {
449 for (Bundle::iterator a = q->bundle.begin (); a != q->bundle.end (); ++a)
450 {
451 if (! _M_grammar->isNonTerminal (a.key ()))
452 continue;
453
454 StatePointer r = a.value ();
455
456 for (Bundle::iterator z = r->bundle.begin (); z != r->bundle.end (); ++z)
457 {
458 Name sym = z.key ();
459
460 if (! _M_grammar->isTerminal (sym))
461 continue;
462
463 q->reads [a.key ()].insert (sym);
464 }
465 }
466
467#ifndef QLALR_NO_DEBUG_DIRECT_READS
468 for (QMap<Name, NameSet>::iterator dr = q->reads.begin (); dr != q->reads.end (); ++dr)
469 qerr() << "*** DR(" << id (q) << ", " << dr.key () << ") = " << dr.value () << Qt::endl;
470#endif
471 }
472}
473
475{
476 for (StatePointer q = states.begin (); q != states.end (); ++q)
477 {
478 for (Bundle::iterator a = q->bundle.begin (); a != q->bundle.end (); ++a)
479 {
480 if (! _M_grammar->isNonTerminal (a.key ()))
481 continue;
482
483 StatePointer r = a.value ();
484
485 for (Bundle::iterator z = r->bundle.begin (); z != r->bundle.end (); ++z)
486 {
487 Name sym = z.key ();
488
489 if (! _M_grammar->isNonTerminal(sym) || nullables.find (sym) == nullables.end ())
490 continue;
491
494
495 source->insertEdge (target);
496
497#ifndef QLALR_NO_DEBUG_READS
498 qerr() << "*** ";
499 dump (qerr(), source);
500 qerr() << " reads ";
501 dump (qerr(), target);
502 qerr() << Qt::endl;
503#endif
504 }
505 }
506 }
507}
508
510{
513
514 _M_reads_dfn = 0;
515
516 for (ReadsGraph::iterator node = ReadsGraph::begin_nodes (); node != ReadsGraph::end_nodes (); ++node)
517 {
518 if (! node->root)
519 continue;
520
521 visitReadNode (node);
522 }
523
524 for (ReadsGraph::iterator node = ReadsGraph::begin_nodes (); node != ReadsGraph::end_nodes (); ++node)
525 visitReadNode (node);
526}
527
529{
530 if (node->dfn != 0)
531 return; // nothing to do
532
533 int N = node->dfn = ++_M_reads_dfn;
534 _M_reads_stack.push (node);
535
536#ifndef QLALR_NO_DEBUG_INCLUDES
537 // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << Qt::endl;
538#endif
539
540 for (ReadsGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
541 {
542 ReadsGraph::iterator r = *edge;
543
545
546 node->dfn = qMin (N, r->dfn);
547
548 NameSet &dst = node->data.state->reads [node->data.nt];
549 NameSet &src = r->data.state->reads [r->data.nt];
550 dst.insert (src.begin (), src.end ());
551 }
552
553 if (node->dfn == N)
554 {
555 ReadsGraph::iterator tos = _M_reads_stack.top ();
556
557 do {
558 tos = _M_reads_stack.top ();
559 _M_reads_stack.pop ();
560 tos->dfn = INT_MAX;
561 } while (tos != node);
562 }
563}
564
566{
567 for (StatePointer p = states.begin (); p != states.end (); ++p)
568 p->follows = p->reads;
569
571
572 _M_includes_dfn = 0;
573
575 {
576 if (! node->root)
577 continue;
578
579 visitIncludeNode (node);
580 }
581
583 visitIncludeNode (node);
584}
585
587{
588 for (StatePointer pp = states.begin (); pp != states.end (); ++pp)
589 {
590 for (Bundle::iterator a = pp->bundle.begin (); a != pp->bundle.end (); ++a)
591 {
592 Name name = a.key ();
593
595 continue;
596
597 const auto range = std::as_const(_M_grammar->rule_map).equal_range(name);
598 for (auto it = range.first; it != range.second; ++it)
599 {
600 const RulePointer &rule = *it;
601 StatePointer p = pp;
602
603 for (NameList::iterator A = rule->rhs.begin (); A != rule->rhs.end (); ++A)
604 {
605 NameList::iterator dot = A;
606 ++dot;
607
608 if (_M_grammar->isNonTerminal (*A) && dot == rule->rhs.end ())
609 {
610 // found an include edge.
613
614 source->insertEdge (target);
615
616#ifndef QLALR_NO_DEBUG_INCLUDES
617 qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << Qt::endl;
618#endif // QLALR_NO_DEBUG_INCLUDES
619
620 continue;
621 }
622
623 p = p->bundle.value (*A);
624
625 if (! _M_grammar->isNonTerminal (*A))
626 continue;
627
628 NameList::iterator first_not_nullable = std::find_if(dot, rule->rhs.end(), NotNullable(this));
629 if (first_not_nullable != rule->rhs.end ())
630 continue;
631
632 // found an include edge.
635
636 source->insertEdge (target);
637
638#ifndef QLALR_NO_DEBUG_INCLUDES
639 qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << Qt::endl;
640#endif // QLALR_NO_DEBUG_INCLUDES
641 }
642 }
643 }
644 }
645}
646
648{
649 if (node->dfn != 0)
650 return; // nothing to do
651
652 int N = node->dfn = ++_M_includes_dfn;
653 _M_includes_stack.push (node);
654
655#ifndef QLALR_NO_DEBUG_INCLUDES
656 // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << Qt::endl;
657#endif
658
659 for (IncludesGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
660 {
662
664
665 node->dfn = qMin (N, r->dfn);
666
667#ifndef QLALR_NO_DEBUG_INCLUDES
668 qerr() << "*** Merge. follows";
669 dump (qerr(), node);
670 qerr() << " += follows";
671 dump (qerr(), r);
672 qerr() << Qt::endl;
673#endif
674
675 NameSet &dst = node->data.state->follows [node->data.nt];
676 NameSet &src = r->data.state->follows [r->data.nt];
677
678 dst.insert (src.begin (), src.end ());
679 }
680
681 if (node->dfn == N)
682 {
683 IncludesGraph::iterator tos = _M_includes_stack.top ();
684
685 do {
686 tos = _M_includes_stack.top ();
687 _M_includes_stack.pop ();
688 tos->dfn = INT_MAX;
689 } while (tos != node);
690 }
691}
692
694{
695 for (StatePointer p = states.begin (); p != states.end (); ++p)
696 {
697 for (ItemPointer item = p->closure.begin (); item != p->closure.end (); ++item)
698 {
699 const auto range = std::as_const(lookbacks).equal_range(item);
700 for (auto it = range.first; it != range.second; ++it)
701 {
702 const Lookback &lookback = *it;
703 StatePointer q = lookback.state;
704
705#ifndef QLALR_NO_DEBUG_LOOKAHEADS
706 qerr() << "(" << id (p) << ", " << *item->rule << ") lookbacks ";
707 dump (qerr(), lookback);
708 qerr() << " with follows (" << id (q) << ", " << lookback.nt << ") = " << q->follows [lookback.nt] << Qt::endl;
709#endif
710
711 lookaheads [item].insert (q->follows [lookback.nt].begin (), q->follows [lookback.nt].end ());
712 }
713 }
714
715 // propagate the lookahead in the kernel
716 ItemPointer k = p->kernel.begin ();
717 ItemPointer c = p->closure.begin ();
718
719 for (; k != p->kernel.end (); ++k, ++c)
720 lookaheads [k] = lookaheads [c];
721 }
722}
723
725{
726 for (StatePointer state = states.begin (); state != states.end (); ++state)
727 {
728 ItemPointer def = state->closure.end ();
729 int size = -1;
730
731 for (ItemPointer item = state->closure.begin (); item != state->closure.end (); ++item)
732 {
733 if (item->dot != item->end_rhs ())
734 continue;
735
736 int la = static_cast<int>(lookaheads.value(item).size());
737 if (def == state->closure.end () || la > size)
738 {
739 def = item;
740 size = la;
741 }
742 }
743
744 if (def != state->closure.end ())
745 {
746 Q_ASSERT (size >= 0);
747 state->defaultReduce = def->rule;
748 }
749 }
750}
751
753{
754 out << "(" << id (incl->data.state) << ", " << incl->data.nt << ")";
755}
756
757void Automaton::dump (QTextStream &out, ReadNode rd)
758{
759 out << "(" << id (rd->data.state) << ", " << rd->data.nt << ")";
760}
761
763{
764 out << "(" << id (lp.state) << ", " << lp.nt << ")";
765}
void buildReadsDigraph()
Definition lalr.cpp:474
Automaton(Grammar *g)
Definition lalr.cpp:236
int id(RulePointer rule)
Definition lalr.cpp:242
ReadsGraph::iterator ReadNode
Definition lalr.h:317
void buildDefaultReduceActions()
Definition lalr.cpp:724
void buildNullables()
Definition lalr.cpp:277
void build()
Definition lalr.cpp:257
void visitReadNode(ReadNode node)
Definition lalr.cpp:528
void buildReads()
Definition lalr.cpp:509
void dump(QTextStream &out, IncludeNode incl)
Definition lalr.cpp:752
void buildIncludesDigraph()
Definition lalr.cpp:586
std::pair< StatePointer, bool > internState(const State &state)
Definition lalr.cpp:299
IncludesGraph::iterator IncludeNode
Definition lalr.h:320
NameSet nullables
Definition lalr.h:354
void buildIncludesAndFollows()
Definition lalr.cpp:565
Grammar * _M_grammar
Definition lalr.h:351
void buildLookaheads()
Definition lalr.cpp:693
void buildDirectReads()
Definition lalr.cpp:445
void buildLookbackSets()
Definition lalr.cpp:391
void visitIncludeNode(IncludeNode node)
Definition lalr.cpp:647
QMultiMap< ItemPointer, Lookback > lookbacks
Definition lalr.h:355
void closure(StatePointer state)
Definition lalr.cpp:327
QMap< ItemPointer, NameSet > lookaheads
Definition lalr.h:356
QMap< Name, QString > spells
Definition lalr.h:241
@ NonAssoc
Definition lalr.h:252
int expected_reduce_reduce
Definition lalr.h:249
Name accept_symbol
Definition lalr.h:246
Name tk_end
Definition lalr.h:245
Assoc current_assoc
Definition lalr.h:263
NameSet terminals
Definition lalr.h:239
NameSet declared_lhs
Definition lalr.h:247
debug_infot rules
Definition lalr.h:242
int current_prec
Definition lalr.h:264
bool isNonTerminal(Name name) const
Definition lalr.h:225
std::list< QString > names
Definition lalr.h:237
bool isTerminal(Name name) const
Definition lalr.h:222
QString table_name
Definition lalr.h:233
void buildRuleMap()
Definition lalr.cpp:193
Grammar()
Definition lalr.cpp:166
RulePointer goal
Definition lalr.h:244
RuleMap rule_map
Definition lalr.h:243
void buildExtendedGrammar()
Definition lalr.cpp:213
Name intern(const QString &id)
Definition lalr.cpp:183
NameSet non_terminals
Definition lalr.h:240
int expected_shift_reduce
Definition lalr.h:248
bool operator<(const Include &other) const
Definition lalr.cpp:58
Name nt
Definition lalr.h:306
StatePointer state
Definition lalr.h:305
Definition lalr.h:84
bool isReduceItem() const
Definition lalr.h:98
Item next() const
Definition lalr.cpp:104
NameList::iterator dot
Definition lalr.h:105
RulePointer rule
Definition lalr.h:104
StatePointer state
Definition lalr.h:79
bool operator<(const Lookback &other) const
Definition lalr.cpp:66
Name nt
Definition lalr.h:80
static iterator get(_Tp data)
Definition lalr.h:188
static iterator begin_nodes()
Definition lalr.h:162
std::list< iterator >::iterator edge_iterator
Definition lalr.h:140
Repository::iterator iterator
Definition lalr.h:139
static iterator end_nodes()
Definition lalr.h:165
\inmodule QtGui
iterator insert(const Key &key, const T &value)
Definition qmap.h:688
T value(const Key &key, const T &defaultValue=T()) const
Definition qmap.h:357
iterator find(const Key &key)
Definition qmap.h:641
iterator end()
Definition qmap.h:602
size_type size() const
Definition qmap.h:267
iterator insert(const Key &key, const T &value)
Definition qmap.h:1452
iterator end()
Definition qset.h:140
iterator insert(const T &value)
Definition qset.h:155
T & top()
Returns a reference to the stack's top item.
Definition qstack.h:19
T pop()
Removes the top item from the stack and returns it.
Definition qstack.h:18
void push(const T &t)
Adds element t to the top of the stack.
Definition qstack.h:17
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition lalr.h:268
bool operator<(const Read &other) const
Definition lalr.cpp:50
StatePointer state
Definition lalr.h:284
Name nt
Definition lalr.h:285
Definition lalr.h:49
QSet< QString >::iterator it
else opt state
[0]
QTextStream & qout()
Definition lalr.cpp:26
QTextStream & operator<<(QTextStream &out, const Name &n)
Definition lalr.cpp:74
QT_BEGIN_NAMESPACE QTextStream & qerr()
Definition lalr.cpp:20
std::set< Name > NameSet
Definition lalr.h:30
ItemList::iterator ItemPointer
Definition lalr.h:34
StateList::iterator StatePointer
Definition lalr.h:43
std::list< QString >::iterator Name
Definition lalr.h:28
debug_infot::iterator RulePointer
Definition lalr.h:38
QT_BEGIN_NAMESPACE QTextStream & qerr()
Definition lalr.cpp:20
Combined button and popup list for selecting options.
QTextStream & endl(QTextStream &stream)
Writes '\n' to the stream and flushes the stream.
bool operator<(Name a, Name b)
Definition lalr.cpp:34
DBusConnection const char * rule
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
n varying highp vec2 A
GLboolean GLboolean GLboolean b
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLboolean r
[2]
GLuint GLuint end
GLenum GLuint id
[7]
GLenum src
GLsizei range
GLenum GLenum dst
GLenum target
GLuint start
GLboolean GLboolean g
GLuint name
GLfloat n
GLsizei GLsizei GLchar * source
const GLubyte * c
GLuint GLuint * names
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLuint64EXT * result
[6]
GLfloat GLfloat p
[1]
GLuint * states
static qreal dot(const QPointF &a, const QPointF &b)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define qPrintable(string)
Definition qstring.h:1531
QRandomGenerator64 rd
[10]
QTextStream out(stdout)
[7]
QSharedPointer< T > other(t)
[5]
QGraphicsItem * item
NotNullable(Automaton *aut)
Definition lalr.cpp:229
bool operator()(Name name) const
Definition lalr.cpp:232
Name argument_type
Definition lalr.cpp:226
Automaton * _M_automaton
Definition lalr.cpp:227
std::pair< ItemPointer, bool > insertClosure(const Item &item)
Definition lalr.cpp:152
std::pair< ItemPointer, bool > insert(const Item &item)
Definition lalr.cpp:142
State(const char *token)
ItemList closure
Definition lalr.h:124
ItemList kernel
Definition lalr.h:123
std::list< ItemPointer > items
Definition lalr.cpp:311
State toState(Automaton *aut)
Definition lalr.cpp:316
void insert(ItemPointer item)
Definition lalr.cpp:313