omlish 0.0.0.dev251__py3-none-any.whl → 0.0.0.dev253__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,256 @@
1
+ # type: ignore
2
+ # ruff: noqa
3
+ # flake8: noqa
4
+ # Generated from Protobuf3.g4 by ANTLR 4.13.2
5
+ from omlish.antlr._runtime._all import *
6
+ if "." in __name__:
7
+ from .Protobuf3Parser import Protobuf3Parser
8
+ else:
9
+ from Protobuf3Parser import Protobuf3Parser
10
+
11
+ # This class defines a complete generic visitor for a parse tree produced by Protobuf3Parser.
12
+
13
+ class Protobuf3Visitor(ParseTreeVisitor):
14
+
15
+ # Visit a parse tree produced by Protobuf3Parser#proto.
16
+ def visitProto(self, ctx:Protobuf3Parser.ProtoContext):
17
+ return self.visitChildren(ctx)
18
+
19
+
20
+ # Visit a parse tree produced by Protobuf3Parser#syntax.
21
+ def visitSyntax(self, ctx:Protobuf3Parser.SyntaxContext):
22
+ return self.visitChildren(ctx)
23
+
24
+
25
+ # Visit a parse tree produced by Protobuf3Parser#syntaxExtra.
26
+ def visitSyntaxExtra(self, ctx:Protobuf3Parser.SyntaxExtraContext):
27
+ return self.visitChildren(ctx)
28
+
29
+
30
+ # Visit a parse tree produced by Protobuf3Parser#importStmt.
31
+ def visitImportStmt(self, ctx:Protobuf3Parser.ImportStmtContext):
32
+ return self.visitChildren(ctx)
33
+
34
+
35
+ # Visit a parse tree produced by Protobuf3Parser#packageStmt.
36
+ def visitPackageStmt(self, ctx:Protobuf3Parser.PackageStmtContext):
37
+ return self.visitChildren(ctx)
38
+
39
+
40
+ # Visit a parse tree produced by Protobuf3Parser#option.
41
+ def visitOption(self, ctx:Protobuf3Parser.OptionContext):
42
+ return self.visitChildren(ctx)
43
+
44
+
45
+ # Visit a parse tree produced by Protobuf3Parser#optionName.
46
+ def visitOptionName(self, ctx:Protobuf3Parser.OptionNameContext):
47
+ return self.visitChildren(ctx)
48
+
49
+
50
+ # Visit a parse tree produced by Protobuf3Parser#optionBody.
51
+ def visitOptionBody(self, ctx:Protobuf3Parser.OptionBodyContext):
52
+ return self.visitChildren(ctx)
53
+
54
+
55
+ # Visit a parse tree produced by Protobuf3Parser#optionBodyVariable.
56
+ def visitOptionBodyVariable(self, ctx:Protobuf3Parser.OptionBodyVariableContext):
57
+ return self.visitChildren(ctx)
58
+
59
+
60
+ # Visit a parse tree produced by Protobuf3Parser#topLevelDef.
61
+ def visitTopLevelDef(self, ctx:Protobuf3Parser.TopLevelDefContext):
62
+ return self.visitChildren(ctx)
63
+
64
+
65
+ # Visit a parse tree produced by Protobuf3Parser#message.
66
+ def visitMessage(self, ctx:Protobuf3Parser.MessageContext):
67
+ return self.visitChildren(ctx)
68
+
69
+
70
+ # Visit a parse tree produced by Protobuf3Parser#messageBody.
71
+ def visitMessageBody(self, ctx:Protobuf3Parser.MessageBodyContext):
72
+ return self.visitChildren(ctx)
73
+
74
+
75
+ # Visit a parse tree produced by Protobuf3Parser#messageBodyContent.
76
+ def visitMessageBodyContent(self, ctx:Protobuf3Parser.MessageBodyContentContext):
77
+ return self.visitChildren(ctx)
78
+
79
+
80
+ # Visit a parse tree produced by Protobuf3Parser#enumDef.
81
+ def visitEnumDef(self, ctx:Protobuf3Parser.EnumDefContext):
82
+ return self.visitChildren(ctx)
83
+
84
+
85
+ # Visit a parse tree produced by Protobuf3Parser#enumBody.
86
+ def visitEnumBody(self, ctx:Protobuf3Parser.EnumBodyContext):
87
+ return self.visitChildren(ctx)
88
+
89
+
90
+ # Visit a parse tree produced by Protobuf3Parser#enumField.
91
+ def visitEnumField(self, ctx:Protobuf3Parser.EnumFieldContext):
92
+ return self.visitChildren(ctx)
93
+
94
+
95
+ # Visit a parse tree produced by Protobuf3Parser#enumValueOption.
96
+ def visitEnumValueOption(self, ctx:Protobuf3Parser.EnumValueOptionContext):
97
+ return self.visitChildren(ctx)
98
+
99
+
100
+ # Visit a parse tree produced by Protobuf3Parser#extend.
101
+ def visitExtend(self, ctx:Protobuf3Parser.ExtendContext):
102
+ return self.visitChildren(ctx)
103
+
104
+
105
+ # Visit a parse tree produced by Protobuf3Parser#service.
106
+ def visitService(self, ctx:Protobuf3Parser.ServiceContext):
107
+ return self.visitChildren(ctx)
108
+
109
+
110
+ # Visit a parse tree produced by Protobuf3Parser#rpc.
111
+ def visitRpc(self, ctx:Protobuf3Parser.RpcContext):
112
+ return self.visitChildren(ctx)
113
+
114
+
115
+ # Visit a parse tree produced by Protobuf3Parser#reserved.
116
+ def visitReserved(self, ctx:Protobuf3Parser.ReservedContext):
117
+ return self.visitChildren(ctx)
118
+
119
+
120
+ # Visit a parse tree produced by Protobuf3Parser#ranges.
121
+ def visitRanges(self, ctx:Protobuf3Parser.RangesContext):
122
+ return self.visitChildren(ctx)
123
+
124
+
125
+ # Visit a parse tree produced by Protobuf3Parser#rangeRule.
126
+ def visitRangeRule(self, ctx:Protobuf3Parser.RangeRuleContext):
127
+ return self.visitChildren(ctx)
128
+
129
+
130
+ # Visit a parse tree produced by Protobuf3Parser#fieldNames.
131
+ def visitFieldNames(self, ctx:Protobuf3Parser.FieldNamesContext):
132
+ return self.visitChildren(ctx)
133
+
134
+
135
+ # Visit a parse tree produced by Protobuf3Parser#typeRule.
136
+ def visitTypeRule(self, ctx:Protobuf3Parser.TypeRuleContext):
137
+ return self.visitChildren(ctx)
138
+
139
+
140
+ # Visit a parse tree produced by Protobuf3Parser#simpleType.
141
+ def visitSimpleType(self, ctx:Protobuf3Parser.SimpleTypeContext):
142
+ return self.visitChildren(ctx)
143
+
144
+
145
+ # Visit a parse tree produced by Protobuf3Parser#fieldNumber.
146
+ def visitFieldNumber(self, ctx:Protobuf3Parser.FieldNumberContext):
147
+ return self.visitChildren(ctx)
148
+
149
+
150
+ # Visit a parse tree produced by Protobuf3Parser#field.
151
+ def visitField(self, ctx:Protobuf3Parser.FieldContext):
152
+ return self.visitChildren(ctx)
153
+
154
+
155
+ # Visit a parse tree produced by Protobuf3Parser#fieldOptions.
156
+ def visitFieldOptions(self, ctx:Protobuf3Parser.FieldOptionsContext):
157
+ return self.visitChildren(ctx)
158
+
159
+
160
+ # Visit a parse tree produced by Protobuf3Parser#fieldOption.
161
+ def visitFieldOption(self, ctx:Protobuf3Parser.FieldOptionContext):
162
+ return self.visitChildren(ctx)
163
+
164
+
165
+ # Visit a parse tree produced by Protobuf3Parser#oneof.
166
+ def visitOneof(self, ctx:Protobuf3Parser.OneofContext):
167
+ return self.visitChildren(ctx)
168
+
169
+
170
+ # Visit a parse tree produced by Protobuf3Parser#oneofField.
171
+ def visitOneofField(self, ctx:Protobuf3Parser.OneofFieldContext):
172
+ return self.visitChildren(ctx)
173
+
174
+
175
+ # Visit a parse tree produced by Protobuf3Parser#mapField.
176
+ def visitMapField(self, ctx:Protobuf3Parser.MapFieldContext):
177
+ return self.visitChildren(ctx)
178
+
179
+
180
+ # Visit a parse tree produced by Protobuf3Parser#keyType.
181
+ def visitKeyType(self, ctx:Protobuf3Parser.KeyTypeContext):
182
+ return self.visitChildren(ctx)
183
+
184
+
185
+ # Visit a parse tree produced by Protobuf3Parser#reservedWord.
186
+ def visitReservedWord(self, ctx:Protobuf3Parser.ReservedWordContext):
187
+ return self.visitChildren(ctx)
188
+
189
+
190
+ # Visit a parse tree produced by Protobuf3Parser#fullIdent.
191
+ def visitFullIdent(self, ctx:Protobuf3Parser.FullIdentContext):
192
+ return self.visitChildren(ctx)
193
+
194
+
195
+ # Visit a parse tree produced by Protobuf3Parser#messageName.
196
+ def visitMessageName(self, ctx:Protobuf3Parser.MessageNameContext):
197
+ return self.visitChildren(ctx)
198
+
199
+
200
+ # Visit a parse tree produced by Protobuf3Parser#enumName.
201
+ def visitEnumName(self, ctx:Protobuf3Parser.EnumNameContext):
202
+ return self.visitChildren(ctx)
203
+
204
+
205
+ # Visit a parse tree produced by Protobuf3Parser#messageOrEnumName.
206
+ def visitMessageOrEnumName(self, ctx:Protobuf3Parser.MessageOrEnumNameContext):
207
+ return self.visitChildren(ctx)
208
+
209
+
210
+ # Visit a parse tree produced by Protobuf3Parser#fieldName.
211
+ def visitFieldName(self, ctx:Protobuf3Parser.FieldNameContext):
212
+ return self.visitChildren(ctx)
213
+
214
+
215
+ # Visit a parse tree produced by Protobuf3Parser#oneofName.
216
+ def visitOneofName(self, ctx:Protobuf3Parser.OneofNameContext):
217
+ return self.visitChildren(ctx)
218
+
219
+
220
+ # Visit a parse tree produced by Protobuf3Parser#mapName.
221
+ def visitMapName(self, ctx:Protobuf3Parser.MapNameContext):
222
+ return self.visitChildren(ctx)
223
+
224
+
225
+ # Visit a parse tree produced by Protobuf3Parser#serviceName.
226
+ def visitServiceName(self, ctx:Protobuf3Parser.ServiceNameContext):
227
+ return self.visitChildren(ctx)
228
+
229
+
230
+ # Visit a parse tree produced by Protobuf3Parser#rpcName.
231
+ def visitRpcName(self, ctx:Protobuf3Parser.RpcNameContext):
232
+ return self.visitChildren(ctx)
233
+
234
+
235
+ # Visit a parse tree produced by Protobuf3Parser#messageType.
236
+ def visitMessageType(self, ctx:Protobuf3Parser.MessageTypeContext):
237
+ return self.visitChildren(ctx)
238
+
239
+
240
+ # Visit a parse tree produced by Protobuf3Parser#messageOrEnumType.
241
+ def visitMessageOrEnumType(self, ctx:Protobuf3Parser.MessageOrEnumTypeContext):
242
+ return self.visitChildren(ctx)
243
+
244
+
245
+ # Visit a parse tree produced by Protobuf3Parser#emptyStmt.
246
+ def visitEmptyStmt(self, ctx:Protobuf3Parser.EmptyStmtContext):
247
+ return self.visitChildren(ctx)
248
+
249
+
250
+ # Visit a parse tree produced by Protobuf3Parser#constant.
251
+ def visitConstant(self, ctx:Protobuf3Parser.ConstantContext):
252
+ return self.visitChildren(ctx)
253
+
254
+
255
+
256
+ del Protobuf3Parser
File without changes
@@ -0,0 +1,54 @@
1
+ import enum
2
+ import typing as ta
3
+
4
+ from ... import dataclasses as dc
5
+
6
+
7
+ ##
8
+
9
+
10
+ class SimpleType(enum.Enum):
11
+ DOUBLE = 'double'
12
+ FLOAT = 'float'
13
+ INT32 = 'int32'
14
+ INT64 = 'int64'
15
+ UINT32 = 'uint32'
16
+ UINT64 = 'uint64'
17
+ SINT32 = 'sint32'
18
+ SINT64 = 'sint64'
19
+ FIXED32 = 'fixed32'
20
+ FIXED64 = 'fixed64'
21
+ SFIXED32 = 'sfixed32'
22
+ SFIXED64 = 'sfixed64'
23
+ BOOL = 'bool'
24
+ STRING = 'string'
25
+ BYTES = 'bytes'
26
+
27
+
28
+ class TypeRef(dc.Frozen):
29
+ name: str
30
+
31
+
32
+ Type: ta.TypeAlias = SimpleType | TypeRef
33
+
34
+
35
+ ##
36
+
37
+
38
+ class Field(dc.Frozen):
39
+ name: str
40
+ type: Type
41
+ num: int
42
+ repeated: bool = False
43
+
44
+
45
+ class Message(dc.Frozen):
46
+ name: str
47
+ fields: ta.Sequence[Field]
48
+
49
+
50
+ ##
51
+
52
+
53
+ class ProtoFile(dc.Frozen):
54
+ messages: ta.Sequence[Message] | None = None
@@ -0,0 +1,97 @@
1
+ # ruff: noqa: N802 N803
2
+ import typing as ta
3
+
4
+ from ... import check
5
+ from ...antlr import runtime as antlr4
6
+ from ...antlr.errors import SilentRaisingErrorListener
7
+ from . import nodes as no
8
+ from ._antlr.Protobuf3Lexer import Protobuf3Lexer # type: ignore
9
+ from ._antlr.Protobuf3Parser import Protobuf3Parser # type: ignore
10
+ from ._antlr.Protobuf3Visitor import Protobuf3Visitor # type: ignore
11
+
12
+
13
+ ##
14
+
15
+
16
+ class _ParseVisitor(Protobuf3Visitor):
17
+ def visit(self, ctx: antlr4.ParserRuleContext):
18
+ check.isinstance(ctx, antlr4.ParserRuleContext)
19
+ node = ctx.accept(self)
20
+ return node
21
+
22
+ def aggregateResult(self, aggregate, nextResult):
23
+ if aggregate is not None:
24
+ check.none(nextResult)
25
+ return aggregate
26
+ else:
27
+ check.none(aggregate)
28
+ return nextResult
29
+
30
+ #
31
+
32
+ def visitField(self, ctx: Protobuf3Parser.FieldContext):
33
+ name = ctx.fieldName().getText()
34
+ type_: no.Type = check.isinstance(self.visitTypeRule(ctx.typeRule()), (no.SimpleType, no.TypeRef))
35
+ num = int(ctx.fieldNumber().getText())
36
+ repeated = ctx.REPEATED() is not None
37
+ return no.Field(
38
+ name=name,
39
+ type=type_,
40
+ num=num,
41
+ repeated=repeated,
42
+ )
43
+
44
+ def visitMessage(self, ctx: Protobuf3Parser.MessageContext):
45
+ name = ctx.messageName().getText()
46
+ fields: list[no.Field] = []
47
+ for mbc_ctx in ctx.messageBody().messageBodyContent():
48
+ mbc = self.visitMessageBodyContent(mbc_ctx)
49
+ if isinstance(mbc, no.Field):
50
+ fields.append(mbc)
51
+ return no.Message(
52
+ name=name,
53
+ fields=fields,
54
+ )
55
+
56
+ def visitMessageOrEnumType(self, ctx: Protobuf3Parser.MessageOrEnumTypeContext):
57
+ return no.TypeRef(ctx.getText())
58
+
59
+ def visitProto(self, ctx: Protobuf3Parser.ProtoContext):
60
+ messages: list[no.Message] = []
61
+ for ex_ctx in ctx.syntaxExtra():
62
+ ex = self.visitSyntaxExtra(ex_ctx)
63
+ if isinstance(ex, no.Message):
64
+ messages.append(ex)
65
+ return no.ProtoFile(
66
+ messages=messages,
67
+ )
68
+
69
+ def visitSimpleType(self, ctx: Protobuf3Parser.SimpleTypeContext):
70
+ return no.SimpleType(ctx.getText())
71
+
72
+
73
+ ##
74
+
75
+
76
+ def create_parser(buf: str) -> Protobuf3Parser:
77
+ lexer = Protobuf3Lexer(antlr4.InputStream(buf))
78
+ lexer.removeErrorListeners()
79
+ lexer.addErrorListener(SilentRaisingErrorListener())
80
+
81
+ stream = antlr4.CommonTokenStream(lexer)
82
+ stream.fill()
83
+
84
+ parser = Protobuf3Parser(stream)
85
+ parser.removeErrorListeners()
86
+ parser.addErrorListener(SilentRaisingErrorListener())
87
+
88
+ return parser
89
+
90
+
91
+ ##
92
+
93
+
94
+ def parse_proto(buf: str, **kwargs: ta.Any) -> ta.Any:
95
+ parser = create_parser(buf, **kwargs)
96
+ node = _ParseVisitor().visit(parser.proto())
97
+ return node
@@ -0,0 +1,289 @@
1
+ grammar Minisql;
2
+
3
+
4
+ tokens {
5
+ DELIMITER
6
+ }
7
+
8
+
9
+ singleStmt
10
+ : select ';' EOF
11
+ ;
12
+
13
+ select
14
+ : cteSelect
15
+ ;
16
+
17
+ cteSelect
18
+ : (WITH cte (',' cte)*)? unionSelect
19
+ ;
20
+
21
+ cte
22
+ : ident AS '(' select ')'
23
+ ;
24
+
25
+ unionSelect
26
+ : primarySelect unionItem*
27
+ ;
28
+
29
+ unionItem
30
+ : UNION setQuantifier? primarySelect
31
+ ;
32
+
33
+ primarySelect
34
+ : SELECT setQuantifier? selectItem (',' selectItem)*
35
+ (FROM relation (',' relation)*)?
36
+ (WHERE where=booleanExpr)?
37
+ (GROUP BY groupBy)?
38
+ (HAVING having=booleanExpr)?
39
+ (ORDER BY sortItem (',' sortItem)*)?
40
+ ;
41
+
42
+ selectItem
43
+ : '*' #allSelectItem
44
+ | expr (AS? ident)? #exprSelectItem
45
+ ;
46
+
47
+ expr
48
+ : booleanExpr
49
+ ;
50
+
51
+ booleanExpr
52
+ : valueExpr predicate[$valueExpr.ctx]? #predicatedBooleanExpr
53
+ | op=NOT booleanExpr #unaryBooleanExpr
54
+ | booleanExpr op=(AND | OR) booleanExpr #binaryBooleanExpr
55
+ | booleanExpr '::' ident #castBooleanExpr
56
+ ;
57
+
58
+ predicate[ParserRuleContext value]
59
+ : cmpOp right=valueExpr #cmpPredicate
60
+ | IS NOT? NULL #isNullPredicate
61
+ | NOT? IN '(' expr (',' expr)* ')' #inListPredicate
62
+ | NOT? IN '(' select ')' #inSelectPredicate
63
+ | NOT? LIKE expr #likePredicate
64
+ ;
65
+
66
+ valueExpr
67
+ : primaryExpr #primaryValueExpr
68
+ | op=unaryOp valueExpr #unaryValueExpr
69
+ | left=valueExpr op=arithOp right=valueExpr #arithValueExpr
70
+ ;
71
+
72
+ primaryExpr
73
+ : qualifiedName '(' (expr (',' expr)*)? ')' over? #functionCallExpr
74
+ | qualifiedName '(' '*' ')' over? #starFunctionCallExpr
75
+ | CASE caseItem* (ELSE expr)? END #caseExpr
76
+ | '(' select ')' #selectExpr
77
+ | '(' expr ')' #parenExpr
78
+ | simpleExpr #simplePrimaryExpr
79
+ ;
80
+
81
+ simpleExpr
82
+ : qualifiedName
83
+ | number
84
+ | string
85
+ | null
86
+ | true
87
+ | false
88
+ ;
89
+
90
+ caseItem
91
+ : WHEN expr THEN expr
92
+ ;
93
+
94
+ over
95
+ : OVER '(' (ORDER BY sortItem (',' sortItem)*)? ')'
96
+ ;
97
+
98
+ sortItem
99
+ : expr direction=(ASC | DESC)?
100
+ ;
101
+
102
+ relation
103
+ : relation AS? ident #aliasedRelation
104
+ | left=relation ty=joinType? JOIN right=relation (ON cond=booleanExpr)? #joinRelation
105
+ | '(' select ')' #selectRelation
106
+ | '(' relation ')' #parenRelation
107
+ | qualifiedName #tableRelation
108
+ ;
109
+
110
+ groupBy
111
+ : expr (',' expr)*
112
+ ;
113
+
114
+ qualifiedName
115
+ : ident ('.' ident)*
116
+ ;
117
+
118
+ identList
119
+ : ident (',' ident)*
120
+ ;
121
+
122
+ ident
123
+ : unquotedIdent
124
+ | quotedIdent
125
+ ;
126
+
127
+ quotedIdent
128
+ : QUOTED_IDENT
129
+ ;
130
+
131
+ number
132
+ : INTEGER_VALUE #integerNumber
133
+ | DECIMAL_VALUE #decimalNumber
134
+ | FLOAT_VALUE #floatNumber
135
+ ;
136
+
137
+ string
138
+ : STRING
139
+ ;
140
+
141
+ null
142
+ : NULL
143
+ ;
144
+
145
+ true
146
+ : TRUE
147
+ ;
148
+
149
+ false
150
+ : FALSE
151
+ ;
152
+
153
+ setQuantifier
154
+ : DISTINCT
155
+ | ALL
156
+ ;
157
+
158
+ joinType
159
+ : INNER
160
+ | LEFT
161
+ | LEFT OUTER
162
+ | RIGHT
163
+ | RIGHT OUTER
164
+ | FULL
165
+ | FULL OUTER
166
+ | CROSS
167
+ | NATURAL
168
+ ;
169
+
170
+ cmpOp
171
+ : '='
172
+ | '!='
173
+ | '<>'
174
+ | '<'
175
+ | '<='
176
+ | '>'
177
+ | '>='
178
+ ;
179
+
180
+ arithOp
181
+ : '+'
182
+ | '-'
183
+ | '*'
184
+ | '/'
185
+ | '%'
186
+ | '||'
187
+ ;
188
+
189
+ unaryOp
190
+ : '+'
191
+ | '-'
192
+ ;
193
+
194
+ unquotedIdent
195
+ : IDENT
196
+
197
+ | LEFT
198
+ | RIGHT
199
+
200
+ ;
201
+
202
+ ALL: 'all';
203
+ AND: 'and';
204
+ AS: 'as';
205
+ ASC: 'asc';
206
+ BY: 'by';
207
+ CASE: 'case';
208
+ CROSS: 'cross';
209
+ DESC: 'desc';
210
+ DISTINCT: 'distinct';
211
+ ELSE: 'else';
212
+ END: 'end';
213
+ FALSE: 'false';
214
+ FROM: 'from';
215
+ FULL: 'full';
216
+ GROUP: 'group';
217
+ HAVING: 'having';
218
+ IN: 'in';
219
+ INNER: 'inner';
220
+ IS: 'is';
221
+ JOIN: 'join';
222
+ LEFT: 'left';
223
+ LIKE: 'like';
224
+ NATURAL: 'natural';
225
+ NOT: 'not';
226
+ NULL: 'null';
227
+ ON: 'on';
228
+ OR: 'or';
229
+ ORDER: 'order';
230
+ OUTER: 'outer';
231
+ OVER: 'over';
232
+ RIGHT: 'right';
233
+ SELECT: 'select';
234
+ THEN: 'then';
235
+ TRUE: 'true';
236
+ UNION: 'union';
237
+ WHEN: 'when';
238
+ WHERE: 'where';
239
+ WITH: 'with';
240
+
241
+ STRING
242
+ : '\'' (~'\'' | '\'\'')* '\''
243
+ ;
244
+
245
+ INTEGER_VALUE
246
+ : DIGIT+
247
+ ;
248
+
249
+ DECIMAL_VALUE
250
+ : DIGIT+ '.' DIGIT*
251
+ | '.' DIGIT+
252
+ ;
253
+
254
+ FLOAT_VALUE
255
+ : DIGIT+ ('.' DIGIT*)? EXPONENT
256
+ | '.' DIGIT+ EXPONENT
257
+ ;
258
+
259
+ IDENT
260
+ : (LETTER | '_') (LETTER | DIGIT | '_' | '@' | ':' | '$')*
261
+ ;
262
+
263
+ QUOTED_IDENT
264
+ : '"' (~'"' | '""')* '"'
265
+ ;
266
+
267
+ fragment EXPONENT
268
+ : [Ee] [+-]? DIGIT+
269
+ ;
270
+
271
+ fragment DIGIT
272
+ : [0-9]
273
+ ;
274
+
275
+ fragment LETTER
276
+ : [A-Za-z]
277
+ ;
278
+
279
+ COMMENT
280
+ : '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN)
281
+ ;
282
+
283
+ BLOCK_COMMENT
284
+ : '/*' .*? '*/' -> channel(HIDDEN)
285
+ ;
286
+
287
+ WS
288
+ : [ \t\n\r]+ -> skip
289
+ ;
File without changes