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 __IPARSER_SPEC_HH__
00050 #define __IPARSER_SPEC_HH__
00051
00052 #include <string>
00053 #include <vector>
00054 using namespace std;
00055
00056
00057 #include "parse_util.hh"
00058
00059 class IEbnfNodeBuilder;
00060 class EbnfNode;
00061
00071 class IParserSpec
00072 {
00073 public:
00074
00079 virtual IEbnfNodeBuilder& getEbnfNodeBuilder() = 0;
00080
00100 virtual void addProduction (const string &name,
00101 const string &retTypeName,
00102 const Position &retTypePos,
00103 const string &formalArgs,
00104 const Position &formalArgsPos,
00105 const string &exceptList,
00106 const Position &exceptListPos,
00107 const string &preambleCode,
00108 const Position &preambleCodePos,
00109 EbnfNode *expansion,
00110 const Position &pos) throw (ParseException) = 0;
00111
00117 virtual void setPreambleCode (const string &block, const Position &pos) = 0;
00118
00122 virtual void setClassName (const string &className) = 0;
00123
00127 virtual void setInheritance (const string &inheritance,
00128 const Position &pos) = 0;
00129
00135 virtual void addCodeBlock (const string &block, const Position &pos) = 0;
00136
00137 #ifdef DEBUG
00138
00142 virtual void dump (ostream &os) const = 0;
00143 #endif
00144 };
00145
00146 #endif