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 __EBNF_NODE_BUILDER_HH__
00050 #define __EBNF_NODE_BUILDER_HH__
00051
00052 #include "iebnf_node_builder.hh"
00053 #include "token_spec.hh"
00054
00055 class PropRegistry;
00056
00057 class EbnfNodeBuilder : public IEbnfNodeBuilder
00058 {
00059 public:
00060
00061 EbnfNodeBuilder (PropRegistry ®istry_, ITokenSpec &tokens_) :
00062 registry(registry_), tokens(tokens_)
00063 {}
00064
00065 virtual EbnfNode* createOrNode (EbnfNode *pre, EbnfNode *post,
00066 const Position &pos);
00067
00068 virtual EbnfNode* createCatNode (EbnfNode *pre, EbnfNode *post,
00069 const Position &pos);
00070
00071 virtual EbnfNode* createPlusNode (EbnfNode *in,
00072 const Position &pos);
00073
00074 virtual EbnfNode* createStarNode (EbnfNode *in,
00075 const Position &pos);
00076
00077 virtual EbnfNode* createOptionalNode (EbnfNode *in,
00078 const Position &pos);
00079
00080 virtual EbnfNode* createNonterminalNode (const string &targetVar,
00081 const Position &targetVarPos,
00082 const string &nontermId,
00083 const string &actualArgs,
00084 const Position &actualArgsPos,
00085 const Position &pos);
00086
00087 virtual EbnfNode* createTerminalNode (const string &termId,
00088 const Position &pos)
00089 throw (ParseException);
00090
00091 virtual LaSpec* createLaSpec (int fixedla, EbnfNode *synLa,
00092 const string &semLa,
00093 const Position &pos);
00094
00095 virtual CatchClause* createCatchClause (const string &exceptionDecl,
00096 const Position &edPos,
00097 const string &code,
00098 const Position &codePos);
00099
00100 virtual void setLookahead (EbnfNode* node, LaSpec* la);
00101
00102 virtual void setStartCode (EbnfNode *node,
00103 const string &code, bool force,
00104 const Position &pos);
00105
00106 virtual void setEndCode (EbnfNode *node,
00107 const string &code, bool force,
00108 const Position &pos);
00109
00110 virtual void setCatchClauses (EbnfNode *node,
00111 vector<CatchClause> &catchList);
00112
00113 private:
00114
00115 PropRegistry ®istry;
00116
00117 ITokenSpec &tokens;
00118 };
00119
00120 #endif