00001 #ifndef INC_NexiParser_hpp_ 00002 #define INC_NexiParser_hpp_ 00003 00004 #line 18 "nexilang.g" 00005 00006 #include "indri/QuerySpec.hpp" 00007 #include "indri/DateParse.hpp" 00008 #include "indri/delete_range.hpp" 00009 #include "indri/NexiLexer.hpp" 00010 #include <algorithm> 00011 #include <cctype> 00012 00013 #line 14 "NexiParser.hpp" 00014 #include <antlr/config.hpp> 00015 /* $ANTLR 2.7.3 (20060307-1): "nexilang.g" -> "NexiParser.hpp"$ */ 00016 #include <antlr/TokenStream.hpp> 00017 #include <antlr/TokenBuffer.hpp> 00018 #include "NexiLexerTokenTypes.hpp" 00019 #include <antlr/LLkParser.hpp> 00020 00021 ANTLR_BEGIN_NAMESPACE(indri) 00022 ANTLR_BEGIN_NAMESPACE(lang) 00023 class CUSTOM_API NexiParser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public NexiLexerTokenTypes 00024 { 00025 #line 132 "nexilang.g" 00026 00027 private: 00028 // storage for allocated nodes 00029 std::vector<indri::lang::Node*> _nodes; 00030 // makes sure nodes go away when parser goes away 00031 indri::utility::VectorDeleter<indri::lang::Node*> _deleter; 00032 bool _shrinkage; 00033 00034 public: 00035 void init( NexiLexer* lexer ) { 00036 _deleter.setVector( _nodes ); 00037 _shrinkage = true; 00038 } 00039 00040 void setShrinkage( bool shrink ) { 00041 _shrinkage = shrink; 00042 } 00043 #line 25 "NexiParser.hpp" 00044 public: 00045 void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); 00046 protected: 00047 NexiParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k); 00048 public: 00049 NexiParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf); 00050 protected: 00051 NexiParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k); 00052 public: 00053 NexiParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer); 00054 NexiParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state); 00055 int getNumTokens() const 00056 { 00057 return NexiParser::NUM_TOKENS; 00058 } 00059 const char* getTokenName( int type ) const 00060 { 00061 if( type > getNumTokens() ) return 0; 00062 return NexiParser::tokenNames[type]; 00063 } 00064 const char* const* getTokenNames() const 00065 { 00066 return NexiParser::tokenNames; 00067 } 00068 public: indri::lang::ScoredExtentNode* query(); 00069 public: indri::lang::NestedExtentInside* path(); 00070 public: indri::lang::RawExtentNode * field(); 00071 public: indri::lang::ScoredExtentNode* clause(); 00072 public: indri::lang::ScoredExtentNode* termList(); 00073 public: indri::lang::ScoredExtentNode* term(); 00074 public: indri::lang::ScoredExtentNode* filter(); 00075 public: indri::lang::UnweightedCombinationNode* logical(); 00076 public: indri::lang::ScoredExtentNode* aboutClause(); 00077 public: indri::lang::RawExtentNode * arithmeticClause(); 00078 public: indri::lang::ScoredExtentNode* filterParens(); 00079 public: INT64 number(); 00080 public: indri::lang::ScoredExtentNode * unrestrictedTerm(); 00081 public: indri::lang::RawExtentNode* rawText(); 00082 public: indri::lang::ODNode* odNode(); 00083 public: 00084 ANTLR_USE_NAMESPACE(antlr)RefAST getAST() 00085 { 00086 return returnAST; 00087 } 00088 00089 protected: 00090 ANTLR_USE_NAMESPACE(antlr)RefAST returnAST; 00091 private: 00092 static const char* tokenNames[]; 00093 #ifndef NO_STATIC_CONSTS 00094 static const int NUM_TOKENS = 44; 00095 #else 00096 enum { 00097 NUM_TOKENS = 44 00098 }; 00099 #endif 00100 00101 static const unsigned long _tokenSet_0_data_[]; 00102 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; 00103 static const unsigned long _tokenSet_1_data_[]; 00104 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; 00105 }; 00106 00107 ANTLR_END_NAMESPACE 00108 ANTLR_END_NAMESPACE 00109 #endif /*INC_NexiParser_hpp_*/