00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #ifndef __PRODUCTION_SPEC_HH__
00050 #define __PRODUCTION_SPEC_HH__
00051
00052 #include <string>
00053 #include <iostream>
00054 using namespace std;
00055
00056
00057 #include "debug.h"
00058 #include "parse_util.hh"
00059
00060 class EbnfNode;
00061 class EbnfLaNode;
00062
00066 class ProductionSpec
00067 {
00068 public:
00069
00070 ProductionSpec (const string &name_,
00071 const string &retType_, const Position &retTypePos_,
00072 const string &formalArgs_, const Position &formalArgsPos_,
00073 const string &exceptList_, const Position &exceptListPos_,
00074 const string &preambleCode_, const Position &preambleCodePos_,
00075 EbnfLaNode *expansion_,
00076 const Position &pos_) :
00077 name(name_), retType(retTypePos_, retType_),
00078 formalArgs(formalArgsPos_, formalArgs_),
00079 exceptList(exceptListPos_, exceptList_),
00080 preambleCode(preambleCodePos_, preambleCode_),
00081 expansion(expansion_), pos(pos_)
00082 {}
00083
00084 ProductionSpec (const ProductionSpec &o) :
00085 name(o.name), retType(o.retType), formalArgs(o.formalArgs),
00086 exceptList(o.exceptList), preambleCode(o.preambleCode),
00087 expansion(o.expansion), pos(o.pos)
00088 {}
00089
00090 #ifdef DEBUG
00091 void dump (ostream &os) const;
00092 #endif
00093
00097 string name;
00098
00103 CodeChunk retType;
00104
00109 CodeChunk formalArgs;
00110
00115 CodeChunk exceptList;
00116
00121 CodeChunk preambleCode;
00122
00126 EbnfLaNode *expansion;
00127
00131 Position pos;
00132 };
00133
00134 #endif