Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Vrml97Parser.hpp

00001 #ifndef INC_Vrml97Parser_hpp_
00002 #define INC_Vrml97Parser_hpp_
00003 
00004 #include "antlr/config.hpp"
00005 /* $ANTLR 2.7.1: "Vrml97Parser.g" -> "Vrml97Parser.hpp"$ */
00006 #include "antlr/TokenStream.hpp"
00007 #include "antlr/TokenBuffer.hpp"
00008 #include "Vrml97ParserTokenTypes.hpp"
00009 #include "antlr/LLkParser.hpp"
00010 
00011 #line 21 "Vrml97Parser.g"
00012 
00013 # include <memory>
00014 # include "field.h"
00015 # include "nodeptr.h"
00016 # include "fieldvalueptr.h"
00017 # define ANTLR_LBRACE {
00018 # define ANTLR_RBRACE }
00019 
00020 namespace OpenVRML {
00021     class Scope;
00022     class ScriptNode;
00023     class NodeType;
00024     class Doc2;
00025 }
00026 
00027 namespace {
00028     class Vrml97Scanner : public antlr::TokenStream {
00029     public:
00030         static const int EOF_;
00031         //
00032         // The following identifiers for constants must match those in the file
00033         // Vrml97TokenTypes.txt.
00034         //
00035         static const int PERIOD;
00036         static const int LBRACKET;
00037         static const int RBRACKET;
00038         static const int LBRACE;
00039         static const int RBRACE;
00040         static const int ID;
00041         static const int INTEGER;
00042         static const int HEX_INTEGER;
00043         static const int REAL;
00044         static const int STRING;
00045         static const int KEYWORD_DEF;
00046         static const int KEYWORD_EVENTIN;
00047         static const int KEYWORD_EVENTOUT;
00048         static const int KEYWORD_EXPOSEDFIELD;
00049         static const int KEYWORD_EXTERNPROTO;
00050         static const int KEYWORD_FALSE;
00051         static const int KEYWORD_FIELD;
00052         static const int KEYWORD_IS;
00053         static const int KEYWORD_NULL;
00054         static const int KEYWORD_PROTO;
00055         static const int KEYWORD_ROUTE;
00056         static const int KEYWORD_TO;
00057         static const int KEYWORD_TRUE;
00058         static const int KEYWORD_USE;
00059         static const int FIELDTYPE_SFBOOL;
00060         static const int FIELDTYPE_SFCOLOR;
00061         static const int FIELDTYPE_SFFLOAT;
00062         static const int FIELDTYPE_SFIMAGE;
00063         static const int FIELDTYPE_SFINT32;
00064         static const int FIELDTYPE_SFNODE;
00065         static const int FIELDTYPE_SFROTATION;
00066         static const int FIELDTYPE_SFSTRING;
00067         static const int FIELDTYPE_SFTIME;
00068         static const int FIELDTYPE_SFVEC2F;
00069         static const int FIELDTYPE_SFVEC3F;
00070         static const int FIELDTYPE_MFCOLOR;
00071         static const int FIELDTYPE_MFFLOAT;
00072         static const int FIELDTYPE_MFINT32;
00073         static const int FIELDTYPE_MFNODE;
00074         static const int FIELDTYPE_MFROTATION;
00075         static const int FIELDTYPE_MFSTRING;
00076         static const int FIELDTYPE_MFTIME;
00077         static const int FIELDTYPE_MFVEC2F;
00078         static const int FIELDTYPE_MFVEC3F;
00079 
00080         Vrml97Scanner(std::istream &);
00081 
00082         virtual antlr::RefToken nextToken();
00083 
00084         size_t line() const;
00085         size_t col() const;
00086 
00087     private:
00088         void _getNextChar();
00089         void _identifyKeyword(antlr::Token &);
00090         void _identifyFieldType(antlr::Token &);
00091         void _identifyTerminalSymbol(antlr::Token &);
00092 
00093         std::istream & _istm;
00094         size_t      _line;
00095         size_t      _col;
00096         int         _c;
00097         int         _prevChar;
00098         int         _prevTokenType;
00099         bool        _readTooMuch;
00100         bool        _expectingFieldType;
00101     };
00102 }
00103 
00104 namespace OpenVRML ANTLR_LBRACE
00105 
00106 #line 107 "Vrml97Parser.hpp"
00107 class Vrml97Parser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public Vrml97ParserTokenTypes
00108  {
00109 #line 605 "Vrml97Parser.g"
00110 
00111 public:
00112     Vrml97Parser(antlr::TokenStream & lexer, const std::string & uri):
00113         antlr::LLkParser(lexer, 1),
00114         uri(uri)
00115     {
00116         setTokenNames(_tokenNames);
00117     }
00118 
00119 private:
00120     const std::string uri;
00121 #line 111 "Vrml97Parser.hpp"
00122 protected:
00123         Vrml97Parser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k);
00124 public:
00125         Vrml97Parser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf);
00126 protected:
00127         Vrml97Parser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k);
00128 public:
00129         Vrml97Parser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer);
00130         Vrml97Parser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state);
00131         public: void vrmlScene(
00132                 OpenVRML::Browser & browser,
00133           OpenVRML::MFNode & mfNode
00134         );
00135         public: void statement(
00136                 OpenVRML::Browser & browser,
00137           OpenVRML::MFNode & mfNode,
00138           const OpenVRML::ScopePtr & scope
00139         );
00140         public: OpenVRML::NodePtr  nodeStatement(
00141                 OpenVRML::Browser & browser,
00142               const OpenVRML::ScopePtr & scope
00143         );
00144         public: void protoStatement(
00145                 OpenVRML::Browser & browser,
00146                const OpenVRML::ScopePtr & scope
00147         );
00148         public: void routeStatement(
00149                 const OpenVRML::Scope & scope
00150         );
00151         public: OpenVRML::NodePtr  node(
00152                 OpenVRML::Browser & browser,
00153      const OpenVRML::ScopePtr & scope,
00154      const std::string & nodeId
00155         );
00156         public: void externproto(
00157                 OpenVRML::Browser & browser, const OpenVRML::ScopePtr & scope
00158         );
00159         public: void proto(
00160                 OpenVRML::Browser & browser,
00161       const OpenVRML::ScopePtr & scope
00162         );
00163         public: void protoInterfaceDeclaration(
00164                 const OpenVRML::ScopePtr & scope,
00165                           OpenVRML::ProtoNodeClass & proto
00166         );
00167         public: void protoBody(
00168                 const OpenVRML::ScopePtr & scope,
00169           OpenVRML::ProtoNodeClass & proto
00170         );
00171         public: OpenVRML::NodeInterface::Type  eventInterfaceType();
00172         public: OpenVRML::FieldValue::Type  fieldType();
00173         public: OpenVRML::NodeInterface::Type  fieldInterfaceType();
00174         public: OpenVRML::FieldValuePtr  fieldValue(
00175                 OpenVRML::Browser & browser,
00176            const OpenVRML::ScopePtr & scope,
00177            OpenVRML::FieldValue::Type ft
00178         );
00179         public: OpenVRML::NodePtr  protoNodeStatement(
00180                 OpenVRML::ProtoNodeClass & proto,
00181                    const OpenVRML::ScopePtr & scope
00182         );
00183         public: void protoBodyStatement(
00184                 OpenVRML::ProtoNodeClass & proto,
00185                    const OpenVRML::ScopePtr & scope
00186         );
00187         public: OpenVRML::NodePtr  protoNode(
00188                 OpenVRML::ProtoNodeClass & proto,
00189           const OpenVRML::ScopePtr & scope,
00190           const std::string & nodeId
00191         );
00192         public: void externInterfaceDeclaration(
00193                 OpenVRML::NodeInterfaceSet & interfaces
00194         );
00195         public: OpenVRML::MFString  externprotoUrlList();
00196         public: OpenVRML::NodeInterface::Type  interfaceType();
00197         public: std::string  stringValue();
00198         public: void nodeBodyElement(
00199                 const OpenVRML::ScopePtr & scope,
00200                 OpenVRML::Node & node
00201         );
00202         public: void scriptInterfaceDeclaration(
00203                 const OpenVRML::ScopePtr & scope,
00204                            OpenVRML::ScriptNode & node
00205         );
00206         public: void scriptFieldInterfaceDeclaration(
00207                 const OpenVRML::ScopePtr & scope,
00208                                 OpenVRML::ScriptNode & node
00209         );
00210         public: void protoNodeBodyElement(
00211                 OpenVRML::ProtoNodeClass & proto,
00212                      const OpenVRML::ScopePtr & scope,
00213                      OpenVRML::Node & node
00214         );
00215         public: void protoScriptInterfaceDeclaration(
00216                 OpenVRML::ProtoNodeClass & proto,
00217                                 const OpenVRML::ScopePtr & scope,
00218                                 OpenVRML::ScriptNode & node
00219         );
00220         public: OpenVRML::FieldValuePtr  protoFieldValue(
00221                 OpenVRML::ProtoNodeClass & proto,
00222                 const OpenVRML::ScopePtr & scope,
00223                 OpenVRML::FieldValue::Type ft
00224         );
00225         public: void isStatement(
00226                 OpenVRML::ProtoNodeClass & proto, OpenVRML::Node & node,
00227             std::string const & nodeInterfaceId
00228         );
00229         public: void protoScriptFieldInterfaceDeclaration(
00230                 OpenVRML::ProtoNodeClass & proto,
00231                                      const OpenVRML::ScopePtr & scope,
00232                                      OpenVRML::ScriptNode & node
00233         );
00234         public: OpenVRML::FieldValuePtr  nodeFieldValue(
00235                 OpenVRML::Browser & browser,
00236                const OpenVRML::ScopePtr & scope,
00237                OpenVRML::FieldValue::Type ft
00238         );
00239         public: OpenVRML::FieldValuePtr  nonNodeFieldValue(
00240                 OpenVRML::FieldValue::Type ft
00241         );
00242         public: OpenVRML::FieldValuePtr  protoNodeFieldValue(
00243                 OpenVRML::ProtoNodeClass & proto,
00244                     const OpenVRML::ScopePtr & scope,
00245                     OpenVRML::FieldValue::Type ft
00246         );
00247         public: OpenVRML::FieldValuePtr  sfBoolValue();
00248         public: OpenVRML::FieldValuePtr  sfColorValue();
00249         public: OpenVRML::FieldValuePtr  sfFloatValue();
00250         public: OpenVRML::FieldValuePtr  sfImageValue();
00251         public: OpenVRML::FieldValuePtr  sfInt32Value();
00252         public: OpenVRML::FieldValuePtr  sfRotationValue();
00253         public: OpenVRML::FieldValuePtr  sfStringValue();
00254         public: OpenVRML::FieldValuePtr  sfTimeValue();
00255         public: OpenVRML::FieldValuePtr  sfVec2fValue();
00256         public: OpenVRML::FieldValuePtr  sfVec3fValue();
00257         public: OpenVRML::FieldValuePtr  mfColorValue();
00258         public: OpenVRML::FieldValuePtr  mfFloatValue();
00259         public: OpenVRML::FieldValuePtr  mfInt32Value();
00260         public: OpenVRML::FieldValuePtr  mfRotationValue();
00261         public: OpenVRML::FieldValuePtr  mfStringValue();
00262         public: OpenVRML::FieldValuePtr  mfTimeValue();
00263         public: OpenVRML::FieldValuePtr  mfVec2fValue();
00264         public: OpenVRML::FieldValuePtr  mfVec3fValue();
00265         public: OpenVRML::FieldValuePtr  sfNodeValue(
00266                 OpenVRML::Browser & browser,
00267             const OpenVRML::ScopePtr & scope
00268         );
00269         public: OpenVRML::FieldValuePtr  mfNodeValue(
00270                 OpenVRML::Browser & browser,
00271             const OpenVRML::ScopePtr & scope
00272         );
00273         public: OpenVRML::FieldValuePtr  protoSfNodeValue(
00274                 OpenVRML::ProtoNodeClass & proto,
00275                  const OpenVRML::ScopePtr & scope
00276         );
00277         public: OpenVRML::FieldValuePtr  protoMfNodeValue(
00278                 OpenVRML::ProtoNodeClass & proto,
00279                  const OpenVRML::ScopePtr & scope
00280         );
00281         public: bool  boolValue();
00282         public: void colorValue(
00283                 float c[3]
00284         );
00285         public: float  colorComponent();
00286         public: float  floatValue();
00287         public: long  intValue();
00288         public: void rotationValue(
00289                 float r[4]
00290         );
00291         public: double  doubleValue();
00292         public: void vec2fValue(
00293                 float v[2]
00294         );
00295         public: void vec3fValue(
00296                 float v[3]
00297         );
00298 private:
00299         static const char* _tokenNames[];
00300         
00301         static const unsigned long _tokenSet_0_data_[];
00302         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
00303         static const unsigned long _tokenSet_1_data_[];
00304         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
00305         static const unsigned long _tokenSet_2_data_[];
00306         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
00307         static const unsigned long _tokenSet_3_data_[];
00308         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
00309         static const unsigned long _tokenSet_4_data_[];
00310         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
00311         static const unsigned long _tokenSet_5_data_[];
00312         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5;
00313         static const unsigned long _tokenSet_6_data_[];
00314         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6;
00315         static const unsigned long _tokenSet_7_data_[];
00316         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7;
00317         static const unsigned long _tokenSet_8_data_[];
00318         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8;
00319         static const unsigned long _tokenSet_9_data_[];
00320         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9;
00321         static const unsigned long _tokenSet_10_data_[];
00322         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10;
00323         static const unsigned long _tokenSet_11_data_[];
00324         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11;
00325         static const unsigned long _tokenSet_12_data_[];
00326         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12;
00327         static const unsigned long _tokenSet_13_data_[];
00328         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13;
00329         static const unsigned long _tokenSet_14_data_[];
00330         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14;
00331         static const unsigned long _tokenSet_15_data_[];
00332         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_15;
00333         static const unsigned long _tokenSet_16_data_[];
00334         static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_16;
00335 };
00336 
00337 #endif /*INC_Vrml97Parser_hpp_*/