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

 1 mike  1.1.2.1 //%/////////////////////////////////////////////////////////////////////////////
 2               //
 3               // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM, 
 4               // The Open Group, Tivoli Systems
 5               //
 6               // Permission is hereby granted, free of charge, to any person obtaining a copy
 7               // of this software and associated documentation files (the "Software"), to 
 8               // deal in the Software without restriction, including without limitation the 
 9               // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 
10               // sell copies of the Software, and to permit persons to whom the Software is
11               // furnished to do so, subject to the following conditions:
12               // 
13               // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN 
14               // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15               // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16               // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
17               // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
18               // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
19               // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20               // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21               //
22 mike  1.1.2.1 //==============================================================================
23               //
24               // Author: Mike Brasher (mbrasher@bmc.com)
25               //
26               // Modified By:
27               //
28               //%/////////////////////////////////////////////////////////////////////////////
29               
30               #ifndef Pegasus_WQLParser_h
31               #define Pegasus_WQLParser_h
32               
33               #include <Pegasus/Common/Config.h>
34 mike  1.1.2.2 #include <Pegasus/Common/Array.h>
35 mike  1.1.2.1 #include <Pegasus/WQL/Linkage.h>
36 mike  1.1.2.3 #include <Pegasus/WQL/WQLSelectStatement.h>
37 mike  1.1.2.1 
38               PEGASUS_NAMESPACE_BEGIN
39               
40 mike  1.1.2.4 /** This class provides the parser interface for the WQL parser.
41               
42                   Here is an example of how to parse a SELECT statement using this
43                   class:
44               
45                   <pre>
46               	const char TEXT[] = "SELECT X,Y FROM MyClass WEHERE X > 10 AND Y < 3";
47               	Array<Sint8> text(TEXT, sizeof(TEXT));
48               	WQLSelectStatement selectStatement;
49               
50               	WQLParser parser;
51               
52               	try
53               	{
54               	    parser.parse(text, selectStatement);
55               	}
56               	catch (ParseError&)
57               	{
58               	    ...
59               	}
60               	catch (MissingNullTerminator&)
61 mike  1.1.2.4 	{
62               	    ...
63               	}
64                   </pre>
65               
66                   NOTE: the text must be NULL terminated or else the MissingNullTerminator
67                   exception is thrown.
68               */
69 mike  1.1.2.1 class PEGASUS_WQL_LINKAGE WQLParser
70               {
71               public:
72               
73 mike  1.1.2.4     /** Parse the SELECT statement given by the text parameter and initialize
74               	the statement parameter accordingly.
75               
76               	@param text null terminated array of characters containing a SELECT
77               	    statement.
78               	@param statement object which holds the compiled version of the SELECT
79               	    statement upon return.
80               	@exception throws ParseError if text is not a valid SELECT statement.
81               	@exception throws MissingNullTerminator if text argument is not 
82               	    terminated with a null. 
83               
84               	ATTN: this method is NOT thread safe. Needs mutexes.
85                   */
86 mike  1.1.2.3     static void parse(
87               	const Array<Sint8>& text,
88               	WQLSelectStatement& statement);
89 mike  1.1.2.2 
90               private:
91               
92                   WQLParser() { }
93 mike  1.1.2.1 };
94               
95               PEGASUS_NAMESPACE_END
96               
97               #endif /* Pegasus_WQLParser_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2