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 #ifndef __LA_PARSER_WRITER_HH__
00047 #define __LA_PARSER_WRITER_HH__
00048
00049 #include <vector>
00050
00051 #include "debug.h"
00052 #include "vbitset.hh"
00053 #include "writer.hh"
00054
00055 class PropRegistry;
00056 class ParserSpec;
00057 class ITokenSpec;
00058 class ProductionSpec;
00059 class EbnfLaNode;
00060 class NumberedLaSpec;
00061 class LaEpDefWriter;
00062
00066 class LaParserWriter : public Writer
00067 {
00068 friend class LaEpDefWriter;
00069 friend class LaEpDeclWriter;
00070
00071 public:
00072
00073 LaParserWriter (PropRegistry ®istry_) : Writer(registry_)
00074 {}
00075
00079 void writeParser (ParserSpec &pSpec, ITokenSpec &tSpec,
00080 const string &scannerClass);
00081
00082 protected:
00083
00087 void writeProductionDecls (vector<ProductionSpec> &prods);
00088
00093 void writeProductionLaDecls (vector<ProductionSpec> &prods);
00094
00099 void writeLaEpDecls(vector<ProductionSpec> &prods);
00100
00104 void writeProductionDefs (vector<ProductionSpec> &prods,
00105 const string &parserClass,
00106 ITokenSpec &tokens);
00107
00113 ostream& makeLaCondition (vBitset &tMask, NumberedLaSpec *la,
00114 ITokenSpec &tokens);
00115
00119 void writeEbnf (EbnfLaNode &n, ITokenSpec &tokens);
00120
00125 void writeEbnfLa (EbnfLaNode &n, ITokenSpec &tokens);
00126
00131 void writeLaDefs (vector<ProductionSpec> &prods,
00132 const string &parserClass,
00133 ITokenSpec &tokens, PropRegistry ®istry);
00134
00135 };
00136
00137 #endif