1 //////////////////////////////////////////////////////////////////////////////
4 // ADLib, Prop and their related set of tools and documentation are in the
5 // public domain. The author(s) of this software reserve no copyrights on
6 // the source code and any code generated using the tools. You are encouraged
7 // to use ADLib and Prop to develop software, in both academic and commercial
8 // settings, and are free to incorporate any part of ADLib and Prop into
11 // Although you are under no obligation to do so, we strongly recommend that
12 // you give away all software developed using our tools.
14 // We also ask that credit be given to us when ADLib and/or Prop are used in
15 // your programs, and that this notice be preserved intact in all the source
18 // This software is still under development and we welcome any suggestions
19 // and help from the users.
23 //////////////////////////////////////////////////////////////////////////////
29 // Class |LL1| represents a parser generated by a LL(1) grammar.
30 // The algorithm used is the one described in \cite{FL-1988}.
33 #include <AD/automata/grammar.h> // Canonical parser grammar
34 #include <AD/automata/compdfa.h> // Compressed sparse dfa
38 LL1(const LL1
&); // no copy constructor
39 void operator = (const LL1
&); // no assignment
43 typedef Grammar::NonTerminal NonTerminal
;
44 typedef Grammar::Terminal Terminal
;
45 typedef Grammar::Action Action
;
46 typedef Grammar::Production Production
;
47 typedef CompressedDFA::State State
;
48 typedef CompressedDFA::Offset Offset
;
52 const Grammar grammar
;
58 LL1( const Offset base_table
[],
59 const State next_table
[],
61 ) : base(base_table
), next(next_table
), grammar(G
) {}