.gitignore
[prop.git] / lib-src / rewrite / twig_gen.cc
blob9b3d5fe1901e85feff8b9596b7f4381fd740511e
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 welcomed 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(read crave for)
19 // any suggestions and help from the users.
21 // Allen Leung
22 // 1994
23 //////////////////////////////////////////////////////////////////////////////
25 //////////////////////////////////////////////////////////////////////////////
26 // This file contains the generator for the top-down tree parser
27 // with dynamic programming. See Aho, Tsiang, et al. for details.
28 //////////////////////////////////////////////////////////////////////////////
30 #include <iostream>
31 #include <AD/rewrite/twig_gen.h> // twig module
33 //////////////////////////////////////////////////////////////////////////////
34 // Constructors and destructor
35 //////////////////////////////////////////////////////////////////////////////
36 TwigGen:: TwigGen() {}
37 TwigGen:: TwigGen(const TreeGrammar& Gram) { compile(Gram); }
38 TwigGen::~TwigGen() {}
40 //////////////////////////////////////////////////////////////////////////////
41 // Method to compile a tree grammar into internal tables form
42 //////////////////////////////////////////////////////////////////////////////
43 void TwigGen::compile (const TreeGrammar& Gram)
44 { Super::compile(Gram);
47 //////////////////////////////////////////////////////////////////////////////
48 // Method to print the tables
49 //////////////////////////////////////////////////////////////////////////////
50 std::ostream& TwigGen::gen_code(std::ostream& f, const char name[]) const
51 { Super::gen_code(f,name);
52 return f;