initial
[prop.git] / prop-src / compiler.h
blob6cf8edf78a6076c3d2148a97ea3a912dbe900ade
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // This file describes the interface to the Prop compiler.
4 //
5 ///////////////////////////////////////////////////////////////////////////////
7 #ifndef prop_compiler_h
8 #define prop_compiler_h
10 #include "matchcom.h" // pattern matching compiler
11 #include "rwgen.h" // rewriting compiler
12 #include "datagen.h" // data structure compiler
13 #include "infgen.h" // inference compiler
14 #include "parsegen.h" // parser generator
15 #include "setlgen.h" // set language compiler
16 // #include "bitfield.h" // bit fields/pattern compiler
17 // #include "dataflow.h" // dataflow compiler
18 // #include "constraint.h" // constraint compiler
19 #include "metasyntax.h" // metasyntax compiler
20 #include "grsgen.h" // graph rewriting compiler
21 #include "aggen.h" // attribute grammar compiler
22 #include "rwmix.h" // TRS partial evaluator
23 #include "textbuf.h"
25 ///////////////////////////////////////////////////////////////////////////////
26 // The compiler is constructed by combining various modules together.
27 ///////////////////////////////////////////////////////////////////////////////
28 class Compiler
29 : virtual public CodeGen, // code generator
30 virtual public DatatypeCompiler, // datatype compiler
31 virtual public MatchCompiler, // pattern matching compiler
32 virtual public RewritingCompiler, // rewriting compiler
33 virtual public RewriteMix, // rewriting system partial evaluator
34 virtual public InferenceCompiler, // inference compiler
35 virtual public ParserCompiler, // parser compiler
36 virtual public SETLCompiler, // setl compiler
37 // virtual public BitfieldCompiler, // bit field compiler
38 // virtual public DataflowCompiler, // dataflow compiler
39 // virtual public ConstraintCompiler, // constraint compiler
40 virtual public MetaSyntaxCompiler, // meta syntax compiler
41 virtual public AttributeGrammarCompiler, // AG compiler
42 virtual public GraphRewritingCompiler // grs compiler
44 Compiler (const Compiler&); // no copy constructor
45 void operator = (const Compiler&); // no assignment
47 TextBuffer header; // header information
49 public:
50 ////////////////////////////////////////////////////////////////////////////
51 // Constructor and destructor
52 ////////////////////////////////////////////////////////////////////////////
53 Compiler(TyOpt opt, int embedded_tags);
54 virtual ~Compiler();
56 public:
58 ////////////////////////////////////////////////////////////////////////////
59 // Methods to generate a Prop declaration.
60 ////////////////////////////////////////////////////////////////////////////
61 void generate (Decls); // generate code
62 void emit_header (const char *, int);
63 void emit_header_text ();
64 ostream& print_report (ostream&); // print report
65 void print_definitions_as_GDL (); // print definitions as GDL
67 protected:
68 ////////////////////////////////////////////////////////////////////////////
69 // Miscellaneous methods
70 ////////////////////////////////////////////////////////////////////////////
71 void gen (Decl, Bool = true, Bool = true);
72 void gen (Decls);
73 virtual va_list printer (char, va_list);
76 #endif