(file) Return to CQLParserState.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

  1 martin 1.7 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.8 //
  3 martin 1.7 // Licensed to The Open Group (TOG) under one or more contributor license
  4            // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5            // this work for additional information regarding copyright ownership.
  6            // Each contributor licenses this file to you under the OpenPegasus Open
  7            // Source License; you may not use this file except in compliance with the
  8            // License.
  9 martin 1.8 //
 10 martin 1.7 // Permission is hereby granted, free of charge, to any person obtaining a
 11            // copy of this software and associated documentation files (the "Software"),
 12            // to deal in the Software without restriction, including without limitation
 13            // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14            // and/or sell copies of the Software, and to permit persons to whom the
 15            // Software is furnished to do so, subject to the following conditions:
 16 martin 1.8 //
 17 martin 1.7 // The above copyright notice and this permission notice shall be included
 18            // in all copies or substantial portions of the Software.
 19 martin 1.8 //
 20 martin 1.7 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.8 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.7 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23            // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24            // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25            // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26            // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.8 //
 28 martin 1.7 //////////////////////////////////////////////////////////////////////////
 29 chuck  1.2 //
 30            //%/////////////////////////////////////////////////////////////////////////////
 31            
 32            #ifndef Pegasus_CQLParserState_h
 33            #define Pegasus_CQLParserState_h
 34            
 35            #include <Pegasus/Common/Config.h>
 36            #include <Pegasus/Common/ArrayInternal.h>
 37            #include <Pegasus/CQL/CQLSelectStatement.h>
 38            
 39            #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
 40            
 41            PEGASUS_NAMESPACE_BEGIN
 42            
 43            /** This is an internal structure used for holding parser state information
 44                during parsing (while inside the WQLParser::parse() method). Instances
 45                of this class are created and destroyed by WQLParser::parse().
 46            */
 47            struct CQLParserState
 48            {
 49                //
 50 chuck  1.2     // Text containing SELECT statement (must be null-terminated).
 51                //
 52            
 53                const char* text;
 54            
 55                //
 56                // Size in bytes (including null terminator) of the text.
 57                //
 58            
 59                Uint32 textSize;
 60            
 61                //
 62                // Offset to current parser position in the above text.
 63                //
 64            
 65                Uint32 offset;
 66            
 67                //
 68                // The output object being initialized during parsing. This object is
 69                // set to point to the statement argument passed to the WQLParser::parse()
 70                // method.
 71 chuck  1.2     //
 72            
 73                CQLSelectStatement* statement;
 74            
 75                //
 76                // Set to true when there is an error (set by WQL_error()).
 77                //
 78            
 79                Boolean error;
 80            
 81                //
 82                // Error message if any (set by WQL_error()).
 83                //
 84            
 85                String errorMessage;
 86            
 87                //
 88                // A list of strings created by lexer. These are deleted by the
 89                // WQLParser when cleaning up in the parse() method. It is not possible
 90                // to reliably clean them up anywhere else due to potential parse errors
 91                // which prevent YACC actions (which might attempt to free them) from
 92 chuck  1.2     // being reached. These strings are outstanding in the sense that they
 93                // need to be cleaned up (not in the sense that they are excellent examples
 94                // of strings).
 95                //
 96            
 97                Array<char*> outstandingStrings;
 98            
 99 humberto 1.3     //
100 karl     1.6     // This tracks the current token position within the Select Statement
101                  // being parsed
102 humberto 1.3     // This is incremented and cleared in CQL.l
103                  //
104 chuck    1.2     Uint32 currentTokenPos;
105              
106 humberto 1.3     //
107                  // This tracks the token number we are curently processing.
108                  // This is incremented and cleared in CQL.l
109                  //
110 chuck    1.2     Uint32 tokenCount;
111              
112 humberto 1.3     //
113 karl     1.6     // This tracks the current rule in String format in the Select Statement
114                  // we are currently parsing
115 humberto 1.3     // This is updated with each production in CQL.y
116                  //
117 chuck    1.2     String currentRule;
118              
119              };
120              
121              PEGASUS_NAMESPACE_END
122              #endif
123              #endif /* Pegasus_CQLParserState_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2