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
00050
00051
00052
00053
00054
00055 #ifndef __IEBNF_NODE_BUILDER_HH__
00056 #define __IEBNF_NODE_BUILDER_HH__
00057
00058 #include <string>
00059 #include <vector>
00060 using namespace std;
00061
00062 #include "parse_util.hh"
00063
00064 class EbnfNode;
00065 class LaSpec;
00066 class CatchClause;
00067
00077 class IEbnfNodeBuilder
00078 {
00079 public:
00080
00081 virtual EbnfNode* createOrNode (EbnfNode *pre, EbnfNode *post,
00082 const Position &pos) = 0;
00083
00084 virtual EbnfNode* createCatNode (EbnfNode *pre, EbnfNode *post,
00085 const Position &pos) = 0;
00086
00087 virtual EbnfNode* createPlusNode (EbnfNode *in,
00088 const Position &pos) = 0;
00089
00090 virtual EbnfNode* createStarNode (EbnfNode *in,
00091 const Position &pos) = 0;
00092
00093 virtual EbnfNode* createOptionalNode (EbnfNode *in,
00094 const Position &pos) = 0;
00095
00096 virtual EbnfNode* createNonterminalNode (const string &targetVar,
00097 const Position &targetVarPoa,
00098 const string &nontermId,
00099 const string &actualArgs,
00100 const Position &actualArgsPos,
00101 const Position &pos) = 0;
00102
00103 virtual EbnfNode* createTerminalNode (const string &termId,
00104 const Position &pos)
00105 throw (ParseException) = 0;
00106
00110 virtual LaSpec* createLaSpec (int fixedla, EbnfNode *synLa,
00111 const string &semLa,
00112 const Position &pos) = 0;
00113
00118 virtual CatchClause* createCatchClause (const string &exceptionDecl,
00119 const Position &edPos,
00120 const string &code,
00121 const Position &edPos) = 0;
00122
00123 virtual void setLookahead (EbnfNode* node, LaSpec* la) = 0;
00124
00125 virtual void setStartCode (EbnfNode *node, const string &code, bool force,
00126 const Position &pos) = 0;
00127
00128 virtual void setEndCode (EbnfNode *node, const string &code, bool force,
00129 const Position &pos) = 0;
00130
00131 virtual void setCatchClauses (EbnfNode *node,
00132 vector<CatchClause> &catchList) = 0;
00133
00134 };
00135
00136 #endif