1 mike 1.2 //%/////////////////////////////////////////////////////////////////////////////
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.2 //==============================================================================
23 //
24 // Author: Mike Brasher (mbrasher@bmc.com)
25 //
26 // Modified By:
27 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30 #ifndef Pegasus_WQLParserState_h
31 #define Pegasus_WQLParserState_h
32
33 #include <Pegasus/Common/Config.h>
34 #include <Pegasus/Common/Array.h>
35 #include <Pegasus/WQL/WQLSelectStatement.h>
36
37 PEGASUS_NAMESPACE_BEGIN
38
39 /** This is an internal structure used for holding parser state information
40 during parsing (while inside the WQLParser::parse() method). Instances
41 of this class are created and destroyed by WQLParser::parse().
42 */
43 mike 1.2 struct WQLParserState
44 {
45 //
46 // Text containing SELECT statement (must be null-terminated).
47 //
48
49 Array<Sint8> text;
50
51 //
52 // Offset to current parser position in the above text.
53 //
54
55 Uint32 offset;
56
57 //
58 // The output object being initialized during parsing. This object is
59 // set to point to the statment argument passed to the WQLParser::parse()
60 // method.
61 //
62
63 WQLSelectStatement* statement;
64 mike 1.2
65 //
66 // Set to true when there is an error (set by WQL_error()).
67 //
68
69 Boolean error;
70
71 //
72 // Error message if any (set by WQL_error()).
73 //
74
75 String errorMessage;
76
77 //
78 // A list of strings created by lexer. These are deleted by the
79 // WQLParser when cleaning up in the parse() method. It is not possible
80 // to reliably clean them up anywhere else due to potential parse errors
81 // which prevent YACC actions (which might attempt to free them) from
82 // being reached. These strings are outstanding in the sense that they
83 // need to be cleaned up (not in the sense that they are excellent examples
84 // of strings).
85 mike 1.2 //
86
87 Array<char*> outstandingStrings;
88 };
89
90 PEGASUS_NAMESPACE_END
91
92 #endif /* Pegasus_WQLParserState_h */
|