📄 jvquibsqlparser.pas
字号:
(tok_ident: VERSION; tok_string: 'RECORD_VERSION'; tok_version: 1),
(tok_ident: RECREATE; tok_string: 'RECREATE'; tok_version: 2),
(tok_ident: REFERENCES; tok_string: 'REFERENCES'; tok_version: 1),
(tok_ident: RELEASE; tok_string: 'RELEASE'; tok_version: 2),
(tok_ident: RESERVING; tok_string: 'RESERV'; tok_version: 1), (* Alias of RESERVING *)
(tok_ident: RESERVING; tok_string: 'RESERVING'; tok_version: 1),
(tok_ident: RESTRICT; tok_string: 'RESTRICT'; tok_version: 1),
(tok_ident: RETAIN; tok_string: 'RETAIN'; tok_version: 1),
(tok_ident: RETURNING_VALUES; tok_string: 'RETURNING_VALUES'; tok_version: 1),
(tok_ident: RETURNS; tok_string: 'RETURNS'; tok_version: 1),
(tok_ident: REVOKE; tok_string: 'REVOKE'; tok_version: 1),
(tok_ident: RIGHT; tok_string: 'RIGHT'; tok_version: 1),
(tok_ident: ROLE; tok_string: 'ROLE'; tok_version: 1),
(tok_ident: ROLLBACK; tok_string: 'ROLLBACK'; tok_version: 1),
(tok_ident: ROW_COUNT; tok_string: 'ROW_COUNT'; tok_version: 2),
(tok_ident: SAVEPOINT; tok_string: 'SAVEPOINT'; tok_version: 2),
(tok_ident: DATABASE; tok_string: 'SCHEMA'; tok_version: 1), (* Alias of DATABASE *)
(tok_ident: SECOND; tok_string: 'SECOND'; tok_version: 2),
(tok_ident: SEGMENT; tok_string: 'SEGMENT'; tok_version: 1),
(tok_ident: SELECT; tok_string: 'SELECT'; tok_version: 1),
(tok_ident: KW_SET; tok_string: 'SET'; tok_version: 1),
(tok_ident: SHADOW; tok_string: 'SHADOW'; tok_version: 1),
(tok_ident: KW_SHARED; tok_string: 'SHARED'; tok_version: 1),
(tok_ident: SINGULAR; tok_string: 'SINGULAR'; tok_version: 1),
(tok_ident: KW_SIZE; tok_string: 'SIZE'; tok_version: 1),
(tok_ident: SKIP; tok_string: 'SKIP'; tok_version: 2),
(tok_ident: KW_SMALLINT; tok_string: 'SMALLINT'; tok_version: 1),
(tok_ident: SNAPSHOT; tok_string: 'SNAPSHOT'; tok_version: 1),
(tok_ident: SOME; tok_string: 'SOME'; tok_version: 1),
(tok_ident: SORT; tok_string: 'SORT'; tok_version: 1),
(tok_ident: SQLCODE; tok_string: 'SQLCODE'; tok_version: 1),
(tok_ident: STABILITY; tok_string: 'STABILITY'; tok_version: 1),
(tok_ident: STARTING; tok_string: 'STARTING'; tok_version: 1),
(tok_ident: STARTING; tok_string: 'STARTS'; tok_version: 1), (* Alias of STARTING *)
(tok_ident: STATEMENT; tok_string: 'STATEMENT'; tok_version: 2),
(tok_ident: STATISTICS; tok_string: 'STATISTICS'; tok_version: 1),
(tok_ident: SUBSTRING; tok_string: 'SUBSTRING'; tok_version: 2),
(tok_ident: SUB_TYPE; tok_string: 'SUB_TYPE'; tok_version: 1),
(tok_ident: SUM; tok_string: 'SUM'; tok_version: 1),
(tok_ident: SUSPEND; tok_string: 'SUSPEND'; tok_version: 1),
(tok_ident: TABLE; tok_string: 'TABLE'; tok_version: 1),
(tok_ident: KW_THEN; tok_string: 'THEN'; tok_version: 1),
(tok_ident: KW_TIME; tok_string: 'TIME'; tok_version: 2),
(tok_ident: TIMESTAMP; tok_string: 'TIMESTAMP'; tok_version: 2),
(tok_ident: KW_TO; tok_string: 'TO'; tok_version: 1),
(tok_ident: TRANSACTION; tok_string: 'TRANSACTION'; tok_version: 1),
(tok_ident: TRIGGER; tok_string: 'TRIGGER'; tok_version: 1),
(tok_ident: KW_TYPE; tok_string: 'TYPE'; tok_version: 2),
(tok_ident: UNCOMMITTED; tok_string: 'UNCOMMITTED'; tok_version: 1),
(tok_ident: UNION; tok_string: 'UNION'; tok_version: 1),
(tok_ident: UNIQUE; tok_string: 'UNIQUE'; tok_version: 1),
(tok_ident: UPDATE; tok_string: 'UPDATE'; tok_version: 1),
(tok_ident: UPDATING; tok_string: 'UPDATING'; tok_version: 2),
(tok_ident: KW_UPPER; tok_string: 'UPPER'; tok_version: 1),
(tok_ident: USER; tok_string: 'USER'; tok_version: 1),
(tok_ident: USING; tok_string: 'USING'; tok_version: 2),
(tok_ident: KW_VALUE; tok_string: 'VALUE'; tok_version: 1),
(tok_ident: VALUES; tok_string: 'VALUES'; tok_version: 1),
(tok_ident: VARCHAR; tok_string: 'VARCHAR'; tok_version: 1),
(tok_ident: VARIABLE; tok_string: 'VARIABLE'; tok_version: 1),
(tok_ident: VARYING; tok_string: 'VARYING'; tok_version: 1),
(tok_ident: VIEW; tok_string: 'VIEW'; tok_version: 1),
(tok_ident: WAIT; tok_string: 'WAIT'; tok_version: 1),
(tok_ident: WEEKDAY; tok_string: 'WEEKDAY'; tok_version: 2),
(tok_ident: WHEN; tok_string: 'WHEN'; tok_version: 1),
(tok_ident: WHERE; tok_string: 'WHERE'; tok_version: 1),
(tok_ident: KW_WHILE; tok_string: 'WHILE'; tok_version: 1),
(tok_ident: KW_WITH; tok_string: 'WITH'; tok_version: 1),
(tok_ident: WORK; tok_string: 'WORK'; tok_version: 1),
(tok_ident: WRITE; tok_string: 'WRITE'; tok_version: 1),
(tok_ident: YEAR; tok_string: 'YEAR'; tok_version: 2),
(tok_ident: YEARDAY; tok_string: 'YEARDAY'; tok_version: 2));
function IsAKeyword(const str: string; var id: word): boolean;
var
i: word;
l: Integer;
begin
l := Length(str);
for i := 0 to MaxTokens - 1 do
if (l = length(Tokens[i].tok_string)) and
(CompareText(str, Tokens[i].tok_string) = 0) then
begin
id := Tokens[i].tok_ident;
result := True;
Exit;
end;
Result := False;
end;
var
id: word;
c: char;
function TUIBLexer.yylex : Integer;
procedure yyaction(yyruleno: Integer);
(* local definitions: *)
begin
(* actions: *)
case yyruleno of
1:
returnn(KW_STRING);
2:
returnn(SYMBOL);
3:
if IsAKeyword(yytext, id) then
returnn(id) else
returnn(SYMBOL);
4:
repeat until (get_char in [#13, #10, #0]);
5:
repeat
c := get_char;
case c of
'*': begin
c := get_char;
if (c = '/') then exit else unget_char(c)
end;
#0 : exit;
end;
until false;
6:
returnn(NUMBER);
7:
returnn(FLOAT_NUMBER);
8:
returnn(NOT_LSS);
9:
returnn(NEQ);
10:
returnn(NOT_GTR);
11:
returnn(LSS);
12:
returnn(LEQ);
13:
returnn(NEQ);
14:
returnn(EQL);
15:
returnn(GTR);
16:
returnn(GEQ);
17:
returnn(NOT_LSS);
18:
returnn(NEQ);
19:
returnn(NOT_GTR);
20:
returnn(CONCATENATE);
21:
returnn(NOT_LSS);
22:
returnn(NEQ);
23:
returnn(NOT_GTR);
24:
returnn(SCOLON);
25:
returnn(LPAREN);
26:
returnn(RPAREN);
27:
returnn(COMMA);
28:
returnn(LARRAY);
29:
returnn(RARRAY);
30:
returnn(COLON);
31:
returnn(PLUS);
32:
returnn(MINUS);
33:
returnn(STAR);
34:
returnn(SLASH);
35:
returnn(DOT);
36:
returnn(VPARAM);
37:
;
38:
returnn(0);
end;
end(*yyaction*);
(* DFA table: *)
type YYTRec = record
cc : set of Char;
s : Integer;
end;
const
yynmarks = 65;
yynmatches = 65;
yyntrans = 85;
yynstates = 51;
yyk : array [1..yynmarks] of Integer = (
{ 0: }
{ 1: }
{ 2: }
38,
{ 3: }
38,
{ 4: }
3,
38,
{ 5: }
32,
38,
{ 6: }
34,
38,
{ 7: }
6,
38,
{ 8: }
38,
{ 9: }
11,
38,
{ 10: }
14,
38,
{ 11: }
15,
38,
{ 12: }
38,
{ 13: }
38,
{ 14: }
38,
{ 15: }
24,
38,
{ 16: }
25,
38,
{ 17: }
26,
38,
{ 18: }
27,
38,
{ 19: }
28,
38,
{ 20: }
29,
38,
{ 21: }
30,
38,
{ 22: }
31,
38,
{ 23: }
33,
38,
{ 24: }
35,
38,
{ 25: }
36,
38,
{ 26: }
37,
38,
{ 27: }
38,
{ 28: }
{ 29: }
1,
{ 30: }
{ 31: }
2,
{ 32: }
3,
{ 33: }
4,
{ 34: }
5,
{ 35: }
6,
{ 36: }
{ 37: }
8,
{ 38: }
9,
{ 39: }
10,
{ 40: }
12,
{ 41: }
13,
{ 42: }
16,
{ 43: }
17,
{ 44: }
18,
{ 45: }
19,
{ 46: }
20,
{ 47: }
21,
{ 48: }
22,
{ 49: }
23,
{ 50: }
7
);
yym : array [1..yynmatches] of Integer = (
{ 0: }
{ 1: }
{ 2: }
38,
{ 3: }
38,
{ 4: }
3,
38,
{ 5: }
32,
38,
{ 6: }
34,
38,
{ 7: }
6,
38,
{ 8: }
38,
{ 9: }
11,
38,
{ 10: }
14,
38,
{ 11: }
15,
38,
{ 12: }
38,
{ 13: }
38,
{ 14: }
38,
{ 15: }
24,
38,
{ 16: }
25,
38,
{ 17: }
26,
38,
{ 18: }
27,
38,
{ 19: }
28,
38,
{ 20: }
29,
38,
{ 21: }
30,
38,
{ 22: }
31,
38,
{ 23: }
33,
38,
{ 24: }
35,
38,
{ 25: }
36,
38,
{ 26: }
37,
38,
{ 27: }
38,
{ 28: }
{ 29: }
1,
{ 30: }
{ 31: }
2,
{ 32: }
3,
{ 33: }
4,
{ 34: }
5,
{ 35: }
6,
{ 36: }
{ 37: }
8,
{ 38: }
9,
{ 39: }
10,
{ 40: }
12,
{ 41: }
13,
{ 42: }
16,
{ 43: }
17,
{ 44: }
18,
{ 45: }
19,
{ 46: }
20,
{ 47: }
21,
{ 48: }
22,
{ 49: }
23,
{ 50: }
7
);
yyt : array [1..yyntrans] of YYTrec = (
{ 0: }
( cc: [ #1..#7,#11,#14..#31,'#','%','&','@','\','`',
'{','}',#127..#255 ]; s: 27),
( cc: [ #9,#10,#12,' ' ]; s: 26),
( cc: [ '!' ]; s: 8),
( cc: [ '"' ]; s: 3),
( cc: [ '$','A'..'Z','_','a'..'z' ]; s: 4),
( cc: [ '''' ]; s: 2),
( cc: [ '(' ]; s: 16),
( cc: [ ')' ]; s: 17),
( cc: [ '*' ]; s: 23),
( cc: [ '+' ]; s: 22),
( cc: [ ',' ]; s: 18),
( cc: [ '-' ]; s: 5),
( cc: [ '.' ]; s: 24),
( cc: [ '/' ]; s: 6),
( cc: [ '0'..'9' ]; s: 7),
( cc: [ ':' ]; s: 21),
( cc: [ ';' ]; s: 15),
( cc: [ '<' ]; s: 9),
( cc: [ '=' ]; s: 10),
( cc: [ '>' ]; s: 11),
( cc: [ '?' ]; s: 25),
( cc: [ '[' ]; s: 19),
( cc: [ ']' ]; s: 20),
( cc: [ '^' ]; s: 12),
( cc: [ '|' ]; s: 13),
( cc: [ '~' ]; s: 14),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -