initial
[prop.git] / include / AD / automata / lalrkgen.h
blob82f40953161429ef548ec4030d12040e491da86d
1 //////////////////////////////////////////////////////////////////////////////
2 // NOTICE:
3 //
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
9 // your programs.
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
16 // code.
18 // This software is still under development and we welcome any suggestions
19 // and help from the users.
21 // Allen Leung
22 // 1994
23 //////////////////////////////////////////////////////////////////////////////
25 #ifndef LALR_k_parser_generator_h
26 #define LALR_k_parser_generator_h
28 #include <AD/automata/lrgen.h> // LR-style parser generator base class
29 #include <AD/automata/operprec.h> // Operator precedence
31 class LALR_k_Gen : public LRGen {
33 LALR_k_Gen(const LALR_k_Gen&); // no copy constructor
34 void operator = (const LALR_k_Gen&); // no assignment
36 public:
38 /////////////////////////////////////////////////////////////////////////
39 // Make inherited types visible
40 /////////////////////////////////////////////////////////////////////////
41 typedef LRGen Super;
42 typedef Super::Symbol Symbol;
43 typedef Super::State State;
44 typedef Super::Rule Rule;
45 typedef Super::Offset Offset;
46 typedef Super::ProductionLength ProductionLength;
48 protected:
50 /////////////////////////////////////////////////////////////////////////
51 // The implementation is hidden within
52 /////////////////////////////////////////////////////////////////////////
53 struct LALR_k_Gen_Impl * impl;
55 public:
57 /////////////////////////////////////////////////////////////////////////
58 // Constructors and destructor
59 /////////////////////////////////////////////////////////////////////////
60 LALR_k_Gen();
61 LALR_k_Gen(const Grammar&, const OpPrecedence&);
62 ~LALR_k_Gen();
64 /////////////////////////////////////////////////////////////////////////
65 // Table compilation and code generation
66 /////////////////////////////////////////////////////////////////////////
68 virtual void compile (const Grammar&, const OpPrecedence&);
69 virtual ostream& print_report (ostream&, int verbosity = 0);
72 #endif