1 {*********************************************************}
3 { Zeos Database Objects }
4 { String tokenizing classes for Oracle }
6 { Originally written by Sergey Seroukhov }
8 {*********************************************************}
10 {@********************************************************}
11 { Copyright (c) 1999-2012 Zeos Development Group }
13 { License Agreement: }
15 { This library is distributed in the hope that it will be }
16 { useful, but WITHOUT ANY WARRANTY; without even the }
17 { implied warranty of MERCHANTABILITY or FITNESS FOR }
18 { A PARTICULAR PURPOSE. See the GNU Lesser General }
19 { Public License for more details. }
21 { The source code of the ZEOS Libraries and packages are }
22 { distributed under the Library GNU General Public }
23 { License (see the file COPYING / COPYING.ZEOS) }
24 { with the following modification: }
25 { As a special exception, the copyright holders of this }
26 { library give you permission to link this library with }
27 { independent modules to produce an executable, }
28 { regardless of the license terms of these independent }
29 { modules, and to copy and distribute the resulting }
30 { executable under terms of your choice, provided that }
31 { you also meet, for each linked independent module, }
32 { the terms and conditions of the license of that module. }
33 { An independent module is a module which is not derived }
34 { from or based on this library. If you modify this }
35 { library, you may extend this exception to your version }
36 { of the library, but you are not obligated to do so. }
37 { If you do not wish to do so, delete this exception }
38 { statement from your version. }
41 { The project web site is located on: }
42 { http://zeos.firmos.at (FORUM) }
43 { http://sourceforge.net/p/zeoslib/tickets/ (BUGTRACKER)}
44 { svn://svn.code.sf.net/p/zeoslib/code-0/trunk (SVN) }
46 { http://www.sourceforge.net/projects/zeoslib. }
49 { Zeos Development Group. }
50 {********************************************************@}
59 Classes, ZTokenizer, ZGenericSqlToken, ZPostgreSqlToken,
64 {** Implements a Oracle-specific number state object. }
65 TZOracleNumberState = class (TZPostgreSQLNumberState)
68 {** Implements a Oracle-specific quote string state object. }
69 TZOracleQuoteState = class (TZGenericSQLQuoteState)
73 This state will either delegate to a comment-handling
74 state, or return a token with just a slash in it.
76 TZOracleCommentState = class (TZSybaseCommentState)
79 {** Implements a symbol state object. }
80 TZOracleSymbolState = class (TZSymbolState)
85 {** Implements a word state object. }
86 TZOracleWordState = class (TZGenericSQLWordState)
91 {** Implements a default tokenizer object. }
92 TZOracleTokenizer = class (TZTokenizer)
99 { TZOracleSymbolState }
102 Creates this Oracle-specific symbol state object.
104 constructor TZOracleSymbolState.Create;
114 { TZOracleWordState }
117 Constructs this Oracle-specific word state object.
119 constructor TZOracleWordState.Create;
121 SetWordChars(#0, #255, False);
122 SetWordChars('a', 'z', True);
123 SetWordChars('A', 'Z', True);
124 SetWordChars('0', '9', True);
125 SetWordChars('_', '_', True);
126 SetWordChars('$', '$', True);
127 SetWordChars('#', '#', True);
128 SetWordChars('@', '@', True);
131 { TZOracleTokenizer }
134 Constructs a tokenizer with a default state table (as
135 described in the class comment).
137 constructor TZOracleTokenizer.Create;
139 EscapeState := TZEscapeState.Create;
140 WhitespaceState := TZWhitespaceState.Create;
142 SymbolState := TZOracleSymbolState.Create;
143 NumberState := TZOracleNumberState.Create;
144 QuoteState := TZOracleQuoteState.Create;
145 WordState := TZOracleWordState.Create;
146 CommentState := TZOracleCommentState.Create;
148 SetCharacterState(#0, #32, WhitespaceState);
149 SetCharacterState(#33, #191, SymbolState);
150 SetCharacterState(#192, High(Char), WordState);
152 SetCharacterState('a', 'z', WordState);
153 SetCharacterState('A', 'Z', WordState);
154 SetCharacterState('_', '_', WordState);
155 SetCharacterState('$', '$', WordState);
156 SetCharacterState('#', '#', WordState);
158 SetCharacterState('0', '9', NumberState);
159 SetCharacterState('.', '.', NumberState);
161 SetCharacterState('"', '"', QuoteState);
162 SetCharacterState(#39, #39, QuoteState);
164 SetCharacterState('/', '/', CommentState);
165 SetCharacterState('-', '-', CommentState);