[jboss-svn-commits] JBL Code SVN: r34968 - in labs/jbossrules/branches/DRLv6/src: main/java/org/drools/compiler and 4 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 1 17:33:09 EDT 2010
Author: dsotty
Date: 2010-09-01 17:33:07 -0400 (Wed, 01 Sep 2010)
New Revision: 34968
Added:
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/compiler/
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/compiler/DroolsParserException.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DRLv6Keywords.tokens
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DRLv6Parser.tokens
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsEditorType.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsParaphraseTypes.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsParserExceptionFactory.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSentence.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSentenceType.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSoftKeywords.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsToken.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsTree.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/Location.java
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/Manchester.tokens
labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/ParserHelper.java
labs/jbossrules/branches/DRLv6/src/main/resources/DRLLexer.g.off
labs/jbossrules/branches/DRLv6/src/main/resources/DRLParser.g.off
labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Combined.g
labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Keywords.g
labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g
labs/jbossrules/branches/DRLv6/src/main/resources/Manchester.g
labs/jbossrules/branches/DRLv6/src/test/resources/foaf.manchester
Removed:
labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g
Modified:
labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Parser.g
labs/jbossrules/branches/DRLv6/src/test/java/org/drools/lang/Rule_Test.java
Log:
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/compiler/DroolsParserException.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/compiler/DroolsParserException.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/compiler/DroolsParserException.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,123 @@
+package org.drools.compiler;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+public class DroolsParserException extends Exception {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 510l;
+
+ private String errorCode = null;
+ private int lineNumber;
+ private int column;
+ private int offset;
+
+ /**
+ * @see java.lang.Exception#Exception()
+ */
+ public DroolsParserException() {
+ super();
+ }
+
+ /**
+ * @see java.lang.Exception#Exception(String message)
+ */
+ public DroolsParserException(final String message) {
+ super(message);
+ }
+
+ /**
+ * @see java.lang.Exception#Exception(String message, Throwable cause)
+ */
+ public DroolsParserException(final String message, final Throwable cause) {
+ super(message);
+ }
+
+ /**
+ * @see java.lang.Exception#Exception(Throwable cause)
+ */
+ public DroolsParserException(final Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * DroolsParserException constructor.
+ *
+ * @param errorCode
+ * error code
+ * @param message
+ * message
+ * @param lineNumber
+ * line number
+ * @param column
+ * column
+ * @param offset
+ * offset
+ * @param cause
+ * exception cause
+ */
+ public DroolsParserException(String errorCode, String message, int lineNumber,
+ int column, int offset, Throwable cause) {
+ super(message, cause);
+ this.errorCode = errorCode;
+ this.lineNumber = lineNumber;
+ this.column = column;
+ this.offset = offset;
+ }
+
+ public String getMessage() {
+ if (null == errorCode) {
+ return super.getMessage();
+ }
+ return "[" + errorCode + "] " + super.getMessage();
+ }
+
+ /**
+ * getter for error code
+ *
+ */
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * getter for line number
+ *
+ */
+ public int getLineNumber() {
+ return lineNumber;
+ }
+
+ /**
+ * getter for column position
+ *
+ */
+ public int getColumn() {
+ return column;
+ }
+
+ /**
+ * getter for char offset
+ *
+ */
+ public int getOffset() {
+ return offset;
+ }
+}
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DRLv6Keywords.tokens
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DRLv6Keywords.tokens (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DRLv6Keywords.tokens 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,432 @@
+VK_TYPE=330
+DOUBLE_SLASH=374
+DOUBLE_SQUARE_RIGHT=376
+BLANK_ID=430
+VK_OA_DEFAULT=273
+VK_OPERATOR=345
+VK_GLOBAL=228
+VT_TYPE=52
+VT_NEG=58
+VK_NULL=271
+VK_START=317
+VT_RHS=38
+VT_SUBPROPERTYOF=123
+VK_EQUIV=208
+VK_CLASS=180
+VK_ANNOTATIONS=167
+VK_DOUBLE=200
+VT_INDEX_ALL=83
+VK_SAMEAS=311
+VK_PROPERTY_ANNOTATION=296
+QUESTION_MARK=392
+VK_AVERAGE=172
+VK_WHEN=342
+GATE=379
+DOUBLE_MINUS=369
+VT_QUERY_PATTERN=74
+VK_NEW=268
+VK_MAX=252
+VK_DISTINCT=197
+VT_COLLECT_LIST=109
+VK_AS=169
+VK_DOMAIN=199
+VT_BRANCH_DEFAULT=42
+VT_FUNCTION_ID=18
+VK_GROUP=229
+VK_BRANCH=175
+VK_NEG=267
+VK_EXACTLY=214
+DOUBLE_ANG=366
+VK_A_DIALECT=145
+VT_RISING_EDGE=45
+VT_EXPR=85
+VT_SET=90
+VT_ENTITY_TYPE=32
+OCTAL=417
+VK_BYTE=176
+VK_SUBPROPERTYOF=320
+VK_OA_CRISP=272
+VK_ACTIVATION_GROUP=351
+VT_NEW_OBJ=51
+VK_IMPLIES=231
+FLOAT=420
+HexDigit=413
+VT_IMPORT_SECTION=7
+VT_ACCUMULATE_ITERATION=103
+VK_EVAL=212
+AT=357
+DOUBLE_PIPE=373
+RIGHT_PAREN=408
+VT_COMPILATION_UNIT=4
+VK_DISJOINT_UNION=196
+VK_INDIVIDUAL=234
+XOR_ASSIGN=405
+PLUS=391
+VK_INSERT_LOG=237
+VK_DIALECT=190
+VK_A_IMPLICATION=151
+VT_GLOBAL_ID=11
+VK_TYPE_STRING=335
+VT_ANNOTATION=114
+VT_FROM_SOURCE=99
+VT_TRAIL=92
+VK_INSTANCEOF=238
+VT_HEDGE_MOL=63
+VT_POSITIONAL_VAR=75
+VK_OA_DEFEAT=274
+VK_REVERSE=304
+VK_LENGTH=244
+TRIPLE_GREATER=397
+VK_A_DIRECTION_EQUIVALENCE=148
+VK_MDA_FUNCTIONAL_INV=254
+VK_INVERSE=240
+VT_STAR=16
+VT_DL_TYPE=30
+MINUS=385
+VK_PROPERTY=295
+VK_TYPES=336
+VK_MODIFY_LOG=263
+VK_OA_DEGREE=275
+COLON=360
+OR_ASSIGN=404
+VT_MAX=69
+VT_AND_IMPLICIT=55
+VT_TRAIL_NODE=93
+VK_RISING=305
+VT_SLOT_ID=25
+VK_OA_KIND=277
+DOUBLE_PLUS=365
+VT_FILTER=89
+VT_PARAM_LIST=20
+ARROW=358
+VK_SUM=321
+VK_AGENDA_GROUP=352
+GREATER_EQUAL=381
+VT_ACC_ITER_INIT=105
+VK_A_DURATION=149
+DOUBLE_GREATER=371
+VK_RETRACT_LOG=303
+VT_NAME=21
+FloatTypeSuffix=419
+VT_THEN=39
+VK_A_DATE_EXPIRES=143
+VK_MDA_SYMMETRIC_INV=258
+MOD_ASSIGN=406
+VT_ACCESSOR=80
+VT_DIF_PROP=135
+VT_TEMPLATE=22
+EQUALS=378
+VK_AUTO_FOCUS=350
+NEG_MARK=387
+VT_DEBUG_RIGHT_EXPR=87
+VK_AGENDA=164
+VK_KEY=243
+GREATER=380
+VK_IMPORT=232
+VT_INDEXER=82
+VK_RULE=307
+LESS_PERCENT=383
+LESS=382
+VAR=431
+VK_A_RULEFLOWGROUP=154
+VK_A_NOLOOP=153
+VT_PARAM=19
+VT_ACC_ITER_REV=107
+VT_ACC_ITER_RES=108
+VK_MIN=261
+VT_PREFIX=112
+VK_FILTER=222
+VT_BRANCH=41
+VK_PRIMITIVE_TYPE=355
+VK_TYPE_DOUBLE=332
+VT_ENABLED=73
+VK_COLLECT=182
+VK_QUERY=299
+VK_OA_PARAMS=281
+VT_DIALECT=35
+VK_ACCUMULATE_RIGHT=160
+VT_EQUIVALENTTO=119
+VT_PACKAGE_ID=5
+DOUBLE_LESS=372
+VK_THROTTLE=327
+VT_TYPES=129
+VT_DL_RESTRICTION=117
+VT_PATTERN=71
+VK_DISJOINT=193
+VT_ACCUMULATE_LEFT=101
+VT_XOR=59
+VT_FUNCTION=17
+VK_ENABLED=203
+VK_END=204
+VT_CLOSURE=40
+RIGHT_SQUARE=410
+VK_MVEL=265
+VT_MIN=68
+VT_ONTOLOGY=110
+VK_RETRACT=302
+VK_ACC=157
+VK_CLOSURE=181
+VT_IMPORT=14
+VT_ACCUMULATE_RIGHT=102
+VK_BOOLEAN=174
+VK_SUPER=322
+VK_EXISTS=216
+VK_DATE_EXPIRES=348
+ID=429
+VT_DISJOINTWITH=121
+VK_MDA_TRANSITIVE=259
+VK_XOR=344
+VK_LIMIT=247
+COMMA=361
+HEX=415
+VT_LHS=36
+EQUAL=377
+VK_FOCUS=224
+VT_BRANCH_LABEL=43
+VT_DL_PROP=116
+VK_ACCL=158
+VK_MDA_SYMMETRIC=257
+VK_A_AGENDAGROUP=139
+VT_PAREN_CHUNK=50
+VK_DISJOINT_PROPERTIES=195
+VT_HEDGE_VERY=62
+VT_NEXISTS=66
+VK_BOOL=173
+VK_EXTENDS=219
+VT_NESTED_PATTERN=72
+VK_POINT=293
+VK_TEMPLATE=323
+VK_EQUIVALENTTO=211
+VT_ACC_ITER_ACT=106
+VK_ORDERBY=287
+VK_EXCLUDES=215
+VK_SOUNDSLIKE=316
+UnicodeEscape=434
+VT_DECLARATION_SECTION=9
+VT_SQUARE_CHUNK=49
+VT_TEMPLATE_ID=23
+VK_DATE_EFFECTIVE=347
+LEFT_SQUARE=409
+VT_DATA_TYPE=12
+VK_CHAR=178
+MOD=386
+VK_FUNCTION=227
+VT_EXISTS=64
+VT_METHOD=84
+VK_SALIENCE=309
+VK_SEQ=313
+DOUBLE_DOT=370
+VK_NO=269
+EOL=424
+VK_MODIFY=262
+NOT_EQUAL=388
+VK_ACTION=161
+VT_ANNOTATIONS=113
+VT_EQUIV=60
+VK_SOME=315
+VK_MEMBEROF=260
+VK_AUTO=171
+VK_OR=286
+VT_VERSION=81
+VT_OTHERWISE=88
+VT_OR=57
+VK_ON=282
+VT_ATTRIBUTES=34
+IntegerTypeSuffix=414
+MINUS_ASSIGN=400
+BOOL=421
+VK_EVENT=213
+VK_EFFECTIVE=202
+SEMICOLON=393
+VK_THEN=325
+VT_EXTENDS=28
+VK_RULEFLOW_GROUP=353
+VK_ROLE=306
+VK_RESULT=301
+WS=433
+VK_ACTIVATION=162
+VK_ENTITY=205
+VK_NO_LOOP=349
+DOUBLE_COLON=368
+LEFT_CURLY=411
+VK_COUNT=185
+VT_FACT=128
+LEFT_PAREN=407
+PERCENT_GREATER=389
+VT_RULE_ID=33
+VT_LIST=94
+VK_ONLY=284
+C_STYLE_SINGLE_LINE_COMMENT=425
+VK_VOID=341
+VT_FACTS=127
+VK_ACCUMULATE=159
+VK_OVER=289
+VK_EXTEND=218
+VK_EQUIVALENT_PROPERTIES=210
+VK_SELF=312
+VK_LOCK=248
+VK_SAME_INDIVIDUAL=310
+VT_IRI=111
+VK_VALUE=339
+VK_A_TIMER=156
+VK_OA_MISSING=279
+VT_ACCUMULATE_FUNCTION=104
+CHAIN_SEP=359
+VT_ARGS=53
+SLASH=394
+VT_EXPRESSION_CHAIN=100
+VK_A_SALIENCE=155
+VK_DATATYPE=186
+VT_SAMEAS=130
+VK_TIME=328
+VK_SUBCLASSOF=318
+PIPE=390
+VK_A_DATE_EFFECTIVE=142
+VT_VALUE=70
+VK_A_AUTOFOCUS=140
+VT_ENTRYPOINT=97
+VK_MOL=264
+VT_KEYS=115
+VK_COLLECT_LIST=183
+VK_NOT=270
+VT_ENTRYPOINT_ID=98
+VK_DECLARE=188
+VK_TYPE_BOOLEAN=331
+VT_SUBPROPERTYCHAIN=125
+VK_DIFFERENT_INDIVIDUALS=191
+VT_ARROW=37
+VT_TYPE_DECLARE_ID=27
+VT_EQV_CLASS=132
+VK_EQUIVALENT_CLASSES=209
+VT_BINDING=79
+VK_LENGTH_MIN=246
+VK_LOCK_ON_ACTIVE=346
+VK_MDA_REFLEXIVE_INV=256
+VT_DIFFERENTFROM=131
+VK_THIS=326
+VK_ALL=165
+MULTI_LINE_COMMENT=426
+VK_A_ACTGROUP=138
+DECIMAL=416
+VK_ATTRIBUTES=170
+VT_DIF_CLASS=133
+VT_MSR=54
+VK_ENTRYPOINT=207
+VK_HASKEY=230
+PLUS_ASSIGN=399
+VK_PATTERN_LANG=292
+VK_ACTIVE=163
+VT_EQV_PROP=134
+VK_OA_ID=276
+VK_MDA_FUNCTIONAL=253
+OctalEscape=435
+VK_RULEFLOW=308
+STRING=423
+VT_ONTOLOGY_SECTION=8
+VK_ANOTHER=168
+VK_DIFFERENTFROM=192
+VK_LOOP=250
+VT_DOMAIN=126
+DOT_STAR=363
+VK_ENTRY=206
+VK_AND=166
+VK_UNIQUE=337
+VK_A_LOCKONACTIVE=152
+DIV_ASSIGN=402
+VK_A_DIRECTION_ABDUCTIVE=146
+VT_FUNCTION_IMPORT=15
+VK_LONG=249
+VK_PATTERN=291
+VK_DATE=187
+DOUBLE_AMPER=364
+VT_AND=61
+DOUBLE_SQUARE_LEFT=375
+VK_PREFIX=294
+VT_DL_RESTRICTED_TYPE=118
+VT_SLOT=24
+VT_SUBCLASSOF=120
+VK_FROM=226
+VK_PROPERTY_DATA=297
+VT_EQV_INDV=136
+VT_DISJOINTUNIONOF=122
+VT_PACKAGE=6
+VK_OA_MERGE=278
+VT_TYPE_DECLARE=26
+VT_POSITIONAL_SKIP=78
+IdentifierStart=427
+VK_INT=239
+VK_ONCHANGE=283
+VT_NEG_BRANCH_LABEL=44
+VT_FORALL=65
+VT_RHS_CHUNK=47
+VK_VERY=340
+VK_FALLING=221
+VK_SUBPROPERTYCHAIN=319
+VK_ENTRY_POINT=354
+VK_INSERT=236
+VK_CALENDARS=177
+VK_IN=233
+VK_RANGE=300
+LESS_EQUAL=384
+VT_DL_DEFINITION=29
+VK_EXPIRES=217
+MISC=432
+EscapeSequence=422
+VK_DEFEATS=189
+VK_PACKAGE=290
+VK_MATCHES=251
+RIGHT_CURLY=412
+VK_TYPE_FLOAT=333
+VK_A_ENABLED=150
+VK_DISJOINT_CLASSES=194
+VK_JAVA=242
+MULT_ASSIGN=401
+VK_TYPE_INTEGER=334
+VT_FIELD=31
+VK_PROPERTY_OBJECT=298
+VT_SEQUENCE=91
+Exponent=418
+VT_POSITIONAL_CONST=76
+AND_ASSIGN=403
+VK_TIMER=329
+VK_CHARACTERISTICS=179
+VT_IMPLIES=56
+AMPER=356
+VT_FALLING_EDGE=46
+VK_SHORT=314
+TILDE=395
+DOUBLE_CAP=367
+VT_BEHAVIOR=96
+VT_RULEBASE_SECTION=10
+VT_INVERSEOF=124
+DOT=362
+VK_WINDOW=343
+IdentifierPart=428
+VT_DIM_SIZE=13
+VK_A_CALENDAR=141
+XOR=398
+VK_CONTAINS=184
+VK_FACTS=220
+VT_COUNT=67
+VK_INVERSEOF=241
+VK_FLOAT=223
+VK_LENGTH_MAX=245
+VT_DIF_INDV=137
+VK_DURATION=201
+VK_OTHERWISE=288
+VK_THAT=324
+VK_FORALL=225
+VK_DO=198
+VK_UPDATE=338
+VT_CURLY_CHUNK=48
+VT_DEBUG_LEFT_EXPR=86
+VK_A_DEDUCTION=144
+VT_RANGE=95
+VK_NAMESPACE=266
+VT_POSITIONAL_INDEX=77
+VK_ONTOLOGY=285
+TIMES=396
+VK_MDA_REFLEXIVE=255
+VK_INIT=235
+VK_OA_OTHERWISE=280
+VK_A_DIRECTION_DEDUCTIVE=147
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DRLv6Parser.tokens
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DRLv6Parser.tokens (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DRLv6Parser.tokens 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,432 @@
+VK_TYPE=330
+DOUBLE_SLASH=374
+DOUBLE_SQUARE_RIGHT=376
+BLANK_ID=430
+VK_OA_DEFAULT=273
+VK_OPERATOR=345
+VK_GLOBAL=228
+VT_TYPE=52
+VT_NEG=58
+VK_NULL=271
+VK_START=317
+VT_RHS=38
+VT_SUBPROPERTYOF=123
+VK_EQUIV=208
+VK_CLASS=180
+VK_ANNOTATIONS=167
+VK_DOUBLE=200
+VT_INDEX_ALL=83
+VK_SAMEAS=311
+VK_PROPERTY_ANNOTATION=296
+QUESTION_MARK=392
+VK_AVERAGE=172
+VK_WHEN=342
+GATE=379
+DOUBLE_MINUS=369
+VT_QUERY_PATTERN=74
+VK_NEW=268
+VK_MAX=252
+VK_DISTINCT=197
+VT_COLLECT_LIST=109
+VK_AS=169
+VK_DOMAIN=199
+VT_BRANCH_DEFAULT=42
+VT_FUNCTION_ID=18
+VK_GROUP=229
+VK_BRANCH=175
+VK_NEG=267
+VK_EXACTLY=214
+DOUBLE_ANG=366
+VK_A_DIALECT=145
+VT_RISING_EDGE=45
+VT_EXPR=85
+VT_SET=90
+VT_ENTITY_TYPE=32
+OCTAL=417
+VK_BYTE=176
+VK_SUBPROPERTYOF=320
+VK_OA_CRISP=272
+VK_ACTIVATION_GROUP=351
+VT_NEW_OBJ=51
+VK_IMPLIES=231
+FLOAT=420
+HexDigit=413
+VT_IMPORT_SECTION=7
+VT_ACCUMULATE_ITERATION=103
+VK_EVAL=212
+AT=357
+DOUBLE_PIPE=373
+RIGHT_PAREN=408
+VT_COMPILATION_UNIT=4
+VK_DISJOINT_UNION=196
+VK_INDIVIDUAL=234
+XOR_ASSIGN=405
+PLUS=391
+VK_INSERT_LOG=237
+VK_DIALECT=190
+VK_A_IMPLICATION=151
+VT_GLOBAL_ID=11
+VK_TYPE_STRING=335
+VT_ANNOTATION=114
+VT_FROM_SOURCE=99
+VT_TRAIL=92
+VK_INSTANCEOF=238
+VT_HEDGE_MOL=63
+VT_POSITIONAL_VAR=75
+VK_OA_DEFEAT=274
+VK_REVERSE=304
+VK_LENGTH=244
+TRIPLE_GREATER=397
+VK_A_DIRECTION_EQUIVALENCE=148
+VK_MDA_FUNCTIONAL_INV=254
+VK_INVERSE=240
+VT_STAR=16
+VT_DL_TYPE=30
+MINUS=385
+VK_PROPERTY=295
+VK_TYPES=336
+VK_MODIFY_LOG=263
+VK_OA_DEGREE=275
+COLON=360
+OR_ASSIGN=404
+VT_MAX=69
+VT_AND_IMPLICIT=55
+VT_TRAIL_NODE=93
+VK_RISING=305
+VT_SLOT_ID=25
+VK_OA_KIND=277
+DOUBLE_PLUS=365
+VT_FILTER=89
+VT_PARAM_LIST=20
+ARROW=358
+VK_SUM=321
+VK_AGENDA_GROUP=352
+GREATER_EQUAL=381
+VT_ACC_ITER_INIT=105
+VK_A_DURATION=149
+DOUBLE_GREATER=371
+VK_RETRACT_LOG=303
+VT_NAME=21
+FloatTypeSuffix=419
+VT_THEN=39
+VK_A_DATE_EXPIRES=143
+VK_MDA_SYMMETRIC_INV=258
+MOD_ASSIGN=406
+VT_ACCESSOR=80
+VT_DIF_PROP=135
+VT_TEMPLATE=22
+EQUALS=378
+VK_AUTO_FOCUS=350
+NEG_MARK=387
+VT_DEBUG_RIGHT_EXPR=87
+VK_AGENDA=164
+VK_KEY=243
+GREATER=380
+VK_IMPORT=232
+VT_INDEXER=82
+VK_RULE=307
+LESS_PERCENT=383
+LESS=382
+VAR=431
+VK_A_RULEFLOWGROUP=154
+VK_A_NOLOOP=153
+VT_PARAM=19
+VT_ACC_ITER_REV=107
+VT_ACC_ITER_RES=108
+VK_MIN=261
+VT_PREFIX=112
+VK_FILTER=222
+VT_BRANCH=41
+VK_PRIMITIVE_TYPE=355
+VK_TYPE_DOUBLE=332
+VT_ENABLED=73
+VK_COLLECT=182
+VK_QUERY=299
+VK_OA_PARAMS=281
+VT_DIALECT=35
+VK_ACCUMULATE_RIGHT=160
+VT_EQUIVALENTTO=119
+VT_PACKAGE_ID=5
+DOUBLE_LESS=372
+VK_THROTTLE=327
+VT_TYPES=129
+VT_DL_RESTRICTION=117
+VT_PATTERN=71
+VK_DISJOINT=193
+VT_ACCUMULATE_LEFT=101
+VT_XOR=59
+VT_FUNCTION=17
+VK_ENABLED=203
+VK_END=204
+VT_CLOSURE=40
+RIGHT_SQUARE=410
+VK_MVEL=265
+VT_MIN=68
+VT_ONTOLOGY=110
+VK_RETRACT=302
+VK_ACC=157
+VK_CLOSURE=181
+VT_IMPORT=14
+VT_ACCUMULATE_RIGHT=102
+VK_BOOLEAN=174
+VK_SUPER=322
+VK_EXISTS=216
+VK_DATE_EXPIRES=348
+ID=429
+VT_DISJOINTWITH=121
+VK_MDA_TRANSITIVE=259
+VK_XOR=344
+VK_LIMIT=247
+COMMA=361
+HEX=415
+VT_LHS=36
+EQUAL=377
+VK_FOCUS=224
+VT_BRANCH_LABEL=43
+VT_DL_PROP=116
+VK_ACCL=158
+VK_MDA_SYMMETRIC=257
+VK_A_AGENDAGROUP=139
+VT_PAREN_CHUNK=50
+VK_DISJOINT_PROPERTIES=195
+VT_HEDGE_VERY=62
+VT_NEXISTS=66
+VK_BOOL=173
+VK_EXTENDS=219
+VT_NESTED_PATTERN=72
+VK_POINT=293
+VK_TEMPLATE=323
+VK_EQUIVALENTTO=211
+VT_ACC_ITER_ACT=106
+VK_ORDERBY=287
+VK_EXCLUDES=215
+VK_SOUNDSLIKE=316
+UnicodeEscape=434
+VT_DECLARATION_SECTION=9
+VT_SQUARE_CHUNK=49
+VT_TEMPLATE_ID=23
+VK_DATE_EFFECTIVE=347
+LEFT_SQUARE=409
+VT_DATA_TYPE=12
+VK_CHAR=178
+MOD=386
+VK_FUNCTION=227
+VT_EXISTS=64
+VT_METHOD=84
+VK_SALIENCE=309
+VK_SEQ=313
+DOUBLE_DOT=370
+VK_NO=269
+EOL=424
+VK_MODIFY=262
+NOT_EQUAL=388
+VK_ACTION=161
+VT_ANNOTATIONS=113
+VT_EQUIV=60
+VK_SOME=315
+VK_MEMBEROF=260
+VK_AUTO=171
+VK_OR=286
+VT_VERSION=81
+VT_OTHERWISE=88
+VT_OR=57
+VK_ON=282
+VT_ATTRIBUTES=34
+IntegerTypeSuffix=414
+MINUS_ASSIGN=400
+BOOL=421
+VK_EVENT=213
+VK_EFFECTIVE=202
+SEMICOLON=393
+VK_THEN=325
+VT_EXTENDS=28
+VK_RULEFLOW_GROUP=353
+VK_ROLE=306
+VK_RESULT=301
+WS=433
+VK_ACTIVATION=162
+VK_ENTITY=205
+VK_NO_LOOP=349
+DOUBLE_COLON=368
+LEFT_CURLY=411
+VK_COUNT=185
+VT_FACT=128
+LEFT_PAREN=407
+PERCENT_GREATER=389
+VT_RULE_ID=33
+VT_LIST=94
+VK_ONLY=284
+C_STYLE_SINGLE_LINE_COMMENT=425
+VK_VOID=341
+VT_FACTS=127
+VK_ACCUMULATE=159
+VK_OVER=289
+VK_EXTEND=218
+VK_EQUIVALENT_PROPERTIES=210
+VK_SELF=312
+VK_LOCK=248
+VK_SAME_INDIVIDUAL=310
+VT_IRI=111
+VK_VALUE=339
+VK_A_TIMER=156
+VK_OA_MISSING=279
+VT_ACCUMULATE_FUNCTION=104
+CHAIN_SEP=359
+VT_ARGS=53
+SLASH=394
+VT_EXPRESSION_CHAIN=100
+VK_A_SALIENCE=155
+VK_DATATYPE=186
+VT_SAMEAS=130
+VK_TIME=328
+VK_SUBCLASSOF=318
+PIPE=390
+VK_A_DATE_EFFECTIVE=142
+VT_VALUE=70
+VK_A_AUTOFOCUS=140
+VT_ENTRYPOINT=97
+VK_MOL=264
+VT_KEYS=115
+VK_COLLECT_LIST=183
+VK_NOT=270
+VT_ENTRYPOINT_ID=98
+VK_DECLARE=188
+VK_TYPE_BOOLEAN=331
+VT_SUBPROPERTYCHAIN=125
+VK_DIFFERENT_INDIVIDUALS=191
+VT_ARROW=37
+VT_TYPE_DECLARE_ID=27
+VT_EQV_CLASS=132
+VK_EQUIVALENT_CLASSES=209
+VT_BINDING=79
+VK_LENGTH_MIN=246
+VK_LOCK_ON_ACTIVE=346
+VK_MDA_REFLEXIVE_INV=256
+VT_DIFFERENTFROM=131
+VK_THIS=326
+VK_ALL=165
+MULTI_LINE_COMMENT=426
+VK_A_ACTGROUP=138
+DECIMAL=416
+VK_ATTRIBUTES=170
+VT_DIF_CLASS=133
+VT_MSR=54
+VK_ENTRYPOINT=207
+VK_HASKEY=230
+PLUS_ASSIGN=399
+VK_PATTERN_LANG=292
+VK_ACTIVE=163
+VT_EQV_PROP=134
+VK_OA_ID=276
+VK_MDA_FUNCTIONAL=253
+OctalEscape=435
+VK_RULEFLOW=308
+STRING=423
+VT_ONTOLOGY_SECTION=8
+VK_ANOTHER=168
+VK_DIFFERENTFROM=192
+VK_LOOP=250
+VT_DOMAIN=126
+DOT_STAR=363
+VK_ENTRY=206
+VK_AND=166
+VK_UNIQUE=337
+VK_A_LOCKONACTIVE=152
+DIV_ASSIGN=402
+VK_A_DIRECTION_ABDUCTIVE=146
+VT_FUNCTION_IMPORT=15
+VK_LONG=249
+VK_PATTERN=291
+VK_DATE=187
+DOUBLE_AMPER=364
+VT_AND=61
+DOUBLE_SQUARE_LEFT=375
+VK_PREFIX=294
+VT_DL_RESTRICTED_TYPE=118
+VT_SLOT=24
+VT_SUBCLASSOF=120
+VK_FROM=226
+VK_PROPERTY_DATA=297
+VT_EQV_INDV=136
+VT_DISJOINTUNIONOF=122
+VT_PACKAGE=6
+VK_OA_MERGE=278
+VT_TYPE_DECLARE=26
+VT_POSITIONAL_SKIP=78
+IdentifierStart=427
+VK_INT=239
+VK_ONCHANGE=283
+VT_NEG_BRANCH_LABEL=44
+VT_FORALL=65
+VT_RHS_CHUNK=47
+VK_VERY=340
+VK_FALLING=221
+VK_SUBPROPERTYCHAIN=319
+VK_ENTRY_POINT=354
+VK_INSERT=236
+VK_CALENDARS=177
+VK_IN=233
+VK_RANGE=300
+LESS_EQUAL=384
+VT_DL_DEFINITION=29
+VK_EXPIRES=217
+MISC=432
+EscapeSequence=422
+VK_DEFEATS=189
+VK_PACKAGE=290
+VK_MATCHES=251
+RIGHT_CURLY=412
+VK_TYPE_FLOAT=333
+VK_A_ENABLED=150
+VK_DISJOINT_CLASSES=194
+VK_JAVA=242
+MULT_ASSIGN=401
+VK_TYPE_INTEGER=334
+VT_FIELD=31
+VK_PROPERTY_OBJECT=298
+VT_SEQUENCE=91
+Exponent=418
+VT_POSITIONAL_CONST=76
+AND_ASSIGN=403
+VK_TIMER=329
+VK_CHARACTERISTICS=179
+VT_IMPLIES=56
+AMPER=356
+VT_FALLING_EDGE=46
+VK_SHORT=314
+TILDE=395
+DOUBLE_CAP=367
+VT_BEHAVIOR=96
+VT_RULEBASE_SECTION=10
+VT_INVERSEOF=124
+DOT=362
+VK_WINDOW=343
+IdentifierPart=428
+VT_DIM_SIZE=13
+VK_A_CALENDAR=141
+XOR=398
+VK_CONTAINS=184
+VK_FACTS=220
+VT_COUNT=67
+VK_INVERSEOF=241
+VK_FLOAT=223
+VK_LENGTH_MAX=245
+VT_DIF_INDV=137
+VK_DURATION=201
+VK_OTHERWISE=288
+VK_THAT=324
+VK_FORALL=225
+VK_DO=198
+VK_UPDATE=338
+VT_CURLY_CHUNK=48
+VT_DEBUG_LEFT_EXPR=86
+VK_A_DEDUCTION=144
+VT_RANGE=95
+VK_NAMESPACE=266
+VT_POSITIONAL_INDEX=77
+VK_ONTOLOGY=285
+TIMES=396
+VK_MDA_REFLEXIVE=255
+VK_INIT=235
+VK_OA_OTHERWISE=280
+VK_A_DIRECTION_DEDUCTIVE=147
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsEditorType.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsEditorType.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsEditorType.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,11 @@
+package org.drools.lang;
+
+/**
+ * Enum to identify an editor type (most for syntax highlighting). This
+ * is used on DroolsTree and DroolsToken.
+ *
+ * @author porcelli
+ */
+public enum DroolsEditorType {
+ KEYWORD, CODE_CHUNK, SYMBOL, NUMERIC_CONST, BOOLEAN_CONST, STRING_CONST, NULL_CONST, IDENTIFIER, IDENTIFIER_VARIABLE, IDENTIFIER_TYPE, IDENTIFIER_PATTERN;
+}
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsParaphraseTypes.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsParaphraseTypes.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsParaphraseTypes.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,11 @@
+package org.drools.lang;
+
+/**
+ * Simple enum to identify a paraphrase type. This enum is used to better format
+ * error messages during parsing.
+ *
+ * @author porcelli
+ */
+public enum DroolsParaphraseTypes {
+ PACKAGE, IMPORT, FUNCTION_IMPORT, GLOBAL, FUNCTION, QUERY, TEMPLATE, RULE, RULE_ATTRIBUTE, PATTERN, TYPE_DECLARE;
+}
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsParserExceptionFactory.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsParserExceptionFactory.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsParserExceptionFactory.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,346 @@
+package org.drools.lang;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+import java.util.Map.Entry;
+
+import org.antlr.runtime.EarlyExitException;
+import org.antlr.runtime.FailedPredicateException;
+import org.antlr.runtime.MismatchedNotSetException;
+import org.antlr.runtime.MismatchedSetException;
+import org.antlr.runtime.MismatchedTokenException;
+import org.antlr.runtime.MismatchedTreeNodeException;
+import org.antlr.runtime.NoViableAltException;
+import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.Token;
+import org.drools.compiler.DroolsParserException;
+
+/**
+ * Helper class that generates DroolsParserException with user friendly error
+ * messages.
+ *
+ * @author porcelli
+ * @see DroolsParserException
+ */
+public class DroolsParserExceptionFactory {
+ public final static String MISMATCHED_TOKEN_MESSAGE_COMPLETE = "Line %1$d:%2$d mismatched input '%3$s' expecting '%4$s'%5$s";
+ public final static String MISMATCHED_TOKEN_MESSAGE_PART = "Line %1$d:%2$d mismatched input '%3$s'%4$s";
+ public final static String MISMATCHED_TREE_NODE_MESSAGE_COMPLETE = "Line %1$d:%2$d mismatched tree node '%3$s' expecting '%4$s'%5$s";
+ public final static String MISMATCHED_TREE_NODE_MESSAGE_PART = "Line %1$d:%2$d mismatched tree node '%3$s'%4$s";
+ public final static String NO_VIABLE_ALT_MESSAGE = "Line %1$d:%2$d no viable alternative at input '%3$s'%4$s";
+ public final static String EARLY_EXIT_MESSAGE = "Line %1$d:%2$d required (...)+ loop did not match anything at input '%3$s'%4$s";
+ public final static String MISMATCHED_SET_MESSAGE = "Line %1$d:%2$d mismatched input '%3$' expecting set '%4$s'%5$s.";
+ public final static String MISMATCHED_NOT_SET_MESSAGE = "Line %1$d:%2$d mismatched input '%3$' expecting set '%4$s'%5$s";
+ public final static String FAILED_PREDICATE_MESSAGE = "Line %1$d:%2$d rule '%3$s' failed predicate: {%4$s}?%5$s";
+ public final static String TRAILING_SEMI_COLON_NOT_ALLOWED_MESSAGE = "Line %1$d:%2$d trailing semi-colon not allowed%3$s";
+ public final static String PARSER_LOCATION_MESSAGE_COMPLETE = " in %1$s %2$s";
+ public final static String PARSER_LOCATION_MESSAGE_PART = " in %1$s";
+
+ private String[] tokenNames = null;
+ private Stack<Map<DroolsParaphraseTypes, String>> paraphrases = null;
+
+ /**
+ * DroolsParserErrorMessages constructor.
+ *
+ * @param tokenNames
+ * tokenNames generated by ANTLR
+ * @param paraphrases
+ * paraphrases parser structure
+ */
+ public DroolsParserExceptionFactory(String[] tokenNames,
+ Stack<Map<DroolsParaphraseTypes, String>> paraphrases) {
+ this.tokenNames = tokenNames;
+ this.paraphrases = paraphrases;
+ }
+
+ /**
+ * This method creates a DroolsParserException for trailing semicolon
+ * exception, full of information.
+ *
+ * @param line
+ * line number
+ * @param column
+ * column position
+ * @param offset
+ * char offset
+ * @return DroolsParserException filled.
+ */
+ public DroolsParserException createTrailingSemicolonException(int line,
+ int column, int offset) {
+ String message = String
+ .format(
+ DroolsParserExceptionFactory.TRAILING_SEMI_COLON_NOT_ALLOWED_MESSAGE,
+ line, column, formatParserLocation());
+
+ return new DroolsParserException("ERR 104", message, line, column,
+ offset, null);
+ }
+
+ /**
+ * This method creates a DroolsParserException full of information.
+ *
+ * @param e
+ * original exception
+ * @return DroolsParserException filled.
+ */
+ public DroolsParserException createDroolsException(RecognitionException e) {
+ List<String> codeAndMessage = createErrorMessage(e);
+ return new DroolsParserException(codeAndMessage.get(1), codeAndMessage
+ .get(0), e.line, e.charPositionInLine, e.index, e);
+ }
+
+ /**
+ * This will take a RecognitionException, and create a sensible error
+ * message out of it
+ */
+ private List<String> createErrorMessage(RecognitionException e) {
+ List<String> codeAndMessage = new ArrayList<String>(2);
+ String message = "";
+ if (e instanceof MismatchedTokenException) {
+ MismatchedTokenException mte = (MismatchedTokenException) e;
+ if (tokenNames != null && mte.expecting >= 0 && mte.expecting < tokenNames.length) {
+ message = String
+ .format(
+ DroolsParserExceptionFactory.MISMATCHED_TOKEN_MESSAGE_COMPLETE,
+ e.line, e.charPositionInLine,
+ getBetterToken(e.token),
+ getBetterToken(mte.expecting),
+ formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 102");
+ } else {
+ message = String
+ .format(
+ DroolsParserExceptionFactory.MISMATCHED_TOKEN_MESSAGE_PART,
+ e.line, e.charPositionInLine,
+ getBetterToken(e.token), formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 102");
+ }
+ } else if (e instanceof MismatchedTreeNodeException) {
+ MismatchedTreeNodeException mtne = (MismatchedTreeNodeException) e;
+ if (mtne.expecting >= 0 && mtne.expecting < tokenNames.length) {
+ message = String
+ .format(
+ DroolsParserExceptionFactory.MISMATCHED_TREE_NODE_MESSAGE_COMPLETE,
+ e.line, e.charPositionInLine,
+ getBetterToken(e.token),
+ getBetterToken(mtne.expecting),
+ formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 106");
+ } else {
+ message = String
+ .format(
+ DroolsParserExceptionFactory.MISMATCHED_TREE_NODE_MESSAGE_PART,
+ e.line, e.charPositionInLine,
+ getBetterToken(e.token), formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 106");
+ }
+ } else if (e instanceof NoViableAltException) {
+ // NoViableAltException nvae = (NoViableAltException) e;
+ message = String.format(
+ DroolsParserExceptionFactory.NO_VIABLE_ALT_MESSAGE, e.line,
+ e.charPositionInLine, getBetterToken(e.token),
+ formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 101");
+ } else if (e instanceof EarlyExitException) {
+ // EarlyExitException eee = (EarlyExitException) e;
+ message = String.format(
+ DroolsParserExceptionFactory.EARLY_EXIT_MESSAGE, e.line,
+ e.charPositionInLine, getBetterToken(e.token),
+ formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 105");
+ } else if (e instanceof MismatchedSetException) {
+ MismatchedSetException mse = (MismatchedSetException) e;
+ message = String.format(
+ DroolsParserExceptionFactory.MISMATCHED_SET_MESSAGE,
+ e.line, e.charPositionInLine, getBetterToken(e.token),
+ mse.expecting, formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 107");
+ } else if (e instanceof MismatchedNotSetException) {
+ MismatchedNotSetException mse = (MismatchedNotSetException) e;
+ message = String.format(
+ DroolsParserExceptionFactory.MISMATCHED_NOT_SET_MESSAGE,
+ e.line, e.charPositionInLine, getBetterToken(e.token),
+ mse.expecting, formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 108");
+ } else if (e instanceof FailedPredicateException) {
+ FailedPredicateException fpe = (FailedPredicateException) e;
+ message = String.format(
+ DroolsParserExceptionFactory.FAILED_PREDICATE_MESSAGE,
+ e.line, e.charPositionInLine, fpe.ruleName,
+ fpe.predicateText, formatParserLocation());
+ codeAndMessage.add(message);
+ codeAndMessage.add("ERR 103");
+ }
+ if (codeAndMessage.get(0).length() == 0) {
+ codeAndMessage.add("?????");
+ }
+ return codeAndMessage;
+ }
+
+ /**
+ * This will take Paraphrases stack, and create a sensible location
+ */
+ private String formatParserLocation() {
+ StringBuilder sb = new StringBuilder();
+ if (paraphrases != null){
+ for (Map<DroolsParaphraseTypes, String> map : paraphrases) {
+ for (Entry<DroolsParaphraseTypes, String> activeEntry : map
+ .entrySet()) {
+ if (activeEntry.getValue().length() == 0) {
+ sb.append(String.format(PARSER_LOCATION_MESSAGE_PART,
+ getLocationName(activeEntry.getKey())));
+ } else {
+ sb.append(String.format(PARSER_LOCATION_MESSAGE_COMPLETE,
+ getLocationName(activeEntry.getKey()), activeEntry
+ .getValue()));
+ }
+ }
+ }
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Returns a string based on Paraphrase Type
+ *
+ * @param type
+ * Paraphrase Type
+ * @return a string representing the
+ */
+ private String getLocationName(DroolsParaphraseTypes type) {
+ switch (type) {
+ case PACKAGE:
+ return "package";
+ case IMPORT:
+ return "import";
+ case FUNCTION_IMPORT:
+ return "function import";
+ case GLOBAL:
+ return "global";
+ case FUNCTION:
+ return "function";
+ case QUERY:
+ return "query";
+ case TEMPLATE:
+ return "template";
+ case RULE:
+ return "rule";
+ case RULE_ATTRIBUTE:
+ return "rule attribute";
+ case PATTERN:
+ return "pattern";
+ default:
+ return "";
+ }
+ }
+
+ /**
+ * Helper method that creates a user friendly token definition
+ *
+ * @param token
+ * token
+ * @return user friendly token definition
+ */
+ private String getBetterToken(Token token) {
+ if (token == null){
+ return "";
+ }
+ return getBetterToken(token.getType(), token.getText());
+ }
+
+ /**
+ * Helper method that creates a user friendly token definition
+ *
+ * @param tokenType
+ * token type
+ * @return user friendly token definition
+ */
+ private String getBetterToken(int tokenType) {
+ return getBetterToken(tokenType, null);
+ }
+
+ /**
+ * Helper method that creates a user friendly token definition
+ *
+ * @param tokenType
+ * token type
+ * @param defaultValue
+ * default value for identifier token, may be null
+ * @return user friendly token definition
+ */
+ private String getBetterToken(int tokenType, String defaultValue) {
+ switch (tokenType) {
+ case DRLv6Lexer.DECIMAL:
+ return defaultValue == null ? "int" : defaultValue;
+ case DRLv6Lexer.FLOAT:
+ return defaultValue == null ? "float" : defaultValue;
+ case DRLv6Lexer.STRING:
+ return defaultValue == null ? "string" : defaultValue;
+// case DRLv6Lexer.BOOL:
+// return defaultValue == null ? "boolean" : defaultValue;
+// case DRLv6Lexer.NULL:
+// return "null";
+// case DRLv6Lexer.THEN:
+// return "then";
+ case DRLv6Lexer.SEMICOLON:
+ return ";";
+ case DRLv6Lexer.DOT_STAR:
+ return ".*";
+ case DRLv6Lexer.COLON:
+ return ":";
+ case DRLv6Lexer.EQUALS:
+ return "==";
+ case DRLv6Lexer.NOT_EQUAL:
+ return "!=";
+ case DRLv6Lexer.GREATER:
+ return ">";
+ case DRLv6Lexer.GREATER_EQUAL:
+ return ">=";
+ case DRLv6Lexer.LESS:
+ return "<";
+ case DRLv6Lexer.LESS_EQUAL:
+ return "<=";
+ case DRLv6Lexer.ARROW:
+ return "->";
+ case DRLv6Lexer.ID:
+ return defaultValue == null ? "identifier" : defaultValue;
+ case DRLv6Lexer.LEFT_PAREN:
+ return "(";
+ case DRLv6Lexer.RIGHT_PAREN:
+ return ")";
+ case DRLv6Lexer.LEFT_SQUARE:
+ return "[";
+ case DRLv6Lexer.RIGHT_SQUARE:
+ return "]";
+ case DRLv6Lexer.LEFT_CURLY:
+ return "{";
+ case DRLv6Lexer.RIGHT_CURLY:
+ return "}";
+ case DRLv6Lexer.COMMA:
+ return ",";
+ case DRLv6Lexer.DOT:
+ return ".";
+ case DRLv6Lexer.DOUBLE_AMPER:
+ return "&&";
+ case DRLv6Lexer.DOUBLE_PIPE:
+ return "||";
+ case DRLv6Lexer.MISC:
+ return defaultValue == null ? "misc" : defaultValue;
+ case DRLv6Lexer.EOF:
+ return "<eof>";
+ default:
+ return tokenType > tokenNames.length ? "unknown"
+ : tokenNames[tokenType];
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSentence.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSentence.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSentence.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,130 @@
+package org.drools.lang;
+
+import java.util.Collections;
+import java.util.LinkedList;
+
+/**
+ * Class that represents a DroolsLanguage sentence. To be used by IDE.
+ *
+ * @author porcelli
+ */
+ at SuppressWarnings("unchecked")
+public class DroolsSentence {
+
+ /**
+ * sentence type
+ */
+ private DroolsSentenceType type = DroolsSentenceType.RULE;
+ /**
+ * linked list that stores DroolsTokens and Locations
+ */
+ private LinkedList content = new LinkedList();
+ /**
+ * start char offset
+ */
+ private int startOffset = -1;
+ /**
+ * end char offset
+ */
+ private int endOffset = -1;
+
+ /**
+ * getter of sentence type
+ *
+ * @return sentence type
+ * @see DroolsSentenceType
+ */
+ public DroolsSentenceType getType() {
+ return type;
+ }
+
+ /**
+ * setter of sentence type
+ *
+ * @param type
+ * sentence type
+ * @see DroolsSentenceType
+ */
+ public void setType(DroolsSentenceType type) {
+ this.type = type;
+ }
+
+ /**
+ * getter for start char offset
+ *
+ * @return start char offset
+ */
+ public int getStartOffset() {
+ return startOffset;
+ }
+
+ /**
+ * setter for start char offset
+ *
+ * @param startOffset
+ * start char offset
+ */
+ public void setStartOffset(int startOffset) {
+ this.startOffset = startOffset;
+ }
+
+ /**
+ * getter for end char offset
+ *
+ * @return end char offset
+ */
+ public int getEndOffset() {
+ return endOffset;
+ }
+
+ /**
+ * setter for end char offset
+ *
+ * @param endOffset
+ * end char offset
+ */
+ public void setEndOffset(int endOffset) {
+ this.endOffset = endOffset;
+ }
+
+ /**
+ * getter of sentence content
+ *
+ * @return linked list that stores DroolsTokens and Locations
+ */
+ public LinkedList getContent() {
+ return content;
+ }
+
+ /**
+ * Reverses the content linked list
+ */
+ public void reverseContent() {
+ Collections.reverse(content);
+ }
+
+ /**
+ * Add a token to the content and sets char offset info
+ *
+ * @param token
+ * token to be stored
+ */
+ public void addContent(DroolsToken token) {
+ if (startOffset == -1) {
+ startOffset = token.getStartIndex();
+ }
+ endOffset = token.getStopIndex();
+ this.content.add(token);
+ }
+
+ /**
+ * Add a location to the content
+ *
+ * @param contextInfo
+ * location identifier
+ * @see Location
+ */
+ public void addContent(int contextInfo) {
+ this.content.add(contextInfo);
+ }
+}
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSentenceType.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSentenceType.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSentenceType.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,12 @@
+package org.drools.lang;
+
+/**
+ * Enum to identify a sentence type. This is used by DRLParser and stored into
+ * DroolsSentence.
+ *
+ * @author porcelli
+ * @see DroolsSentence
+ */
+public enum DroolsSentenceType {
+ PACKAGE, FUNCTION_IMPORT_STATEMENT, IMPORT_STATEMENT, GLOBAL, FUNCTION, TEMPLATE, TYPE_DECLARATION, RULE, QUERY;
+}
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSoftKeywords.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSoftKeywords.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsSoftKeywords.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,236 @@
+package org.drools.lang;
+
+//import org.drools.RuntimeDroolsException;
+//import org.drools.base.evaluators.Operator;
+
+/**
+ * Simple holder class identifying all the DRL soft keywords. This is used by
+ * DRLParser.
+ *
+ * @author porcelli
+ */
+public class DroolsSoftKeywords {
+
+ public static final String A_ACTGROUP = "activation-group";
+ public static final String A_AGENDAGROUP = "agenda-group";
+ public static final String A_AUTOFOCUS = "auto-focus";
+ public static final String A_CALENDAR = "calendar";
+ public static final String A_DATE_EFFECTIVE = "effective";
+ public static final String A_DATE_EXPIRES = "expires";
+ public static final String A_DEDUCTION = "deduction";
+ public static final String A_DIALECT = "dialect";
+ public static final String A_DIRECTION_ABDUCTIVE = "abductive";
+ public static final String A_DIRECTION_DEDUCTIVE = "deductive";
+ public static final String A_DIRECTION_EQUIVALENCE = "equivalence";
+ public static final String A_DURATION = "duration";
+ public static final String A_ENABLED = "enabled";
+ public static final String A_IMPLICATION = "implication";
+ public static final String A_LOCKONACTIVE = "lock-on-active";
+ public static final String A_NOLOOP = "no-loop";
+ public static final String A_RULEFLOWGROUP = "ruleflow-group";
+ public static final String A_SALIENCE = "salience";
+ public static final String A_TIMER = "timer";
+ public static final String ACC = "acc";
+ public static final String ACCL = "accL";
+ public static final String ACCUMULATE = "accumulate";
+ public static final String ACCUMULATE_RIGHT = "accR";
+ public static final String ACTION = "action";
+ public static final String ACTIVATION = "activation";
+ public static final String ACTIVE = "active";
+ public static final String AGENDA = "agenda";
+ public static final String ALL = "all";
+ public static final String AND = "and";
+ public static final String ANNOTATIONS = "annotations";
+ public static final String ANOTHER = "another";
+ public static final String AS = "as";
+ public static final String ATTRIBUTES = "attributes";
+ public static final String AUTO = "auto";
+ public static final String AVERAGE = "avg";
+ public static final String BOOL = "true";
+ public static final String BOOLEAN = "boolean";
+ public static final String BRANCH = "branch";
+ public static final String BYTE = "byte";
+ public static final String CALENDARS = "calendars";
+ public static final String CHAR = "char";
+ public static final String CHARACTERISTICS = "Characteristics";
+ public static final String CLASS = "Class";
+ public static final String CLOSURE = "closure";
+ public static final String COLLECT = "collect";
+ public static final String COLLECT_LIST = "collectList";
+ public static final String CONTAINS = "contains";
+ public static final String COUNT = "count";
+ public static final String DATATYPE = "Datatype";
+ public static final String DATE = "date";
+ public static final String DECLARE = "declare";
+ public static final String DEFEATS = "defeats";
+ public static final String DIFFERENT_INDIVIDUALS = "differentIndividuals";
+ public static final String DIFFERENTFROM = "differentFrom";
+ public static final String DISJOINT = "disjointWith";
+ public static final String DISJOINT_CLASSES = "disjointClasses";
+ public static final String DISJOINT_PROPERTIES = "disjointProperties";
+ public static final String DISJOINT_UNION = "disjointUnionOf";
+ public static final String DISTINCT = "distinct";
+ public static final String DO = "do";
+ public static final String DOMAIN = "domain";
+ public static final String DOUBLE = "double";
+ public static final String DURATION = "duration";
+ public static final String EFFECTIVE = "effective";
+ public static final String ENABLED = "enabled";
+ public static final String END = "end";
+ public static final String ENTITY = "Entity";
+ public static final String ENTRY = "entry";
+ public static final String ENTRYPOINT = "entry-point";
+ public static final String EQUIV = "equiv";
+ public static final String EQUIVALENT_CLASSES = "equivalentClasses";
+ public static final String EQUIVALENT_PROPERTIES = "equivalentProperties";
+ public static final String EQUIVALENTTO = "equivalentTo";
+ public static final String EVAL = "eval";
+ public static final String EVENT = "Event";
+ public static final String EXACTLY = "exactly";
+ public static final String EXCLUDES = "excludes";
+ public static final String EXISTS = "exists";
+ public static final String EXPIRES = "expires";
+ public static final String EXTEND = "extends";
+ public static final String EXTENDS = "extends";
+ public static final String FACTS = "facts";
+ public static final String FALLING = "falling";
+ public static final String FILTER = "filter";
+ public static final String FLOAT = "float";
+ public static final String FOCUS = "focus";
+ public static final String FORALL = "forall";
+ public static final String FROM = "from";
+ public static final String FUNCTION = "function";
+ public static final String GLOBAL = "global";
+ public static final String GROUP = "group";
+ public static final String HASKEY = "HasKey";
+ public static final String IMPLIES = "implies";
+ public static final String IMPORT = "import";
+ public static final String IN = "in";
+ public static final String INDIVIDUAL = "individual";
+ public static final String INIT = "init";
+ public static final String INSERT = "insert";
+ public static final String INSERT_LOG = "insertLogical";
+ public static final String INSTANCEOF = "instanceof";
+ public static final String INT = "int";
+ public static final String INVERSE = "inverse";
+ public static final String INVERSEOF = "inverseOf";
+ public static final String JAVA = "java";
+ public static final String KEY = "key";
+ public static final String LENGTH = "length";
+ public static final String LENGTH_MAX = "maxLength";
+ public static final String LENGTH_MIN = "minLength";
+ public static final String LIMIT = "limit";
+ public static final String LOCK = "lock";
+ public static final String LONG = "long";
+ public static final String LOOP = "loop";
+ public static final String MATCHES = "matches";
+ public static final String MAX = "max";
+ public static final String MDA_FUNCTIONAL = "functional";
+ public static final String MDA_FUNCTIONAL_INV = "inverseFunctional";
+ public static final String MDA_REFLEXIVE = "reflexive";
+ public static final String MDA_REFLEXIVE_INV = "irreflexive";
+ public static final String MDA_SYMMETRIC = "symmetric";
+ public static final String MDA_SYMMETRIC_INV = "asymmetric";
+ public static final String MDA_TRANSITIVE = "transitive";
+ public static final String MEMBEROF = "memberof";
+ public static final String MIN = "min";
+ public static final String MODIFY = "modify";
+ public static final String MODIFY_LOG = "modifyLogical";
+ public static final String MOL = "mol";
+ public static final String MVEL = "mvel";
+ public static final String NAMESPACE = "namespace";
+ public static final String NEG = "neg";
+ public static final String NEW = "new";
+ public static final String NO = "no";
+ public static final String NOT = "not";
+ public static final String NULL = "null";
+ public static final String OA_CRISP = "crisp";
+ public static final String OA_DEFAULT = "default";
+ public static final String OA_DEFEAT = "defeat";
+ public static final String OA_DEGREE = "degree";
+ public static final String OA_ID = "id";
+ public static final String OA_KIND = "kind";
+ public static final String OA_MERGE = "merge";
+ public static final String OA_MISSING = "missing";
+ public static final String OA_OTHERWISE = "otherwise";
+ public static final String OA_PARAMS = "params";
+ public static final String ON = "on";
+ public static final String ONCHANGE = "onChange";
+ public static final String ONLY = "only";
+ public static final String ONTOLOGY = "ontology";
+ public static final String OR = "or";
+ public static final String ORDERBY = "orderby";
+ public static final String OTHERWISE = "OTHERWISE";
+ public static final String OVER = "over";
+ public static final String PACKAGE = "package";
+ public static final String PATTERN = "pattern";
+ public static final String PATTERN_LANG = "langPattern";
+ public static final String POINT = "point";
+ public static final String PREFIX = "Prefix";
+ public static final String PROPERTY = "property";
+ public static final String PROPERTY_ANNOTATION = "AnnotationProperty";
+ public static final String PROPERTY_DATA = "DataProperty";
+ public static final String PROPERTY_OBJECT = "ObjectProperty";
+ public static final String QUERY = "query";
+ public static final String RANGE = "range";
+ public static final String RESULT = "result";
+ public static final String RETRACT = "retract";
+ public static final String RETRACT_LOG = "retractLogical";
+ public static final String REVERSE = "reverse";
+ public static final String RISING = "rising";
+ public static final String ROLE = "role";
+ public static final String RULE = "rule";
+ public static final String RULEFLOW = "ruleflow";
+ public static final String SALIENCE = "salience";
+ public static final String SAME_INDIVIDUAL = "sameIndividual";
+ public static final String SAMEAS = "sameAs";
+ public static final String SELF = "Self";
+ public static final String SEQ = "seq";
+ public static final String SHORT = "short";
+ public static final String SOME = "some";
+ public static final String SOUNDSLIKE = "soundslike";
+ public static final String START = "start";
+ public static final String SUBCLASSOF = "SubClassOf";
+ public static final String SUBPROPERTYCHAIN = "SubPropertyChain";
+ public static final String SUBPROPERTYOF = "SubPropertyOf";
+ public static final String SUM = "sum";
+ public static final String SUPER = "super";
+ public static final String TEMPLATE = "template";
+ public static final String THAT = "that";
+ public static final String THEN = "then";
+ public static final String THIS = "this";
+ public static final String THROTTLE = "throttle";
+ public static final String TIME = "time";
+ public static final String TIMER = "timer";
+ public static final String TYPE = "type";
+ public static final String TYPE_BOOLEAN = "boolean";
+ public static final String TYPE_DOUBLE = "double";
+ public static final String TYPE_FLOAT = "float";
+ public static final String TYPE_INTEGER = "integer";
+ public static final String TYPE_STRING = "string";
+ public static final String TYPES = "types";
+ public static final String UNIQUE = "unique";
+ public static final String UPDATE = "update";
+ public static final String VALUE = "value";
+ public static final String VERY = "very";
+ public static final String VOID = "void";
+ public static final String WHEN = "when";
+ public static final String WINDOW = "window";
+ public static final String XOR = "xor";
+
+
+
+ public static boolean isOperator( final String operator, final boolean negated ) {
+ try {
+ // Operator.determineOperator( operator, negated );
+ return true;
+ } catch( RuntimeException rde ) {
+ return false;
+ }
+ }
+
+
+
+
+
+}
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsToken.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsToken.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsToken.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,88 @@
+/**
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.drools.lang;
+
+import org.antlr.runtime.CharStream;
+import org.antlr.runtime.CommonToken;
+import org.antlr.runtime.Token;
+
+/**
+ * An extension of the CommonToken class that keeps the char offset information
+ *
+ * @author porcelli
+ *
+ */
+public class DroolsToken extends CommonToken {
+
+ private static final long serialVersionUID = 510l;
+
+ /**
+ * editor type
+ *
+ * @see DroolsEditorType
+ */
+ private DroolsEditorType editorType = DroolsEditorType.IDENTIFIER;
+
+ public DroolsToken(int type) {
+ super(type);
+ }
+
+ public DroolsToken(CharStream input, int type, int channel, int start,
+ int stop) {
+ super(input, type, channel, start, stop);
+ }
+
+ public DroolsToken(int type, String text) {
+ super(type, text);
+ }
+
+ /**
+ * Constructor that preserves the char offset
+ *
+ * @param oldToken
+ */
+ public DroolsToken(Token oldToken) {
+ super(oldToken);
+ if (null != oldToken
+ && (oldToken.getClass().equals(CommonToken.class) || oldToken
+ .getClass().equals(DroolsToken.class))) {
+ start = ((CommonToken) oldToken).getStartIndex();
+ stop = ((CommonToken) oldToken).getStopIndex();
+ }
+ }
+
+ /**
+ * getter of editor type
+ *
+ * @return editor type
+ * @see DroolsEditorType
+ */
+ public DroolsEditorType getEditorType() {
+ return editorType;
+ }
+
+ /**
+ * setter of editor type
+ *
+ * @param editorElementType
+ * editor type
+ * @see DroolsEditorType
+ */
+ public void setEditorType(DroolsEditorType editorType) {
+ this.editorType = editorType;
+ }
+}
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsTree.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsTree.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/DroolsTree.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,103 @@
+package org.drools.lang;
+
+import org.antlr.runtime.Token;
+import org.antlr.runtime.tree.CommonTree;
+import org.antlr.runtime.tree.Tree;
+
+/**
+ * An extension of the CommonTree class that keeps the char offset information.
+ *
+ * @author porcelli
+ *
+ */
+public class DroolsTree extends CommonTree {
+
+ /**
+ * start char offset
+ */
+ int startCharOffset = -1;
+
+ /**
+ * end char offset
+ */
+ int endCharOffset = -1;
+
+ /**
+ * editor type
+ *
+ * @see DroolsEditorType
+ */
+ DroolsEditorType editorElementType = DroolsEditorType.IDENTIFIER;
+
+ public DroolsTree(DroolsTree node) {
+ super(node);
+ this.token = node.token;
+ }
+
+ public DroolsTree(Token token) {
+ super(token);
+ }
+
+ public Tree dupNode() {
+ return new DroolsTree(this);
+ }
+
+ /**
+ * getter for start char offset
+ *
+ * @return start char offset
+ */
+ public int getStartCharOffset() {
+ return startCharOffset;
+ }
+
+ /**
+ * setter for start char offset
+ *
+ * @param startCharOffset
+ * start char offset
+ */
+ public void setStartCharOffset(int startCharOffset) {
+ this.startCharOffset = startCharOffset;
+ }
+
+ /**
+ * getter of end char offset
+ *
+ * @return end char offset
+ */
+ public int getEndCharOffset() {
+ return endCharOffset;
+ }
+
+ /**
+ * setter of end char offset
+ *
+ * @param endCharOffset
+ * end char offset
+ */
+ public void setEndCharOffset(int endCharOffset) {
+ this.endCharOffset = endCharOffset;
+ }
+
+ /**
+ * getter of editor type
+ *
+ * @return editor type
+ * @see DroolsEditorType
+ */
+ public DroolsEditorType getEditorElementType() {
+ return editorElementType;
+ }
+
+ /**
+ * setter of editor type
+ *
+ * @param editorElementType
+ * editor type
+ * @see DroolsEditorType
+ */
+ public void setEditorElementType(DroolsEditorType editorElementType) {
+ this.editorElementType = editorElementType;
+ }
+}
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/Location.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/Location.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/Location.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2006 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Created on May 22, 2007
+ */
+package org.drools.lang;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A class to hold contextual information during DRL parsing
+ *
+ * @author etirelli, krisv
+ */
+public class Location {
+
+ public static final int LOCATION_UNKNOWN = 0;
+
+ public static final int LOCATION_LHS_BEGIN_OF_CONDITION = 1;
+ public static final int LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS = 2;
+ public static final int LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR = 3;
+ public static final int LOCATION_LHS_BEGIN_OF_CONDITION_NOT = 4;
+
+ public static final int LOCATION_LHS_INSIDE_CONDITION_START = 100;
+ public static final int LOCATION_LHS_INSIDE_CONDITION_OPERATOR = 101;
+ public static final int LOCATION_LHS_INSIDE_CONDITION_ARGUMENT = 102;
+ public static final int LOCATION_LHS_INSIDE_CONDITION_END = 103;
+
+ public static final int LOCATION_LHS_INSIDE_EVAL = 200;
+
+ public static final int LOCATION_LHS_FROM = 300;
+ public static final int LOCATION_LHS_FROM_COLLECT = 301;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE = 302;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE_INIT = 303;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE_INIT_INSIDE = 304;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE_ACTION = 305;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE_ACTION_INSIDE = 306;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE_REVERSE = 307;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE_REVERSE_INSIDE = 308;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE_RESULT = 309;
+ public static final int LOCATION_LHS_FROM_ACCUMULATE_RESULT_INSIDE = 310;
+ public static final int LOCATION_LHS_FROM_ENTRY_POINT = 311;
+
+ public static final int LOCATION_RHS = 1000;
+ public static final int LOCATION_RULE_HEADER = 2000;
+ public static final int LOCATION_RULE_HEADER_KEYWORD = 2001;
+
+ public static final String LOCATION_PROPERTY_CLASS_NAME = "ClassName";
+ public static final String LOCATION_PROPERTY_PROPERTY_NAME = "PropertyName";
+ public static final String LOCATION_PROPERTY_OPERATOR = "Operator";
+ public static final String LOCATION_EVAL_CONTENT = "EvalContent";
+ public static final String LOCATION_FROM_CONTENT = "FromContent";
+ public static final String LOCATION_PROPERTY_FROM_ACCUMULATE_INIT_CONTENT = "FromAccumulateInitContent";
+ public static final String LOCATION_PROPERTY_FROM_ACCUMULATE_ACTION_CONTENT = "FromAccumulateActionContent";
+ public static final String LOCATION_PROPERTY_FROM_ACCUMULATE_REVERSE_CONTENT = "FromAccumulateReverseContent";
+ public static final String LOCATION_PROPERTY_FROM_ACCUMULATE_RESULT_CONTENT = "FromAccumulateResultContent";
+ public static final String LOCATION_PROPERTY_FROM_ACCUMULATE_EXPRESSION_CONTENT = "FromAccumulateExpressionContent";
+ public static final String LOCATION_LHS_CONTENT = "LHSContent";
+ public static final String LOCATION_RHS_CONTENT = "RHSContent";
+ public static final String LOCATION_HEADER_CONTENT = "HeaderContent";
+
+ private int type;
+ private Map properties = new HashMap();
+
+ public Location(int type) {
+ this.type = type;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public void setProperty(String name, Object value) {
+ properties.put(name, value);
+ }
+
+ public Object getProperty(String name) {
+ return properties.get(name);
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+}
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/Manchester.tokens
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/Manchester.tokens (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/Manchester.tokens 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,432 @@
+VK_TYPE=330
+DOUBLE_SLASH=374
+DOUBLE_SQUARE_RIGHT=376
+BLANK_ID=430
+VK_OA_DEFAULT=273
+VK_OPERATOR=345
+VK_GLOBAL=228
+VT_TYPE=52
+VT_NEG=58
+VK_NULL=271
+VK_START=317
+VT_RHS=38
+VT_SUBPROPERTYOF=123
+VK_EQUIV=208
+VK_CLASS=180
+VK_ANNOTATIONS=167
+VK_DOUBLE=200
+VT_INDEX_ALL=83
+VK_SAMEAS=311
+VK_PROPERTY_ANNOTATION=296
+QUESTION_MARK=392
+VK_AVERAGE=172
+VK_WHEN=342
+GATE=379
+DOUBLE_MINUS=369
+VT_QUERY_PATTERN=74
+VK_NEW=268
+VK_MAX=252
+VK_DISTINCT=197
+VT_COLLECT_LIST=109
+VK_AS=169
+VK_DOMAIN=199
+VT_BRANCH_DEFAULT=42
+VT_FUNCTION_ID=18
+VK_GROUP=229
+VK_BRANCH=175
+VK_NEG=267
+VK_EXACTLY=214
+DOUBLE_ANG=366
+VK_A_DIALECT=145
+VT_RISING_EDGE=45
+VT_EXPR=85
+VT_SET=90
+VT_ENTITY_TYPE=32
+OCTAL=417
+VK_BYTE=176
+VK_SUBPROPERTYOF=320
+VK_OA_CRISP=272
+VK_ACTIVATION_GROUP=351
+VT_NEW_OBJ=51
+VK_IMPLIES=231
+FLOAT=420
+HexDigit=413
+VT_IMPORT_SECTION=7
+VT_ACCUMULATE_ITERATION=103
+VK_EVAL=212
+AT=357
+DOUBLE_PIPE=373
+RIGHT_PAREN=408
+VT_COMPILATION_UNIT=4
+VK_DISJOINT_UNION=196
+VK_INDIVIDUAL=234
+XOR_ASSIGN=405
+PLUS=391
+VK_INSERT_LOG=237
+VK_DIALECT=190
+VK_A_IMPLICATION=151
+VT_GLOBAL_ID=11
+VK_TYPE_STRING=335
+VT_ANNOTATION=114
+VT_FROM_SOURCE=99
+VT_TRAIL=92
+VK_INSTANCEOF=238
+VT_HEDGE_MOL=63
+VT_POSITIONAL_VAR=75
+VK_OA_DEFEAT=274
+VK_REVERSE=304
+VK_LENGTH=244
+TRIPLE_GREATER=397
+VK_A_DIRECTION_EQUIVALENCE=148
+VK_MDA_FUNCTIONAL_INV=254
+VK_INVERSE=240
+VT_STAR=16
+VT_DL_TYPE=30
+MINUS=385
+VK_PROPERTY=295
+VK_TYPES=336
+VK_MODIFY_LOG=263
+VK_OA_DEGREE=275
+COLON=360
+OR_ASSIGN=404
+VT_MAX=69
+VT_AND_IMPLICIT=55
+VT_TRAIL_NODE=93
+VK_RISING=305
+VT_SLOT_ID=25
+VK_OA_KIND=277
+DOUBLE_PLUS=365
+VT_FILTER=89
+VT_PARAM_LIST=20
+ARROW=358
+VK_SUM=321
+VK_AGENDA_GROUP=352
+GREATER_EQUAL=381
+VT_ACC_ITER_INIT=105
+VK_A_DURATION=149
+DOUBLE_GREATER=371
+VK_RETRACT_LOG=303
+VT_NAME=21
+FloatTypeSuffix=419
+VT_THEN=39
+VK_A_DATE_EXPIRES=143
+VK_MDA_SYMMETRIC_INV=258
+MOD_ASSIGN=406
+VT_ACCESSOR=80
+VT_DIF_PROP=135
+VT_TEMPLATE=22
+EQUALS=378
+VK_AUTO_FOCUS=350
+NEG_MARK=387
+VT_DEBUG_RIGHT_EXPR=87
+VK_AGENDA=164
+VK_KEY=243
+GREATER=380
+VK_IMPORT=232
+VT_INDEXER=82
+VK_RULE=307
+LESS_PERCENT=383
+LESS=382
+VAR=431
+VK_A_RULEFLOWGROUP=154
+VK_A_NOLOOP=153
+VT_PARAM=19
+VT_ACC_ITER_REV=107
+VT_ACC_ITER_RES=108
+VK_MIN=261
+VT_PREFIX=112
+VK_FILTER=222
+VT_BRANCH=41
+VK_PRIMITIVE_TYPE=355
+VK_TYPE_DOUBLE=332
+VT_ENABLED=73
+VK_COLLECT=182
+VK_QUERY=299
+VK_OA_PARAMS=281
+VT_DIALECT=35
+VK_ACCUMULATE_RIGHT=160
+VT_EQUIVALENTTO=119
+VT_PACKAGE_ID=5
+DOUBLE_LESS=372
+VK_THROTTLE=327
+VT_TYPES=129
+VT_DL_RESTRICTION=117
+VT_PATTERN=71
+VK_DISJOINT=193
+VT_ACCUMULATE_LEFT=101
+VT_XOR=59
+VT_FUNCTION=17
+VK_ENABLED=203
+VK_END=204
+VT_CLOSURE=40
+RIGHT_SQUARE=410
+VK_MVEL=265
+VT_MIN=68
+VT_ONTOLOGY=110
+VK_RETRACT=302
+VK_ACC=157
+VK_CLOSURE=181
+VT_IMPORT=14
+VT_ACCUMULATE_RIGHT=102
+VK_BOOLEAN=174
+VK_SUPER=322
+VK_EXISTS=216
+VK_DATE_EXPIRES=348
+ID=429
+VT_DISJOINTWITH=121
+VK_MDA_TRANSITIVE=259
+VK_XOR=344
+VK_LIMIT=247
+COMMA=361
+HEX=415
+VT_LHS=36
+EQUAL=377
+VK_FOCUS=224
+VT_BRANCH_LABEL=43
+VT_DL_PROP=116
+VK_ACCL=158
+VK_MDA_SYMMETRIC=257
+VK_A_AGENDAGROUP=139
+VT_PAREN_CHUNK=50
+VK_DISJOINT_PROPERTIES=195
+VT_HEDGE_VERY=62
+VT_NEXISTS=66
+VK_BOOL=173
+VK_EXTENDS=219
+VT_NESTED_PATTERN=72
+VK_POINT=293
+VK_TEMPLATE=323
+VK_EQUIVALENTTO=211
+VT_ACC_ITER_ACT=106
+VK_ORDERBY=287
+VK_EXCLUDES=215
+VK_SOUNDSLIKE=316
+UnicodeEscape=434
+VT_DECLARATION_SECTION=9
+VT_SQUARE_CHUNK=49
+VT_TEMPLATE_ID=23
+VK_DATE_EFFECTIVE=347
+LEFT_SQUARE=409
+VT_DATA_TYPE=12
+VK_CHAR=178
+MOD=386
+VK_FUNCTION=227
+VT_EXISTS=64
+VT_METHOD=84
+VK_SALIENCE=309
+VK_SEQ=313
+DOUBLE_DOT=370
+VK_NO=269
+EOL=424
+VK_MODIFY=262
+NOT_EQUAL=388
+VK_ACTION=161
+VT_ANNOTATIONS=113
+VT_EQUIV=60
+VK_SOME=315
+VK_MEMBEROF=260
+VK_AUTO=171
+VK_OR=286
+VT_VERSION=81
+VT_OTHERWISE=88
+VT_OR=57
+VK_ON=282
+VT_ATTRIBUTES=34
+IntegerTypeSuffix=414
+MINUS_ASSIGN=400
+BOOL=421
+VK_EVENT=213
+VK_EFFECTIVE=202
+SEMICOLON=393
+VK_THEN=325
+VT_EXTENDS=28
+VK_RULEFLOW_GROUP=353
+VK_ROLE=306
+VK_RESULT=301
+WS=433
+VK_ACTIVATION=162
+VK_ENTITY=205
+VK_NO_LOOP=349
+DOUBLE_COLON=368
+LEFT_CURLY=411
+VK_COUNT=185
+VT_FACT=128
+LEFT_PAREN=407
+PERCENT_GREATER=389
+VT_RULE_ID=33
+VT_LIST=94
+VK_ONLY=284
+C_STYLE_SINGLE_LINE_COMMENT=425
+VK_VOID=341
+VT_FACTS=127
+VK_ACCUMULATE=159
+VK_OVER=289
+VK_EXTEND=218
+VK_EQUIVALENT_PROPERTIES=210
+VK_SELF=312
+VK_LOCK=248
+VK_SAME_INDIVIDUAL=310
+VT_IRI=111
+VK_VALUE=339
+VK_A_TIMER=156
+VK_OA_MISSING=279
+VT_ACCUMULATE_FUNCTION=104
+CHAIN_SEP=359
+VT_ARGS=53
+SLASH=394
+VT_EXPRESSION_CHAIN=100
+VK_A_SALIENCE=155
+VK_DATATYPE=186
+VT_SAMEAS=130
+VK_TIME=328
+VK_SUBCLASSOF=318
+PIPE=390
+VK_A_DATE_EFFECTIVE=142
+VT_VALUE=70
+VK_A_AUTOFOCUS=140
+VT_ENTRYPOINT=97
+VK_MOL=264
+VT_KEYS=115
+VK_COLLECT_LIST=183
+VK_NOT=270
+VT_ENTRYPOINT_ID=98
+VK_DECLARE=188
+VK_TYPE_BOOLEAN=331
+VT_SUBPROPERTYCHAIN=125
+VK_DIFFERENT_INDIVIDUALS=191
+VT_ARROW=37
+VT_TYPE_DECLARE_ID=27
+VT_EQV_CLASS=132
+VK_EQUIVALENT_CLASSES=209
+VT_BINDING=79
+VK_LENGTH_MIN=246
+VK_LOCK_ON_ACTIVE=346
+VK_MDA_REFLEXIVE_INV=256
+VT_DIFFERENTFROM=131
+VK_THIS=326
+VK_ALL=165
+MULTI_LINE_COMMENT=426
+VK_A_ACTGROUP=138
+DECIMAL=416
+VK_ATTRIBUTES=170
+VT_DIF_CLASS=133
+VT_MSR=54
+VK_ENTRYPOINT=207
+VK_HASKEY=230
+PLUS_ASSIGN=399
+VK_PATTERN_LANG=292
+VK_ACTIVE=163
+VT_EQV_PROP=134
+VK_OA_ID=276
+VK_MDA_FUNCTIONAL=253
+OctalEscape=435
+VK_RULEFLOW=308
+STRING=423
+VT_ONTOLOGY_SECTION=8
+VK_ANOTHER=168
+VK_DIFFERENTFROM=192
+VK_LOOP=250
+VT_DOMAIN=126
+DOT_STAR=363
+VK_ENTRY=206
+VK_AND=166
+VK_UNIQUE=337
+VK_A_LOCKONACTIVE=152
+DIV_ASSIGN=402
+VK_A_DIRECTION_ABDUCTIVE=146
+VT_FUNCTION_IMPORT=15
+VK_LONG=249
+VK_PATTERN=291
+VK_DATE=187
+DOUBLE_AMPER=364
+VT_AND=61
+DOUBLE_SQUARE_LEFT=375
+VK_PREFIX=294
+VT_DL_RESTRICTED_TYPE=118
+VT_SLOT=24
+VT_SUBCLASSOF=120
+VK_FROM=226
+VK_PROPERTY_DATA=297
+VT_EQV_INDV=136
+VT_DISJOINTUNIONOF=122
+VT_PACKAGE=6
+VK_OA_MERGE=278
+VT_TYPE_DECLARE=26
+VT_POSITIONAL_SKIP=78
+IdentifierStart=427
+VK_INT=239
+VK_ONCHANGE=283
+VT_NEG_BRANCH_LABEL=44
+VT_FORALL=65
+VT_RHS_CHUNK=47
+VK_VERY=340
+VK_FALLING=221
+VK_SUBPROPERTYCHAIN=319
+VK_ENTRY_POINT=354
+VK_INSERT=236
+VK_CALENDARS=177
+VK_IN=233
+VK_RANGE=300
+LESS_EQUAL=384
+VT_DL_DEFINITION=29
+VK_EXPIRES=217
+MISC=432
+EscapeSequence=422
+VK_DEFEATS=189
+VK_PACKAGE=290
+VK_MATCHES=251
+RIGHT_CURLY=412
+VK_TYPE_FLOAT=333
+VK_A_ENABLED=150
+VK_DISJOINT_CLASSES=194
+VK_JAVA=242
+MULT_ASSIGN=401
+VK_TYPE_INTEGER=334
+VT_FIELD=31
+VK_PROPERTY_OBJECT=298
+VT_SEQUENCE=91
+Exponent=418
+VT_POSITIONAL_CONST=76
+AND_ASSIGN=403
+VK_TIMER=329
+VK_CHARACTERISTICS=179
+VT_IMPLIES=56
+AMPER=356
+VT_FALLING_EDGE=46
+VK_SHORT=314
+TILDE=395
+DOUBLE_CAP=367
+VT_BEHAVIOR=96
+VT_RULEBASE_SECTION=10
+VT_INVERSEOF=124
+DOT=362
+VK_WINDOW=343
+IdentifierPart=428
+VT_DIM_SIZE=13
+VK_A_CALENDAR=141
+XOR=398
+VK_CONTAINS=184
+VK_FACTS=220
+VT_COUNT=67
+VK_INVERSEOF=241
+VK_FLOAT=223
+VK_LENGTH_MAX=245
+VT_DIF_INDV=137
+VK_DURATION=201
+VK_OTHERWISE=288
+VK_THAT=324
+VK_FORALL=225
+VK_DO=198
+VK_UPDATE=338
+VT_CURLY_CHUNK=48
+VT_DEBUG_LEFT_EXPR=86
+VK_A_DEDUCTION=144
+VT_RANGE=95
+VK_NAMESPACE=266
+VT_POSITIONAL_INDEX=77
+VK_ONTOLOGY=285
+TIMES=396
+VK_MDA_REFLEXIVE=255
+VK_INIT=235
+VK_OA_OTHERWISE=280
+VK_A_DIRECTION_DEDUCTIVE=147
Added: labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/ParserHelper.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/ParserHelper.java (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/java/org/drools/lang/ParserHelper.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,331 @@
+package org.drools.lang;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+
+import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.RecognizerSharedState;
+import org.antlr.runtime.Token;
+import org.antlr.runtime.TokenStream;
+import org.drools.compiler.DroolsParserException;
+
+import static org.drools.lang.DRLv6Parser.*;
+
+/**
+ * This is a class to hold all the helper functions/methods used
+ * by the DRL parser
+ */
+public class ParserHelper {
+ public List<DroolsParserException> errors = new ArrayList<DroolsParserException>();
+ public LinkedList<DroolsSentence> editorInterface = null;
+ public boolean isEditorInterfaceEnabled = false;
+ public boolean lookaheadTest = false;
+ private Stack<Map<DroolsParaphraseTypes, String>> paraphrases = new Stack<Map<DroolsParaphraseTypes, String>>();
+
+ // parameters from parser
+ private DRLv6Parser parser = null;
+ private DroolsParserExceptionFactory errorMessageFactory = null;
+ private TokenStream input = null;
+ private RecognizerSharedState state = null;
+
+ public ParserHelper(DRLv6Parser parser,
+ String[] tokenNames,
+ TokenStream input,
+ RecognizerSharedState state) {
+ this.parser = parser;
+ this.errorMessageFactory = new DroolsParserExceptionFactory( tokenNames,
+ paraphrases );
+ this.input = input;
+ this.state = state;
+ }
+
+ public LinkedList<DroolsSentence> getEditorInterface() {
+ return editorInterface;
+ }
+
+ public void enableEditorInterface() {
+ isEditorInterfaceEnabled = true;
+ }
+
+ public void disableEditorInterface() {
+ isEditorInterfaceEnabled = false;
+ }
+
+ public void beginSentence(DroolsSentenceType sentenceType) {
+ if ( isEditorInterfaceEnabled ) {
+ if ( null == editorInterface ) {
+ editorInterface = new LinkedList<DroolsSentence>();
+ }
+ DroolsSentence sentence = new DroolsSentence();
+ sentence.setType( sentenceType );
+ editorInterface.add( sentence );
+ }
+ }
+
+ public DroolsSentence getActiveSentence() {
+ return editorInterface.getLast();
+ }
+
+ public void emit(List< ? > tokens,
+ DroolsEditorType editorType) {
+ if ( isEditorInterfaceEnabled && tokens != null ) {
+ for ( Object activeObject : tokens ) {
+ emit( (Token) activeObject,
+ editorType );
+ }
+ }
+ }
+
+ public void emit(Token token,
+ DroolsEditorType editorType) {
+ if ( isEditorInterfaceEnabled && token != null ) {
+ ((DroolsToken) token).setEditorType( editorType );
+ getActiveSentence().addContent( (DroolsToken) token );
+ }
+ }
+
+ public void emit(boolean forceEmit,
+ int activeContext) {
+ if ( isEditorInterfaceEnabled ) {
+ getActiveSentence().addContent( activeContext );
+ }
+ }
+
+ public void emit(int activeContext) {
+ if ( isEditorInterfaceEnabled ) {
+ emit( false,
+ activeContext );
+ }
+ }
+
+ public DroolsToken getLastTokenOnList(LinkedList< ? > list) {
+ DroolsToken lastToken = null;
+ for ( Object object : list ) {
+ if ( object instanceof DroolsToken ) {
+ lastToken = (DroolsToken) object;
+ }
+ }
+ return lastToken;
+ }
+
+ public int getLastIntegerValue(LinkedList< ? > list) {
+ int lastIntergerValue = -1;
+ for ( Object object : list ) {
+ if ( object instanceof Integer ) {
+ lastIntergerValue = (Integer) object;
+ }
+ }
+ return lastIntergerValue;
+ }
+
+ public String retrieveLT(int LTNumber) {
+ if ( null == input ) return null;
+ if ( null == input.LT( LTNumber ) ) return null;
+ if ( null == input.LT( LTNumber ).getText() ) return null;
+
+ return input.LT( LTNumber ).getText();
+ }
+
+ public boolean validateLT(int LTNumber,
+ String text) {
+ String text2Validate = retrieveLT( LTNumber );
+ boolean ans = text2Validate == null ? false : text2Validate.equalsIgnoreCase( text );
+ return ans;
+
+ }
+
+ public boolean isPluggableEvaluator(int offset,
+ boolean negated) {
+ String text2Validate = retrieveLT( offset );
+ return text2Validate == null ? false : DroolsSoftKeywords.isOperator( text2Validate,
+ negated );
+ }
+
+ public boolean isPluggableEvaluator(boolean negated) {
+ return isPluggableEvaluator( 1,
+ negated );
+ }
+
+ public boolean validateIdentifierKey(String text) {
+ return validateLT( 1,
+ text );
+ }
+
+ public boolean validateSpecialID(int index) {
+ return validateLT( index,
+ DroolsSoftKeywords.THIS ) ||
+ validateLT( index,
+ DroolsSoftKeywords.SUPER ) ||
+ validateLT( index,
+ DroolsSoftKeywords.NEW ) ||
+ validateLT( index,
+ DroolsSoftKeywords.CLASS );
+
+ }
+
+ public boolean validateIdentifierSufix() {
+ return validateLT( 1,
+ "[" ) || validateLT( 1,
+ "(" ) || validateLT( 1,
+ "<" ) || (validateLT( 1,
+ "." ) && validateSpecialID( 2 ));
+ }
+
+ public void checkTrailingSemicolon(String text,
+ Token token) {
+ if ( text.trim().endsWith( ";" ) ) {
+ errors.add( errorMessageFactory
+ .createTrailingSemicolonException( ((DroolsToken) token)
+ .getLine(),
+ ((DroolsToken) token)
+ .getCharPositionInLine(),
+ ((DroolsToken) token)
+ .getStopIndex() ) );
+ }
+ }
+
+ public boolean validateNotWithBinding() {
+ if ( input.LA( 1 ) == ID && input.LA( 2 ) == ID && input.LA( 3 ) == COLON ) {
+ return true;
+ }
+ return false;
+ }
+
+// public boolean validateRestr() {
+// int lookahead = 2;
+// int countParen = 1;
+//
+// while ( true ) {
+// if ( input.LA( lookahead ) == COMMA ) {
+// break;
+// } else if ( input.LA( lookahead ) == LEFT_PAREN ) {
+// countParen++;
+// } else if ( input.LA( lookahead ) == RIGHT_PAREN ) {
+// countParen--;
+// } else if ( input.LA( lookahead ) == EOF ) {
+// break;
+// }
+// if ( countParen == 0 ) {
+// break;
+// }
+// lookahead++;
+// }
+//
+// boolean returnValue = false;
+// int activeIndex = input.index();
+// lookaheadTest = true;
+// try {
+// input.seek( input.LT( 2 ).getTokenIndex() );
+// parser.constraint_expression();
+// returnValue = true;
+// } catch ( RecognitionException e ) {
+// } finally {
+// input.seek( activeIndex );
+// }
+// lookaheadTest = false;
+//
+// return returnValue;
+// }
+
+ public String safeSubstring(String text,
+ int start,
+ int end) {
+ return text.substring( Math.min( start,
+ text.length() ),
+ Math.min( Math
+ .max( start,
+ end ),
+ text.length() ) );
+ }
+
+ public void reportError(RecognitionException ex) {
+ // if we've already reported an error and have not matched a token
+ // yet successfully, don't report any errors.
+ if ( state.errorRecovery ) {
+ return;
+ }
+ state.errorRecovery = true;
+
+ errors.add( errorMessageFactory.createDroolsException( ex ) );
+ }
+
+ /** return the raw DroolsParserException errors */
+ public List<DroolsParserException> getErrors() {
+ return errors;
+ }
+
+ /** Return a list of pretty strings summarising the errors */
+ public List<String> getErrorMessages() {
+ List<String> messages = new ArrayList<String>( errors.size() );
+
+ for ( DroolsParserException activeException : errors ) {
+ messages.add( activeException.getMessage() );
+ }
+
+ return messages;
+ }
+
+ /** return true if any parser errors were accumulated */
+ public boolean hasErrors() {
+ return !errors.isEmpty();
+ }
+
+ /**
+ * Method that adds a paraphrase type into paraphrases stack.
+ *
+ * @param type
+ * paraphrase type
+ */
+ public void pushParaphrases(DroolsParaphraseTypes type) {
+ Map<DroolsParaphraseTypes, String> activeMap = new HashMap<DroolsParaphraseTypes, String>();
+ activeMap.put( type,
+ "" );
+ paraphrases.push( activeMap );
+ }
+
+ public Map<DroolsParaphraseTypes, String> popParaphrases() {
+ return paraphrases.pop();
+ }
+
+ /**
+ * Method that sets paraphrase value for a type into paraphrases stack.
+ *
+ * @param type
+ * paraphrase type
+ * @param value
+ * paraphrase value
+ */
+ public void setParaphrasesValue(DroolsParaphraseTypes type,
+ String value) {
+ paraphrases.peek().put( type,
+ value );
+ }
+
+ /**
+ * Helper method that creates a string from a token list.
+ *
+ * @param tokenList
+ * token list
+ * @return string
+ */
+ public String buildStringFromTokens(List<Token> tokenList) {
+ StringBuilder sb = new StringBuilder();
+ if ( null != tokenList ) {
+ for ( Token activeToken : tokenList ) {
+ if ( null != activeToken ) {
+ sb.append( activeToken.getText() );
+ }
+ }
+ }
+ return sb.toString();
+ }
+
+ /** Overrided this method to not output mesages */
+ public void emitErrorMessage(String msg) {
+ }
+
+}
Added: labs/jbossrules/branches/DRLv6/src/main/resources/DRLLexer.g.off
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/resources/DRLLexer.g.off (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/resources/DRLLexer.g.off 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,1132 @@
+lexer grammar DRLLexer;
+
+tokens {
+ VT_COMPILATION_UNIT;
+ VT_FUNCTION_IMPORT;
+
+ VT_FACT;
+ VT_CONSTRAINTS;
+ VT_LABEL;
+
+ VT_QUERY_ID;
+ VT_TEMPLATE_ID;
+ VT_TYPE_DECLARE_ID;
+ VT_RULE_ID;
+ VT_ENTRYPOINT_ID;
+ VT_SLOT_ID;
+
+ VT_SLOT;
+ VT_RULE_ATTRIBUTES;
+
+ VT_RHS_CHUNK;
+ VT_CURLY_CHUNK;
+ VT_SQUARE_CHUNK;
+ VT_PAREN_CHUNK;
+ VT_BEHAVIOR;
+
+ VT_AND_IMPLICIT;
+ VT_AND_PREFIX;
+ VT_OR_PREFIX;
+ VT_AND_INFIX;
+ VT_OR_INFIX;
+
+ VT_ACCUMULATE_INIT_CLAUSE;
+ VT_ACCUMULATE_ID_CLAUSE;
+ VT_FROM_SOURCE;
+ VT_EXPRESSION_CHAIN;
+
+ VT_PATTERN;
+ VT_FACT_BINDING;
+ VT_FACT_OR;
+ VT_BIND_FIELD;
+ VT_FIELD;
+
+ VT_ACCESSOR_PATH;
+ VT_ACCESSOR_ELEMENT;
+
+ VT_DATA_TYPE;
+ VT_PATTERN_TYPE;
+ VT_PACKAGE_ID;
+ VT_IMPORT_ID;
+ VT_GLOBAL_ID;
+ VT_FUNCTION_ID;
+ VT_PARAM_LIST;
+
+ VK_DATE_EFFECTIVE;
+ VK_DATE_EXPIRES;
+ VK_LOCK_ON_ACTIVE;
+ VK_NO_LOOP;
+ VK_AUTO_FOCUS;
+ VK_ACTIVATION_GROUP;
+ VK_AGENDA_GROUP;
+ VK_RULEFLOW_GROUP;
+ VK_TIMER;
+ VK_CALENDARS;
+ VK_DIALECT;
+ VK_SALIENCE;
+ VK_ENABLED;
+ VK_ATTRIBUTES;
+ VK_RULE;
+ VK_EXTEND;
+ VK_IMPORT;
+ VK_PACKAGE;
+ VK_TEMPLATE;
+ VK_QUERY;
+ VK_DECLARE;
+ VK_FUNCTION;
+ VK_GLOBAL;
+ VK_EVAL;
+ VK_ENTRY_POINT;
+ VK_NOT;
+ VK_IN;
+ VK_OR;
+ VK_AND;
+ VK_EXISTS;
+ VK_FORALL;
+ VK_ACTION;
+ VK_REVERSE;
+ VK_RESULT;
+ VK_OPERATOR;
+ VK_END;
+ VK_INIT;
+ VK_INSTANCEOF;
+ VK_EXTENDS;
+ VK_SUPER;
+ VK_PRIMITIVE_TYPE;
+ VK_THIS;
+ VK_VOID;
+ VK_CLASS;
+ VK_NEW;
+}
+
+ at header {
+ package org.drools.lang;
+
+ import org.drools.compiler.DroolsParserException;
+}
+
+ at members {
+ private List<DroolsParserException> errors = new ArrayList<DroolsParserException>();
+ private DroolsParserExceptionFactory errorMessageFactory = new DroolsParserExceptionFactory(null, null);
+
+ /** The standard method called to automatically emit a token at the
+ * outermost lexical rule. The token object should point into the
+ * char buffer start..stop. If there is a text override in 'text',
+ * use that to set the token's text. Override this method to emit
+ * custom Token objects.
+ */
+ public Token emit() {
+ Token t = new DroolsToken(input, state.type, state.channel, state.tokenStartCharIndex, getCharIndex()-1);
+ t.setLine(state.tokenStartLine);
+ t.setText(state.text);
+ t.setCharPositionInLine(state.tokenStartCharPositionInLine);
+ emit(t);
+ return t;
+ }
+
+ public void reportError(RecognitionException ex) {
+ errors.add(errorMessageFactory.createDroolsException(ex));
+ }
+
+ /** return the raw DroolsParserException errors */
+ public List<DroolsParserException> getErrors() {
+ return errors;
+ }
+
+ /** Overrided this method to not output mesages */
+ public void emitErrorMessage(String msg) {
+ }
+}
+
+// --------------------------------------------------------
+// LEXER
+// --------------------------------------------------------
+WS : ( ' '
+ | '\t'
+ | '\f'
+ | EOL
+ )+
+ { $channel=HIDDEN; }
+ ;
+
+fragment
+EOL :
+ ( ( '\r\n' )=> '\r\n' // Evil DOS
+ | '\r' // Macintosh
+ | '\n' // Unix (the right way)
+ )
+ ;
+
+HEX : '0' ('x'|'X') HexDigit+ IntegerTypeSuffix? ;
+
+DECIMAL : ('0' | '1'..'9' '0'..'9'*) IntegerTypeSuffix? ;
+
+OCTAL : '0' ('0'..'7')+ IntegerTypeSuffix? ;
+
+fragment
+IntegerTypeSuffix : ('l'|'L') ;
+
+FLOAT
+ : ('0'..'9')+ '.' ('0'..'9')* Exponent? FloatTypeSuffix?
+ | '.' ('0'..'9')+ Exponent? FloatTypeSuffix?
+ | ('0'..'9')+ Exponent FloatTypeSuffix?
+ | ('0'..'9')+ FloatTypeSuffix
+ ;
+
+fragment
+Exponent : ('e'|'E') ('+'|'-')? ('0'..'9')+ ;
+
+fragment
+FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
+
+STRING
+ : ('"' ( EscapeSequence | ~('\\'|'"') )* '"')
+ | ('\'' ( EscapeSequence | ~('\\'|'\'') )* '\'')
+ ;
+
+fragment
+HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
+
+fragment
+EscapeSequence
+ : '\\' ('b'|'B'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\'|'.'|'o'|
+ 'x'|'a'|'e'|'c'|'d'|'D'|'s'|'S'|'w'|'W'|'p'|'A'|
+ 'G'|'Z'|'z'|'Q'|'E'|'*'|'['|']'|'('|')'|'$'|'^'|
+ '{'|'}'|'?'|'+'|'-'|'&'|'|')
+ | UnicodeEscape
+ | OctalEscape
+ ;
+
+fragment
+OctalEscape
+ : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7')
+ ;
+
+fragment
+UnicodeEscape
+ : '\\' 'u' HexDigit HexDigit HexDigit HexDigit
+ ;
+
+BOOL
+ : ('true'|'false')
+ ;
+
+ACCUMULATE
+ : 'accumulate'
+ ;
+
+COLLECT
+ : 'collect'
+ ;
+
+FROM
+ : 'from'
+ ;
+
+NULL
+ : 'null'
+ ;
+
+OVER
+ : 'over'
+ ;
+
+THEN
+ : 'then'
+ ;
+
+WHEN
+ : 'when'
+ ;
+
+AT : '@'
+ ;
+
+SHIFT_RIGHT
+ : '>>'
+ ;
+
+SHIFT_LEFT
+ : '<<'
+ ;
+
+SHIFT_RIGHT_UNSIG
+ : '>>>'
+ ;
+
+PLUS_ASSIGN
+ : '+='
+ ;
+
+MINUS_ASSIGN
+ : '-='
+ ;
+
+MULT_ASSIGN
+ : '*='
+ ;
+
+DIV_ASSIGN
+ : '/='
+ ;
+
+AND_ASSIGN
+ : '&='
+ ;
+
+OR_ASSIGN
+ : '|='
+ ;
+
+XOR_ASSIGN
+ : '^='
+ ;
+
+MOD_ASSIGN
+ : '%='
+ ;
+
+DECR : '--'
+ ;
+
+INCR : '++'
+ ;
+
+ARROW
+ : '->'
+ ;
+
+SEMICOLON
+ : ';'
+ ;
+
+DOT_STAR
+ : '.*'
+ ;
+
+COLON
+ : ':'
+ ;
+
+EQUALS
+ : '=='
+ ;
+
+NOT_EQUALS
+ : '!='
+ ;
+
+GREATER_EQUALS
+ : '>='
+ ;
+
+LESS_EQUALS
+ : '<='
+ ;
+
+GREATER
+ : '>'
+ ;
+
+LESS
+ : '<'
+ ;
+
+EQUALS_ASSIGN
+ : '='
+ ;
+
+LEFT_PAREN
+ : '('
+ ;
+
+RIGHT_PAREN
+ : ')'
+ ;
+
+LEFT_SQUARE
+ : '['
+ ;
+
+RIGHT_SQUARE
+ : ']'
+ ;
+
+LEFT_CURLY
+ : '{'
+ ;
+
+RIGHT_CURLY
+ : '}'
+ ;
+
+COMMA : ','
+ ;
+
+DOT : '.'
+ ;
+
+DOUBLE_AMPER
+ : '&&'
+ ;
+
+DOUBLE_PIPE
+ : '||'
+ ;
+
+QUESTION
+ : '?'
+ ;
+
+NEGATION
+ : '!'
+ ;
+
+TILDE
+ : '~'
+ ;
+
+PIPE
+ : '|'
+ ;
+
+AMPER
+ : '&'
+ ;
+
+XOR
+ : '^'
+ ;
+
+MOD
+ : '%'
+ ;
+
+STAR : '*'
+ ;
+
+MINUS : '-'
+ ;
+
+PLUS : '+'
+ ;
+
+DIV : '/'
+ ;
+
+SH_STYLE_SINGLE_LINE_COMMENT
+ : '#' (~('\r'|'\n'))* EOL?
+ { $channel=HIDDEN; setText("//"+getText().substring(1));}
+ ;
+
+
+C_STYLE_SINGLE_LINE_COMMENT
+ : '//' (~('\r'|'\n'))* EOL?
+ { $channel=HIDDEN; }
+ ;
+
+MULTI_LINE_COMMENT
+ : '/*' (options{greedy=false;} : .)* '*/'
+ { $channel=HIDDEN; }
+ ;
+
+ID
+ : IdentifierStart IdentifierPart*
+ | '`' IdentifierStart IdentifierPart* '`'
+ { state.text = $text.substring(1, $text.length() - 1); }
+ ;
+
+MISC :
+ '!' | '\'' | '\\' | '$'
+ ;
+
+fragment
+IdentifierStart
+ : '\u0024'
+ | '\u0041'..'\u005a'
+ | '\u005f'
+ | '\u0061'..'\u007a'
+ | '\u00a2'..'\u00a5'
+ | '\u00aa'
+ | '\u00b5'
+ | '\u00ba'
+ | '\u00c0'..'\u00d6'
+ | '\u00d8'..'\u00f6'
+ | '\u00f8'..'\u0236'
+ | '\u0250'..'\u02c1'
+ | '\u02c6'..'\u02d1'
+ | '\u02e0'..'\u02e4'
+ | '\u02ee'
+ | '\u037a'
+ | '\u0386'
+ | '\u0388'..'\u038a'
+ | '\u038c'
+ | '\u038e'..'\u03a1'
+ | '\u03a3'..'\u03ce'
+ | '\u03d0'..'\u03f5'
+ | '\u03f7'..'\u03fb'
+ | '\u0400'..'\u0481'
+ | '\u048a'..'\u04ce'
+ | '\u04d0'..'\u04f5'
+ | '\u04f8'..'\u04f9'
+ | '\u0500'..'\u050f'
+ | '\u0531'..'\u0556'
+ | '\u0559'
+ | '\u0561'..'\u0587'
+ | '\u05d0'..'\u05ea'
+ | '\u05f0'..'\u05f2'
+ | '\u0621'..'\u063a'
+ | '\u0640'..'\u064a'
+ | '\u066e'..'\u066f'
+ | '\u0671'..'\u06d3'
+ | '\u06d5'
+ | '\u06e5'..'\u06e6'
+ | '\u06ee'..'\u06ef'
+ | '\u06fa'..'\u06fc'
+ | '\u06ff'
+ | '\u0710'
+ | '\u0712'..'\u072f'
+ | '\u074d'..'\u074f'
+ | '\u0780'..'\u07a5'
+ | '\u07b1'
+ | '\u0904'..'\u0939'
+ | '\u093d'
+ | '\u0950'
+ | '\u0958'..'\u0961'
+ | '\u0985'..'\u098c'
+ | '\u098f'..'\u0990'
+ | '\u0993'..'\u09a8'
+ | '\u09aa'..'\u09b0'
+ | '\u09b2'
+ | '\u09b6'..'\u09b9'
+ | '\u09bd'
+ | '\u09dc'..'\u09dd'
+ | '\u09df'..'\u09e1'
+ | '\u09f0'..'\u09f3'
+ | '\u0a05'..'\u0a0a'
+ | '\u0a0f'..'\u0a10'
+ | '\u0a13'..'\u0a28'
+ | '\u0a2a'..'\u0a30'
+ | '\u0a32'..'\u0a33'
+ | '\u0a35'..'\u0a36'
+ | '\u0a38'..'\u0a39'
+ | '\u0a59'..'\u0a5c'
+ | '\u0a5e'
+ | '\u0a72'..'\u0a74'
+ | '\u0a85'..'\u0a8d'
+ | '\u0a8f'..'\u0a91'
+ | '\u0a93'..'\u0aa8'
+ | '\u0aaa'..'\u0ab0'
+ | '\u0ab2'..'\u0ab3'
+ | '\u0ab5'..'\u0ab9'
+ | '\u0abd'
+ | '\u0ad0'
+ | '\u0ae0'..'\u0ae1'
+ | '\u0af1'
+ | '\u0b05'..'\u0b0c'
+ | '\u0b0f'..'\u0b10'
+ | '\u0b13'..'\u0b28'
+ | '\u0b2a'..'\u0b30'
+ | '\u0b32'..'\u0b33'
+ | '\u0b35'..'\u0b39'
+ | '\u0b3d'
+ | '\u0b5c'..'\u0b5d'
+ | '\u0b5f'..'\u0b61'
+ | '\u0b71'
+ | '\u0b83'
+ | '\u0b85'..'\u0b8a'
+ | '\u0b8e'..'\u0b90'
+ | '\u0b92'..'\u0b95'
+ | '\u0b99'..'\u0b9a'
+ | '\u0b9c'
+ | '\u0b9e'..'\u0b9f'
+ | '\u0ba3'..'\u0ba4'
+ | '\u0ba8'..'\u0baa'
+ | '\u0bae'..'\u0bb5'
+ | '\u0bb7'..'\u0bb9'
+ | '\u0bf9'
+ | '\u0c05'..'\u0c0c'
+ | '\u0c0e'..'\u0c10'
+ | '\u0c12'..'\u0c28'
+ | '\u0c2a'..'\u0c33'
+ | '\u0c35'..'\u0c39'
+ | '\u0c60'..'\u0c61'
+ | '\u0c85'..'\u0c8c'
+ | '\u0c8e'..'\u0c90'
+ | '\u0c92'..'\u0ca8'
+ | '\u0caa'..'\u0cb3'
+ | '\u0cb5'..'\u0cb9'
+ | '\u0cbd'
+ | '\u0cde'
+ | '\u0ce0'..'\u0ce1'
+ | '\u0d05'..'\u0d0c'
+ | '\u0d0e'..'\u0d10'
+ | '\u0d12'..'\u0d28'
+ | '\u0d2a'..'\u0d39'
+ | '\u0d60'..'\u0d61'
+ | '\u0d85'..'\u0d96'
+ | '\u0d9a'..'\u0db1'
+ | '\u0db3'..'\u0dbb'
+ | '\u0dbd'
+ | '\u0dc0'..'\u0dc6'
+ | '\u0e01'..'\u0e30'
+ | '\u0e32'..'\u0e33'
+ | '\u0e3f'..'\u0e46'
+ | '\u0e81'..'\u0e82'
+ | '\u0e84'
+ | '\u0e87'..'\u0e88'
+ | '\u0e8a'
+ | '\u0e8d'
+ | '\u0e94'..'\u0e97'
+ | '\u0e99'..'\u0e9f'
+ | '\u0ea1'..'\u0ea3'
+ | '\u0ea5'
+ | '\u0ea7'
+ | '\u0eaa'..'\u0eab'
+ | '\u0ead'..'\u0eb0'
+ | '\u0eb2'..'\u0eb3'
+ | '\u0ebd'
+ | '\u0ec0'..'\u0ec4'
+ | '\u0ec6'
+ | '\u0edc'..'\u0edd'
+ | '\u0f00'
+ | '\u0f40'..'\u0f47'
+ | '\u0f49'..'\u0f6a'
+ | '\u0f88'..'\u0f8b'
+ | '\u1000'..'\u1021'
+ | '\u1023'..'\u1027'
+ | '\u1029'..'\u102a'
+ | '\u1050'..'\u1055'
+ | '\u10a0'..'\u10c5'
+ | '\u10d0'..'\u10f8'
+ | '\u1100'..'\u1159'
+ | '\u115f'..'\u11a2'
+ | '\u11a8'..'\u11f9'
+ | '\u1200'..'\u1206'
+ | '\u1208'..'\u1246'
+ | '\u1248'
+ | '\u124a'..'\u124d'
+ | '\u1250'..'\u1256'
+ | '\u1258'
+ | '\u125a'..'\u125d'
+ | '\u1260'..'\u1286'
+ | '\u1288'
+ | '\u128a'..'\u128d'
+ | '\u1290'..'\u12ae'
+ | '\u12b0'
+ | '\u12b2'..'\u12b5'
+ | '\u12b8'..'\u12be'
+ | '\u12c0'
+ | '\u12c2'..'\u12c5'
+ | '\u12c8'..'\u12ce'
+ | '\u12d0'..'\u12d6'
+ | '\u12d8'..'\u12ee'
+ | '\u12f0'..'\u130e'
+ | '\u1310'
+ | '\u1312'..'\u1315'
+ | '\u1318'..'\u131e'
+ | '\u1320'..'\u1346'
+ | '\u1348'..'\u135a'
+ | '\u13a0'..'\u13f4'
+ | '\u1401'..'\u166c'
+ | '\u166f'..'\u1676'
+ | '\u1681'..'\u169a'
+ | '\u16a0'..'\u16ea'
+ | '\u16ee'..'\u16f0'
+ | '\u1700'..'\u170c'
+ | '\u170e'..'\u1711'
+ | '\u1720'..'\u1731'
+ | '\u1740'..'\u1751'
+ | '\u1760'..'\u176c'
+ | '\u176e'..'\u1770'
+ | '\u1780'..'\u17b3'
+ | '\u17d7'
+ | '\u17db'..'\u17dc'
+ | '\u1820'..'\u1877'
+ | '\u1880'..'\u18a8'
+ | '\u1900'..'\u191c'
+ | '\u1950'..'\u196d'
+ | '\u1970'..'\u1974'
+ | '\u1d00'..'\u1d6b'
+ | '\u1e00'..'\u1e9b'
+ | '\u1ea0'..'\u1ef9'
+ | '\u1f00'..'\u1f15'
+ | '\u1f18'..'\u1f1d'
+ | '\u1f20'..'\u1f45'
+ | '\u1f48'..'\u1f4d'
+ | '\u1f50'..'\u1f57'
+ | '\u1f59'
+ | '\u1f5b'
+ | '\u1f5d'
+ | '\u1f5f'..'\u1f7d'
+ | '\u1f80'..'\u1fb4'
+ | '\u1fb6'..'\u1fbc'
+ | '\u1fbe'
+ | '\u1fc2'..'\u1fc4'
+ | '\u1fc6'..'\u1fcc'
+ | '\u1fd0'..'\u1fd3'
+ | '\u1fd6'..'\u1fdb'
+ | '\u1fe0'..'\u1fec'
+ | '\u1ff2'..'\u1ff4'
+ | '\u1ff6'..'\u1ffc'
+ | '\u203f'..'\u2040'
+ | '\u2054'
+ | '\u2071'
+ | '\u207f'
+ | '\u20a0'..'\u20b1'
+ | '\u2102'
+ | '\u2107'
+ | '\u210a'..'\u2113'
+ | '\u2115'
+ | '\u2119'..'\u211d'
+ | '\u2124'
+ | '\u2126'
+ | '\u2128'
+ | '\u212a'..'\u212d'
+ | '\u212f'..'\u2131'
+ | '\u2133'..'\u2139'
+ | '\u213d'..'\u213f'
+ | '\u2145'..'\u2149'
+ | '\u2160'..'\u2183'
+ | '\u3005'..'\u3007'
+ | '\u3021'..'\u3029'
+ | '\u3031'..'\u3035'
+ | '\u3038'..'\u303c'
+ | '\u3041'..'\u3096'
+ | '\u309d'..'\u309f'
+ | '\u30a1'..'\u30ff'
+ | '\u3105'..'\u312c'
+ | '\u3131'..'\u318e'
+ | '\u31a0'..'\u31b7'
+ | '\u31f0'..'\u31ff'
+ | '\u3400'..'\u4db5'
+ | '\u4e00'..'\u9fa5'
+ | '\ua000'..'\ua48c'
+ | '\uac00'..'\ud7a3'
+ | '\uf900'..'\ufa2d'
+ | '\ufa30'..'\ufa6a'
+ | '\ufb00'..'\ufb06'
+ | '\ufb13'..'\ufb17'
+ | '\ufb1d'
+ | '\ufb1f'..'\ufb28'
+ | '\ufb2a'..'\ufb36'
+ | '\ufb38'..'\ufb3c'
+ | '\ufb3e'
+ | '\ufb40'..'\ufb41'
+ | '\ufb43'..'\ufb44'
+ | '\ufb46'..'\ufbb1'
+ | '\ufbd3'..'\ufd3d'
+ | '\ufd50'..'\ufd8f'
+ | '\ufd92'..'\ufdc7'
+ | '\ufdf0'..'\ufdfc'
+ | '\ufe33'..'\ufe34'
+ | '\ufe4d'..'\ufe4f'
+ | '\ufe69'
+ | '\ufe70'..'\ufe74'
+ | '\ufe76'..'\ufefc'
+ | '\uff04'
+ | '\uff21'..'\uff3a'
+ | '\uff3f'
+ | '\uff41'..'\uff5a'
+ | '\uff65'..'\uffbe'
+ | '\uffc2'..'\uffc7'
+ | '\uffca'..'\uffcf'
+ | '\uffd2'..'\uffd7'
+ | '\uffda'..'\uffdc'
+ | '\uffe0'..'\uffe1'
+ | '\uffe5'..'\uffe6'
+// UTF-16: | ('\ud800'..'\udbff') ('\udc00'..'\udfff')
+ ;
+
+fragment
+IdentifierPart
+ : '\u0000'..'\u0008'
+ | '\u000e'..'\u001b'
+ | '\u0024'
+ | '\u0030'..'\u0039'
+ | '\u0041'..'\u005a'
+ | '\u005f'
+ | '\u0061'..'\u007a'
+ | '\u007f'..'\u009f'
+ | '\u00a2'..'\u00a5'
+ | '\u00aa'
+ | '\u00ad'
+ | '\u00b5'
+ | '\u00ba'
+ | '\u00c0'..'\u00d6'
+ | '\u00d8'..'\u00f6'
+ | '\u00f8'..'\u0236'
+ | '\u0250'..'\u02c1'
+ | '\u02c6'..'\u02d1'
+ | '\u02e0'..'\u02e4'
+ | '\u02ee'
+ | '\u0300'..'\u0357'
+ | '\u035d'..'\u036f'
+ | '\u037a'
+ | '\u0386'
+ | '\u0388'..'\u038a'
+ | '\u038c'
+ | '\u038e'..'\u03a1'
+ | '\u03a3'..'\u03ce'
+ | '\u03d0'..'\u03f5'
+ | '\u03f7'..'\u03fb'
+ | '\u0400'..'\u0481'
+ | '\u0483'..'\u0486'
+ | '\u048a'..'\u04ce'
+ | '\u04d0'..'\u04f5'
+ | '\u04f8'..'\u04f9'
+ | '\u0500'..'\u050f'
+ | '\u0531'..'\u0556'
+ | '\u0559'
+ | '\u0561'..'\u0587'
+ | '\u0591'..'\u05a1'
+ | '\u05a3'..'\u05b9'
+ | '\u05bb'..'\u05bd'
+ | '\u05bf'
+ | '\u05c1'..'\u05c2'
+ | '\u05c4'
+ | '\u05d0'..'\u05ea'
+ | '\u05f0'..'\u05f2'
+ | '\u0600'..'\u0603'
+ | '\u0610'..'\u0615'
+ | '\u0621'..'\u063a'
+ | '\u0640'..'\u0658'
+ | '\u0660'..'\u0669'
+ | '\u066e'..'\u06d3'
+ | '\u06d5'..'\u06dd'
+ | '\u06df'..'\u06e8'
+ | '\u06ea'..'\u06fc'
+ | '\u06ff'
+ | '\u070f'..'\u074a'
+ | '\u074d'..'\u074f'
+ | '\u0780'..'\u07b1'
+ | '\u0901'..'\u0939'
+ | '\u093c'..'\u094d'
+ | '\u0950'..'\u0954'
+ | '\u0958'..'\u0963'
+ | '\u0966'..'\u096f'
+ | '\u0981'..'\u0983'
+ | '\u0985'..'\u098c'
+ | '\u098f'..'\u0990'
+ | '\u0993'..'\u09a8'
+ | '\u09aa'..'\u09b0'
+ | '\u09b2'
+ | '\u09b6'..'\u09b9'
+ | '\u09bc'..'\u09c4'
+ | '\u09c7'..'\u09c8'
+ | '\u09cb'..'\u09cd'
+ | '\u09d7'
+ | '\u09dc'..'\u09dd'
+ | '\u09df'..'\u09e3'
+ | '\u09e6'..'\u09f3'
+ | '\u0a01'..'\u0a03'
+ | '\u0a05'..'\u0a0a'
+ | '\u0a0f'..'\u0a10'
+ | '\u0a13'..'\u0a28'
+ | '\u0a2a'..'\u0a30'
+ | '\u0a32'..'\u0a33'
+ | '\u0a35'..'\u0a36'
+ | '\u0a38'..'\u0a39'
+ | '\u0a3c'
+ | '\u0a3e'..'\u0a42'
+ | '\u0a47'..'\u0a48'
+ | '\u0a4b'..'\u0a4d'
+ | '\u0a59'..'\u0a5c'
+ | '\u0a5e'
+ | '\u0a66'..'\u0a74'
+ | '\u0a81'..'\u0a83'
+ | '\u0a85'..'\u0a8d'
+ | '\u0a8f'..'\u0a91'
+ | '\u0a93'..'\u0aa8'
+ | '\u0aaa'..'\u0ab0'
+ | '\u0ab2'..'\u0ab3'
+ | '\u0ab5'..'\u0ab9'
+ | '\u0abc'..'\u0ac5'
+ | '\u0ac7'..'\u0ac9'
+ | '\u0acb'..'\u0acd'
+ | '\u0ad0'
+ | '\u0ae0'..'\u0ae3'
+ | '\u0ae6'..'\u0aef'
+ | '\u0af1'
+ | '\u0b01'..'\u0b03'
+ | '\u0b05'..'\u0b0c'
+ | '\u0b0f'..'\u0b10'
+ | '\u0b13'..'\u0b28'
+ | '\u0b2a'..'\u0b30'
+ | '\u0b32'..'\u0b33'
+ | '\u0b35'..'\u0b39'
+ | '\u0b3c'..'\u0b43'
+ | '\u0b47'..'\u0b48'
+ | '\u0b4b'..'\u0b4d'
+ | '\u0b56'..'\u0b57'
+ | '\u0b5c'..'\u0b5d'
+ | '\u0b5f'..'\u0b61'
+ | '\u0b66'..'\u0b6f'
+ | '\u0b71'
+ | '\u0b82'..'\u0b83'
+ | '\u0b85'..'\u0b8a'
+ | '\u0b8e'..'\u0b90'
+ | '\u0b92'..'\u0b95'
+ | '\u0b99'..'\u0b9a'
+ | '\u0b9c'
+ | '\u0b9e'..'\u0b9f'
+ | '\u0ba3'..'\u0ba4'
+ | '\u0ba8'..'\u0baa'
+ | '\u0bae'..'\u0bb5'
+ | '\u0bb7'..'\u0bb9'
+ | '\u0bbe'..'\u0bc2'
+ | '\u0bc6'..'\u0bc8'
+ | '\u0bca'..'\u0bcd'
+ | '\u0bd7'
+ | '\u0be7'..'\u0bef'
+ | '\u0bf9'
+ | '\u0c01'..'\u0c03'
+ | '\u0c05'..'\u0c0c'
+ | '\u0c0e'..'\u0c10'
+ | '\u0c12'..'\u0c28'
+ | '\u0c2a'..'\u0c33'
+ | '\u0c35'..'\u0c39'
+ | '\u0c3e'..'\u0c44'
+ | '\u0c46'..'\u0c48'
+ | '\u0c4a'..'\u0c4d'
+ | '\u0c55'..'\u0c56'
+ | '\u0c60'..'\u0c61'
+ | '\u0c66'..'\u0c6f'
+ | '\u0c82'..'\u0c83'
+ | '\u0c85'..'\u0c8c'
+ | '\u0c8e'..'\u0c90'
+ | '\u0c92'..'\u0ca8'
+ | '\u0caa'..'\u0cb3'
+ | '\u0cb5'..'\u0cb9'
+ | '\u0cbc'..'\u0cc4'
+ | '\u0cc6'..'\u0cc8'
+ | '\u0cca'..'\u0ccd'
+ | '\u0cd5'..'\u0cd6'
+ | '\u0cde'
+ | '\u0ce0'..'\u0ce1'
+ | '\u0ce6'..'\u0cef'
+ | '\u0d02'..'\u0d03'
+ | '\u0d05'..'\u0d0c'
+ | '\u0d0e'..'\u0d10'
+ | '\u0d12'..'\u0d28'
+ | '\u0d2a'..'\u0d39'
+ | '\u0d3e'..'\u0d43'
+ | '\u0d46'..'\u0d48'
+ | '\u0d4a'..'\u0d4d'
+ | '\u0d57'
+ | '\u0d60'..'\u0d61'
+ | '\u0d66'..'\u0d6f'
+ | '\u0d82'..'\u0d83'
+ | '\u0d85'..'\u0d96'
+ | '\u0d9a'..'\u0db1'
+ | '\u0db3'..'\u0dbb'
+ | '\u0dbd'
+ | '\u0dc0'..'\u0dc6'
+ | '\u0dca'
+ | '\u0dcf'..'\u0dd4'
+ | '\u0dd6'
+ | '\u0dd8'..'\u0ddf'
+ | '\u0df2'..'\u0df3'
+ | '\u0e01'..'\u0e3a'
+ | '\u0e3f'..'\u0e4e'
+ | '\u0e50'..'\u0e59'
+ | '\u0e81'..'\u0e82'
+ | '\u0e84'
+ | '\u0e87'..'\u0e88'
+ | '\u0e8a'
+ | '\u0e8d'
+ | '\u0e94'..'\u0e97'
+ | '\u0e99'..'\u0e9f'
+ | '\u0ea1'..'\u0ea3'
+ | '\u0ea5'
+ | '\u0ea7'
+ | '\u0eaa'..'\u0eab'
+ | '\u0ead'..'\u0eb9'
+ | '\u0ebb'..'\u0ebd'
+ | '\u0ec0'..'\u0ec4'
+ | '\u0ec6'
+ | '\u0ec8'..'\u0ecd'
+ | '\u0ed0'..'\u0ed9'
+ | '\u0edc'..'\u0edd'
+ | '\u0f00'
+ | '\u0f18'..'\u0f19'
+ | '\u0f20'..'\u0f29'
+ | '\u0f35'
+ | '\u0f37'
+ | '\u0f39'
+ | '\u0f3e'..'\u0f47'
+ | '\u0f49'..'\u0f6a'
+ | '\u0f71'..'\u0f84'
+ | '\u0f86'..'\u0f8b'
+ | '\u0f90'..'\u0f97'
+ | '\u0f99'..'\u0fbc'
+ | '\u0fc6'
+ | '\u1000'..'\u1021'
+ | '\u1023'..'\u1027'
+ | '\u1029'..'\u102a'
+ | '\u102c'..'\u1032'
+ | '\u1036'..'\u1039'
+ | '\u1040'..'\u1049'
+ | '\u1050'..'\u1059'
+ | '\u10a0'..'\u10c5'
+ | '\u10d0'..'\u10f8'
+ | '\u1100'..'\u1159'
+ | '\u115f'..'\u11a2'
+ | '\u11a8'..'\u11f9'
+ | '\u1200'..'\u1206'
+ | '\u1208'..'\u1246'
+ | '\u1248'
+ | '\u124a'..'\u124d'
+ | '\u1250'..'\u1256'
+ | '\u1258'
+ | '\u125a'..'\u125d'
+ | '\u1260'..'\u1286'
+ | '\u1288'
+ | '\u128a'..'\u128d'
+ | '\u1290'..'\u12ae'
+ | '\u12b0'
+ | '\u12b2'..'\u12b5'
+ | '\u12b8'..'\u12be'
+ | '\u12c0'
+ | '\u12c2'..'\u12c5'
+ | '\u12c8'..'\u12ce'
+ | '\u12d0'..'\u12d6'
+ | '\u12d8'..'\u12ee'
+ | '\u12f0'..'\u130e'
+ | '\u1310'
+ | '\u1312'..'\u1315'
+ | '\u1318'..'\u131e'
+ | '\u1320'..'\u1346'
+ | '\u1348'..'\u135a'
+ | '\u1369'..'\u1371'
+ | '\u13a0'..'\u13f4'
+ | '\u1401'..'\u166c'
+ | '\u166f'..'\u1676'
+ | '\u1681'..'\u169a'
+ | '\u16a0'..'\u16ea'
+ | '\u16ee'..'\u16f0'
+ | '\u1700'..'\u170c'
+ | '\u170e'..'\u1714'
+ | '\u1720'..'\u1734'
+ | '\u1740'..'\u1753'
+ | '\u1760'..'\u176c'
+ | '\u176e'..'\u1770'
+ | '\u1772'..'\u1773'
+ | '\u1780'..'\u17d3'
+ | '\u17d7'
+ | '\u17db'..'\u17dd'
+ | '\u17e0'..'\u17e9'
+ | '\u180b'..'\u180d'
+ | '\u1810'..'\u1819'
+ | '\u1820'..'\u1877'
+ | '\u1880'..'\u18a9'
+ | '\u1900'..'\u191c'
+ | '\u1920'..'\u192b'
+ | '\u1930'..'\u193b'
+ | '\u1946'..'\u196d'
+ | '\u1970'..'\u1974'
+ | '\u1d00'..'\u1d6b'
+ | '\u1e00'..'\u1e9b'
+ | '\u1ea0'..'\u1ef9'
+ | '\u1f00'..'\u1f15'
+ | '\u1f18'..'\u1f1d'
+ | '\u1f20'..'\u1f45'
+ | '\u1f48'..'\u1f4d'
+ | '\u1f50'..'\u1f57'
+ | '\u1f59'
+ | '\u1f5b'
+ | '\u1f5d'
+ | '\u1f5f'..'\u1f7d'
+ | '\u1f80'..'\u1fb4'
+ | '\u1fb6'..'\u1fbc'
+ | '\u1fbe'
+ | '\u1fc2'..'\u1fc4'
+ | '\u1fc6'..'\u1fcc'
+ | '\u1fd0'..'\u1fd3'
+ | '\u1fd6'..'\u1fdb'
+ | '\u1fe0'..'\u1fec'
+ | '\u1ff2'..'\u1ff4'
+ | '\u1ff6'..'\u1ffc'
+ | '\u200c'..'\u200f'
+ | '\u202a'..'\u202e'
+ | '\u203f'..'\u2040'
+ | '\u2054'
+ | '\u2060'..'\u2063'
+ | '\u206a'..'\u206f'
+ | '\u2071'
+ | '\u207f'
+ | '\u20a0'..'\u20b1'
+ | '\u20d0'..'\u20dc'
+ | '\u20e1'
+ | '\u20e5'..'\u20ea'
+ | '\u2102'
+ | '\u2107'
+ | '\u210a'..'\u2113'
+ | '\u2115'
+ | '\u2119'..'\u211d'
+ | '\u2124'
+ | '\u2126'
+ | '\u2128'
+ | '\u212a'..'\u212d'
+ | '\u212f'..'\u2131'
+ | '\u2133'..'\u2139'
+ | '\u213d'..'\u213f'
+ | '\u2145'..'\u2149'
+ | '\u2160'..'\u2183'
+ | '\u3005'..'\u3007'
+ | '\u3021'..'\u302f'
+ | '\u3031'..'\u3035'
+ | '\u3038'..'\u303c'
+ | '\u3041'..'\u3096'
+ | '\u3099'..'\u309a'
+ | '\u309d'..'\u309f'
+ | '\u30a1'..'\u30ff'
+ | '\u3105'..'\u312c'
+ | '\u3131'..'\u318e'
+ | '\u31a0'..'\u31b7'
+ | '\u31f0'..'\u31ff'
+ | '\u3400'..'\u4db5'
+ | '\u4e00'..'\u9fa5'
+ | '\ua000'..'\ua48c'
+ | '\uac00'..'\ud7a3'
+ | '\uf900'..'\ufa2d'
+ | '\ufa30'..'\ufa6a'
+ | '\ufb00'..'\ufb06'
+ | '\ufb13'..'\ufb17'
+ | '\ufb1d'..'\ufb28'
+ | '\ufb2a'..'\ufb36'
+ | '\ufb38'..'\ufb3c'
+ | '\ufb3e'
+ | '\ufb40'..'\ufb41'
+ | '\ufb43'..'\ufb44'
+ | '\ufb46'..'\ufbb1'
+ | '\ufbd3'..'\ufd3d'
+ | '\ufd50'..'\ufd8f'
+ | '\ufd92'..'\ufdc7'
+ | '\ufdf0'..'\ufdfc'
+ | '\ufe00'..'\ufe0f'
+ | '\ufe20'..'\ufe23'
+ | '\ufe33'..'\ufe34'
+ | '\ufe4d'..'\ufe4f'
+ | '\ufe69'
+ | '\ufe70'..'\ufe74'
+ | '\ufe76'..'\ufefc'
+ | '\ufeff'
+ | '\uff04'
+ | '\uff10'..'\uff19'
+ | '\uff21'..'\uff3a'
+ | '\uff3f'
+ | '\uff41'..'\uff5a'
+ | '\uff65'..'\uffbe'
+ | '\uffc2'..'\uffc7'
+ | '\uffca'..'\uffcf'
+ | '\uffd2'..'\uffd7'
+ | '\uffda'..'\uffdc'
+ | '\uffe0'..'\uffe1'
+ | '\uffe5'..'\uffe6'
+ | '\ufff9'..'\ufffb'
+// UTF-16 | ('\ud800'..'\udbff') ('\udc00'..'\udfff')
+ ;
+
Added: labs/jbossrules/branches/DRLv6/src/main/resources/DRLParser.g.off
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/resources/DRLParser.g.off (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/resources/DRLParser.g.off 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,1084 @@
+parser grammar DRLParser;
+
+options {
+ output=AST;
+ tokenVocab=DRLLexer;
+}
+
+import DRLKeywords, Expression;
+
+ at header {
+ package org.drools.lang;
+
+ import java.util.List;
+ import java.util.LinkedList;
+ import org.drools.compiler.DroolsParserException;
+}
+
+ at members {
+ private ParserHelper helper = new ParserHelper( this,
+ tokenNames,
+ input,
+ state );
+
+ /**
+ * The dummy parameter bellow is just to enable constructor overloading
+ * so that we can initialise the parser helper on delegate grammars
+ */
+ public DRLParser(TokenStream input, boolean dummy ) {
+ this(input);
+ gDRLKeywords.setParserHelper( helper );
+ gExpression.setParserHelper( helper );
+ }
+
+ public ParserHelper getHelper() { return helper; }
+ public boolean hasErrors() { return helper.hasErrors(); }
+ public List<DroolsParserException> getErrors() { return helper.getErrors(); }
+ public List<String> getErrorMessages() { return helper.getErrorMessages(); }
+ public void enableEditorInterface() { helper.enableEditorInterface(); }
+ public void disableEditorInterface() { helper.disableEditorInterface(); }
+ public LinkedList<DroolsSentence> getEditorInterface() { return helper.getEditorInterface(); }
+ public void reportError(RecognitionException ex) { helper.reportError( ex ); }
+
+}
+
+// --------------------------------------------------------
+// MAIN RULE
+// --------------------------------------------------------
+compilation_unit
+ : package_statement?
+ statement*
+ EOF
+ -> ^(VT_COMPILATION_UNIT package_statement? statement*)
+ ;
+ catch [ RecognitionException e ] {
+ helper.reportError( e );
+ }
+ catch [ RewriteEmptyStreamException e ] {
+ }
+finally {
+ if (helper.isEditorInterfaceEnabled && retval.tree == null) {
+ retval.tree = root_0;
+ root_0 = (Object) adaptor.nil();
+ Object root_1 = (Object) adaptor.nil();
+ root_1 = (Object) adaptor.becomeRoot(adaptor.create(
+ VT_COMPILATION_UNIT, "VT_COMPILATION_UNIT"), root_1);
+ if (stream_package_statement.hasNext()) {
+ adaptor.addChild(root_1, stream_package_statement.nextTree());
+ }
+ while (stream_statement.hasNext()) {
+ adaptor.addChild(root_1, stream_statement.nextTree());
+ }
+ adaptor.addChild(root_0, root_1);
+ retval.stop = input.LT(-1);
+ retval.tree = (Object) adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start,
+ retval.stop);
+ }
+ if (helper.isEditorInterfaceEnabled && helper.hasErrors()) {
+ Tree rootNode = (Tree) adaptor.becomeRoot(adaptor.create(
+ VT_COMPILATION_UNIT, "VT_COMPILATION_UNIT"), adaptor.nil());
+ for (int i = 0; i < ((Tree)retval.tree).getChildCount(); i++) {
+ Tree childNode = (Tree) ((Tree)retval.tree).getChild(i);
+ if (!(childNode instanceof CommonErrorNode)) {
+ rootNode.addChild(childNode);
+ }
+ }
+ retval.tree = rootNode;
+ }
+}
+
+// --------------------------------------------------------
+// PACKAGE STATEMENT
+// --------------------------------------------------------
+package_statement
+ at init { helper.pushParaphrases(DroolsParaphraseTypes.PACKAGE); if ( state.backtracking==0 ) helper.beginSentence(DroolsSentenceType.PACKAGE); }
+ at after { helper.popParaphrases(); }
+ : package_key
+ packageOrTypeName SEMICOLON?
+ { helper.emit($SEMICOLON, DroolsEditorType.SYMBOL); }
+ -> ^(package_key packageOrTypeName)
+ ;
+
+
+
+// --------------------------------------------------------
+// GENERAL STATEMENT
+// --------------------------------------------------------
+statement
+options{
+k = 2;
+} : {helper.validateLT(1, DroolsSoftKeywords.IMPORT) && helper.validateLT(2, DroolsSoftKeywords.FUNCTION)}?=> function_import_statement
+ | {helper.validateLT(1, DroolsSoftKeywords.IMPORT)}?=> import_statement
+ | {helper.validateLT(1, DroolsSoftKeywords.GLOBAL)}?=> global
+ | {helper.validateLT(2, DroolsSoftKeywords.FUNCTION)}?=> function
+ | {helper.validateLT(1, DroolsSoftKeywords.DECLARE)}?=> type_declaration
+ | {helper.validateLT(1, DroolsSoftKeywords.RULE)}?=> rule
+ | {helper.validateLT(1, DroolsSoftKeywords.QUERY)}?=> query
+ | rule_attribute
+ ;
+
+// --------------------------------------------------------
+// IMPORT STATEMENTS
+// --------------------------------------------------------
+import_statement
+ at init { helper.pushParaphrases(DroolsParaphraseTypes.IMPORT); if ( state.backtracking==0 ) helper.beginSentence(DroolsSentenceType.IMPORT_STATEMENT); }
+ at after { helper.popParaphrases(); }
+ : import_key import_name[DroolsParaphraseTypes.IMPORT] SEMICOLON?
+ { helper.emit($SEMICOLON, DroolsEditorType.SYMBOL); }
+ -> ^(import_key import_name)
+ ;
+
+function_import_statement
+ at init { helper.pushParaphrases(DroolsParaphraseTypes.FUNCTION_IMPORT); if ( state.backtracking==0 ) helper.beginSentence(DroolsSentenceType.FUNCTION_IMPORT_STATEMENT); }
+ at after { helper.popParaphrases(); }
+ : imp=import_key function_key import_name[DroolsParaphraseTypes.FUNCTION_IMPORT] SEMICOLON?
+ { helper.emit($SEMICOLON, DroolsEditorType.SYMBOL); }
+ -> ^(VT_FUNCTION_IMPORT[$imp.start] function_key import_name)
+ ;
+
+import_name [DroolsParaphraseTypes importType]
+ : id+=ID ( id+=DOT id+=ID )* id+=DOT_STAR?
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue($importType, helper.buildStringFromTokens($id)); }
+ -> ^(VT_IMPORT_ID ID+ DOT_STAR?)
+ ;
+
+// --------------------------------------------------------
+// GLOBAL STATEMENT
+// --------------------------------------------------------
+global
+ at init { helper.pushParaphrases(DroolsParaphraseTypes.GLOBAL); if ( state.backtracking==0 ) helper.beginSentence(DroolsSentenceType.GLOBAL); }
+ at after { helper.popParaphrases(); }
+ : global_key data_type global_id SEMICOLON?
+ { helper.emit($SEMICOLON, DroolsEditorType.SYMBOL); }
+ -> ^(global_key data_type global_id)
+ ;
+
+global_id
+ : id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue(DroolsParaphraseTypes.GLOBAL, $id.text); }
+ -> VT_GLOBAL_ID[$id]
+ ;
+
+// --------------------------------------------------------
+// FUNCTION STATEMENT
+// --------------------------------------------------------
+function
+ at init { helper.pushParaphrases(DroolsParaphraseTypes.FUNCTION); if ( state.backtracking==0 ) helper.beginSentence(DroolsSentenceType.FUNCTION); }
+ at after { helper.popParaphrases(); }
+ : function_key data_type? function_id parameters curly_chunk
+ -> ^(function_key data_type? function_id parameters curly_chunk)
+ ;
+
+function_id
+ : id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue(DroolsParaphraseTypes.FUNCTION, $id.text); }
+ -> VT_FUNCTION_ID[$id]
+ ;
+
+// --------------------------------------------------------
+// QUERY STATEMENT
+// --------------------------------------------------------
+query
+ at init { helper.pushParaphrases(DroolsParaphraseTypes.QUERY); if ( state.backtracking==0 ) helper.beginSentence(DroolsSentenceType.QUERY); }
+ at after { helper.popParaphrases(); }
+ : query_key query_id
+ { helper.emit(Location.LOCATION_RULE_HEADER); }
+ parameters?
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION); }
+ normal_lhs_block
+ end=end_key SEMICOLON?
+ { helper.emit($SEMICOLON, DroolsEditorType.SYMBOL); }
+ -> ^(query_key query_id parameters? normal_lhs_block end_key)
+ ;
+
+query_id
+ : id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue(DroolsParaphraseTypes.QUERY, $id.text); } -> VT_QUERY_ID[$id]
+ | id=STRING
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue(DroolsParaphraseTypes.QUERY, $id.text); } -> VT_QUERY_ID[$id]
+ ;
+
+// --------------------------------------------------------
+// DECLARE STATEMENT
+// --------------------------------------------------------
+type_declaration
+ at init { helper.pushParaphrases(DroolsParaphraseTypes.TYPE_DECLARE); if ( state.backtracking==0 ) helper.beginSentence(DroolsSentenceType.TYPE_DECLARATION); }
+ at after { helper.popParaphrases(); }
+ : declare_key type_declare_id
+ decl_metadata*
+ decl_field*
+ end_key
+ -> ^(declare_key type_declare_id decl_metadata* decl_field* end_key)
+ ;
+
+type_declare_id
+ : id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue(DroolsParaphraseTypes.TYPE_DECLARE, $id.text); } -> VT_TYPE_DECLARE_ID[$id]
+ ;
+
+decl_metadata
+ : AT
+ { helper.emit($AT, DroolsEditorType.SYMBOL); }
+ ID
+ { helper.emit($ID, DroolsEditorType.IDENTIFIER); }
+ paren_chunk?
+ -> ^(AT ID paren_chunk?)
+ ;
+
+decl_field
+ : ID { helper.emit($ID, DroolsEditorType.IDENTIFIER); }
+ decl_field_initialization?
+ COLON { helper.emit($COLON, DroolsEditorType.SYMBOL); }
+ data_type
+ decl_metadata*
+ -> ^(ID decl_field_initialization? data_type decl_metadata*)
+ ;
+
+decl_field_initialization
+ : EQUALS_ASSIGN { helper.emit($EQUALS_ASSIGN, DroolsEditorType.SYMBOL); }
+ paren_chunk
+ -> ^(EQUALS_ASSIGN paren_chunk)
+ ;
+
+// --------------------------------------------------------
+// RULE STATEMENT
+// --------------------------------------------------------
+rule
+ at init { boolean isFailed = true; helper.pushParaphrases(DroolsParaphraseTypes.RULE); }
+ at after { helper.popParaphrases(); isFailed = false; }
+ :
+ { helper.beginSentence(DroolsSentenceType.RULE); }
+ rule_key rule_id
+ { helper.emit(Location.LOCATION_RULE_HEADER); }
+ (extend_key rule_id)? decl_metadata* rule_attributes? when_part? rhs_chunk
+ -> ^(rule_key rule_id ^(extend_key rule_id)? decl_metadata* rule_attributes? when_part? rhs_chunk)
+ ;
+finally {
+ if (helper.isEditorInterfaceEnabled && isFailed) {
+ if (input.LA(6) == EOF && input.LA(1) == ID && input.LA(2) == MINUS && input.LA(3) == ID &&
+ input.LA(5) == MINUS && input.LA(6) == ID &&
+ helper.validateLT(1, DroolsSoftKeywords.LOCK) && helper.validateLT(3, DroolsSoftKeywords.ON) &&
+ helper.validateLT(5, DroolsSoftKeywords.ACTIVE)){
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(2), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(3), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(4), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(5), DroolsEditorType.KEYWORD);
+ helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD);
+ input.consume();
+ input.consume();
+ input.consume();
+ input.consume();
+ input.consume();
+ } else if (input.LA(4) == EOF && input.LA(1) == ID && input.LA(2) == MINUS && input.LA(3) == ID &&
+ ( (helper.validateLT(1, DroolsSoftKeywords.ACTIVATION) && helper.validateLT(3, DroolsSoftKeywords.GROUP)) ||
+ (helper.validateLT(1, DroolsSoftKeywords.DATE) && helper.validateLT(3, DroolsSoftKeywords.EXPIRES)) ||
+ (helper.validateLT(1, DroolsSoftKeywords.NO) && helper.validateLT(3, DroolsSoftKeywords.LOOP)) ||
+ (helper.validateLT(1, DroolsSoftKeywords.DATE) && helper.validateLT(3, DroolsSoftKeywords.EFFECTIVE)) ||
+ (helper.validateLT(1, DroolsSoftKeywords.AUTO) && helper.validateLT(3, DroolsSoftKeywords.FOCUS)) ||
+ (helper.validateLT(1, DroolsSoftKeywords.ACTIVATION) && helper.validateLT(3, DroolsSoftKeywords.GROUP)) ||
+ (helper.validateLT(1, DroolsSoftKeywords.RULEFLOW) && helper.validateLT(3, DroolsSoftKeywords.GROUP)) ||
+ (helper.validateLT(1, DroolsSoftKeywords.AGENDA) && helper.validateLT(3, DroolsSoftKeywords.GROUP)) )){
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(2), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(3), DroolsEditorType.KEYWORD);
+ helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD);
+ input.consume();
+ input.consume();
+ input.consume();
+ } else if (input.LA(2) == EOF && input.LA(1) == ID &&
+ (helper.validateLT(1, DroolsSoftKeywords.DIALECT) || helper.validateLT(1, DroolsSoftKeywords.ENABLED) ||
+ helper.validateLT(1, DroolsSoftKeywords.SALIENCE) || helper.validateLT(1, DroolsSoftKeywords.DURATION) ||
+ helper.validateLT(1, DroolsSoftKeywords.TIMER))){
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD);
+ input.consume();
+ }
+ }
+}
+
+when_part
+ : WHEN { helper.emit($WHEN, DroolsEditorType.KEYWORD); }
+ COLON? { helper.emit($COLON, DroolsEditorType.SYMBOL); }
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION); }
+ normal_lhs_block
+ -> WHEN normal_lhs_block
+ ;
+
+rule_id
+ : id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue(DroolsParaphraseTypes.RULE, $id.text); } -> VT_RULE_ID[$id]
+ | id=STRING
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue(DroolsParaphraseTypes.RULE, $id.text); } -> VT_RULE_ID[$id]
+ ;
+
+rule_attributes
+ : ( attributes_key COLON { helper.emit($COLON, DroolsEditorType.SYMBOL); } )?
+ rule_attribute ( COMMA? { helper.emit($COMMA, DroolsEditorType.SYMBOL); } attr=rule_attribute )*
+ -> ^(VT_RULE_ATTRIBUTES attributes_key? rule_attribute+)
+ ;
+
+rule_attribute
+ at init { boolean isFailed = true; helper.pushParaphrases(DroolsParaphraseTypes.RULE_ATTRIBUTE); }
+ at after { helper.popParaphrases(); isFailed = false; if (!(retval.tree instanceof CommonErrorNode)) helper.emit(Location.LOCATION_RULE_HEADER); }
+ : salience
+ | no_loop
+ | agenda_group
+ | timer
+ | activation_group
+ | auto_focus
+ | date_effective
+ | date_expires
+ | enabled
+ | ruleflow_group
+ | lock_on_active
+ | dialect
+ | calendars
+ ;
+finally {
+ if (helper.isEditorInterfaceEnabled && isFailed) {
+ if (input.LA(2) == EOF && input.LA(1) == ID){
+ helper.emit(input.LT(1), DroolsEditorType.IDENTIFIER);
+ input.consume();
+ }
+ }
+}
+date_effective
+ : date_effective_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } STRING
+ { helper.emit($STRING, DroolsEditorType.STRING_CONST ); }
+ ;
+
+date_expires
+ : date_expires_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } STRING
+ { helper.emit($STRING, DroolsEditorType.STRING_CONST ); }
+ ;
+
+enabled
+ : enabled_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); }
+ ( BOOL { helper.emit($BOOL, DroolsEditorType.BOOLEAN_CONST ); }
+ | paren_chunk
+ )
+ ;
+
+salience
+ : salience_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); }
+ ( DECIMAL { helper.emit($DECIMAL, DroolsEditorType.NUMERIC_CONST ); }
+ | paren_chunk
+ )
+ ;
+
+no_loop
+ : no_loop_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } BOOL?
+ { helper.emit($BOOL, DroolsEditorType.BOOLEAN_CONST ); }
+ ;
+
+auto_focus
+ : auto_focus_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } BOOL?
+ { helper.emit($BOOL, DroolsEditorType.BOOLEAN_CONST ); }
+ ;
+
+activation_group
+ : activation_group_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } STRING
+ { helper.emit($STRING, DroolsEditorType.STRING_CONST ); }
+ ;
+
+ruleflow_group
+ : ruleflow_group_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } STRING
+ { helper.emit($STRING, DroolsEditorType.STRING_CONST ); }
+ ;
+
+agenda_group
+ : agenda_group_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } STRING
+ { helper.emit($STRING, DroolsEditorType.STRING_CONST ); }
+ ;
+
+timer
+ : (duration_key^|timer_key^) { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); }
+ ( DECIMAL { helper.emit($DECIMAL, DroolsEditorType.NUMERIC_CONST ); }
+ | paren_chunk
+ )
+ ;
+
+calendars
+ : calendars_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } string_list
+ ;
+
+dialect
+ : dialect_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } STRING
+ { helper.emit($STRING, DroolsEditorType.STRING_CONST ); }
+ ;
+
+lock_on_active
+ : lock_on_active_key^ { helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD); } BOOL?
+ { helper.emit($BOOL, DroolsEditorType.BOOLEAN_CONST ); }
+ ;
+
+// --------------------------------------------------------
+// LHS
+// --------------------------------------------------------
+normal_lhs_block
+ : lhs*
+ -> ^(VT_AND_IMPLICIT lhs*)
+ ;
+
+lhs : lhs_or
+ ;
+
+lhs_or
+ at init{
+ Token orToken = null;
+} : (LEFT_PAREN or_key)=>
+ LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ or=or_key
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR); }
+ lhs_and+
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); } // PREFIX
+ -> ^(VT_OR_PREFIX[$or.start] lhs_and+ RIGHT_PAREN)
+ | (lhs_and -> lhs_and)
+ ( (or_key)=> (value=or_key {orToken = $value.start;} )
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR); }
+ lhs_and
+ -> ^(VT_OR_INFIX[orToken] $lhs_or lhs_and))*
+ ;
+
+lhs_and
+ at init{
+ Token andToken = null;
+} : (LEFT_PAREN and_key)=>
+ LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ and=and_key
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR); }
+ lhs_unary+
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); } // PREFIX
+ -> ^(VT_AND_PREFIX[$and.start] lhs_unary+ RIGHT_PAREN)
+ | (lhs_unary -> lhs_unary)
+ ( (and_key)=> (value=and_key {andToken = $value.start;} )
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR); }
+ lhs_unary
+ -> ^(VT_AND_INFIX[andToken] $lhs_and lhs_unary) )*
+ ;
+
+lhs_unary
+ : ( lhs_exist
+ |{helper.validateNotWithBinding()}?=> lhs_not_binding
+ | lhs_not
+ | lhs_eval
+ | lhs_forall
+ | LEFT_PAREN! { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION ); }
+ lhs_or
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ | pattern_source
+ )
+ ((SEMICOLON)=> SEMICOLON! { helper.emit($SEMICOLON, DroolsEditorType.SYMBOL); })?
+ ;
+
+lhs_exist
+ : exists_key
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS); }
+ ( (LEFT_PAREN (or_key|and_key))=> lhs_or //prevent "(("
+ | LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ lhs_or
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ | lhs_pattern
+ )
+ -> ^(exists_key lhs_or? lhs_pattern? RIGHT_PAREN?)
+ ;
+
+lhs_not_binding
+ : not_key fact_binding
+ -> ^(not_key ^(VT_PATTERN fact_binding))
+ ;
+
+lhs_not : not_key
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION_NOT); }
+ ( (LEFT_PAREN (or_key|and_key))=> { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION ); } lhs_or //prevent "(("
+ | LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION ); }
+ lhs_or
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ | lhs_pattern )
+ -> ^(not_key lhs_or? lhs_pattern? RIGHT_PAREN?)
+ ;
+
+lhs_eval
+ : ev=eval_key
+ { helper.emit(Location.LOCATION_LHS_INSIDE_EVAL); }
+ pc=paren_chunk
+ { if (((DroolsTree) $pc.tree).getText() != null){
+ helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION);
+ }
+ }
+ { String body = helper.safeSubstring( $pc.text, 1, $pc.text.length()-1 );
+ helper.checkTrailingSemicolon( body, $ev.start ); }
+ -> ^(eval_key paren_chunk)
+ ;
+
+lhs_forall
+ : forall_key
+ LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ pattern_source+
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ -> ^(forall_key pattern_source+ RIGHT_PAREN)
+ ;
+
+pattern_source
+ at init { boolean isFailed = true; }
+ at after { isFailed = false; }
+ : lhs_pattern
+ over_clause?
+ (
+ FROM^
+ { helper.emit($FROM, DroolsEditorType.KEYWORD);
+ helper.emit(Location.LOCATION_LHS_FROM); }
+ ( accumulate_statement
+ | collect_statement
+ | entrypoint_statement
+ | from_source
+ )
+ )?
+ ;
+finally {
+ if (helper.isEditorInterfaceEnabled && input.LA(3) == EOF && input.LA(1) == ACCUMULATE) {
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(2), DroolsEditorType.SYMBOL);
+ input.consume();
+ helper.emit(true, Location.LOCATION_LHS_FROM_ACCUMULATE);
+ } else if (helper.isEditorInterfaceEnabled && input.LA(3) == EOF && input.LA(1) == COLLECT) {
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(2), DroolsEditorType.SYMBOL);
+ input.consume();
+ helper.emit(true, Location.LOCATION_LHS_FROM_COLLECT);
+ }
+}
+
+over_clause
+ : OVER^ { helper.emit($OVER, DroolsEditorType.KEYWORD); } over_elements
+ (COMMA! { helper.emit($COMMA, DroolsEditorType.SYMBOL); } over_elements)*
+ ;
+
+over_elements
+ : id1=ID { helper.emit($id1, DroolsEditorType.IDENTIFIER); }
+ COLON { helper.emit($COLON, DroolsEditorType.SYMBOL); }
+ id2=ID { helper.emit($id2, DroolsEditorType.IDENTIFIER); }
+ paren_chunk
+ -> ^(VT_BEHAVIOR $id1 $id2 paren_chunk)
+ ;
+
+accumulate_statement
+ : ACCUMULATE { helper.emit($ACCUMULATE, DroolsEditorType.KEYWORD); }
+ { helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE); }
+ LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ lhs_or
+ COMMA? { helper.emit($COMMA, DroolsEditorType.SYMBOL); }
+ ( accumulate_init_clause
+ | accumulate_id_clause
+ )
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION); }
+ -> ^(ACCUMULATE lhs_or accumulate_init_clause? accumulate_id_clause? RIGHT_PAREN)
+ ;
+
+
+accumulate_init_clause
+ at init { boolean isFailed = true; }
+ at after { isFailed = false; }
+ : init_key
+ { helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_INIT); }
+ pc1=accumulate_paren_chunk[Location.LOCATION_LHS_FROM_ACCUMULATE_INIT_INSIDE] cm1=COMMA? { helper.emit($cm1, DroolsEditorType.SYMBOL); }
+ { if (pc1 != null && ((DroolsTree) pc1.getTree()).getText() != null) helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_ACTION); }
+ action_key pc2=accumulate_paren_chunk[Location.LOCATION_LHS_FROM_ACCUMULATE_ACTION_INSIDE] cm2=COMMA? { helper.emit($cm2, DroolsEditorType.SYMBOL); }
+ { if (pc1 != null && ((DroolsTree) pc1.getTree()).getText() != null && pc2 != null && ((DroolsTree) pc2.getTree()).getText() != null ) helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_REVERSE); }
+ ( reverse_key pc3=accumulate_paren_chunk[Location.LOCATION_LHS_FROM_ACCUMULATE_REVERSE_INSIDE] cm3=COMMA? { helper.emit($cm3, DroolsEditorType.SYMBOL); } )?
+
+ { if ((pc1 != null && ((DroolsTree) pc1.tree).getText() != null) &&
+ (pc2 != null && ((DroolsTree) pc2.tree).getText() != null) &&
+ (pc3 != null && ((DroolsTree) pc3.tree).getText() != null)) {
+ helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_RESULT);
+ }
+ }
+ res1=result_key { helper.emit($res1.start, DroolsEditorType.KEYWORD); } pc4=accumulate_paren_chunk[Location.LOCATION_LHS_FROM_ACCUMULATE_RESULT_INSIDE]
+ -> ^(VT_ACCUMULATE_INIT_CLAUSE ^(init_key $pc1) ^(action_key $pc2) ^(reverse_key $pc3)? ^(result_key $pc4))
+ ;
+finally {
+ if (helper.isEditorInterfaceEnabled && isFailed && input.LA(1) == ID && helper.validateLT(1, DroolsSoftKeywords.RESULT)) {
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ input.consume();
+ if (input.LA(1) == LEFT_PAREN){
+ input.consume();
+ helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_RESULT_INSIDE);
+ }
+ }
+}
+
+accumulate_paren_chunk[int locationType]
+ at init{
+ String text = "";
+} : pc=accumulate_paren_chunk_data[false,$locationType] {text = $pc.text;}
+ -> VT_PAREN_CHUNK[$pc.start,text]
+ ;
+
+accumulate_paren_chunk_data[boolean isRecursive, int locationType]
+ : lp1=LEFT_PAREN
+ { if (!isRecursive) {
+ helper.emit($lp1, DroolsEditorType.SYMBOL);
+ helper.emit($locationType);
+ } else {
+ helper.emit($lp1, DroolsEditorType.CODE_CHUNK);
+ }
+ }
+ (any=~ ( LEFT_PAREN | RIGHT_PAREN ) { helper.emit($any, DroolsEditorType.CODE_CHUNK); } | accumulate_paren_chunk_data[true,-1] )*
+ rp1=RIGHT_PAREN
+ { if (!isRecursive) {
+ helper.emit($rp1, DroolsEditorType.SYMBOL);
+ } else {
+ helper.emit($rp1, DroolsEditorType.CODE_CHUNK);
+ }
+ }
+ ;
+
+accumulate_id_clause
+ : ID { helper.emit($ID, DroolsEditorType.IDENTIFIER); }
+ paren_chunk
+ -> ^(VT_ACCUMULATE_ID_CLAUSE ID paren_chunk)
+ ;
+
+collect_statement
+ : COLLECT { helper.emit($COLLECT, DroolsEditorType.KEYWORD); }
+ { helper.emit(Location.LOCATION_LHS_FROM_COLLECT); }
+ LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ pattern_source
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION); }
+ -> ^(COLLECT pattern_source RIGHT_PAREN)
+ ;
+
+entrypoint_statement
+ : entry_point_key
+ { helper.emit(Location.LOCATION_LHS_FROM_COLLECT); }
+ entrypoint_id
+ { helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION); }
+ -> ^(entry_point_key entrypoint_id)
+ ;
+
+entrypoint_id
+ : value=ID { helper.emit($value, DroolsEditorType.IDENTIFIER); }
+ -> VT_ENTRYPOINT_ID[$value]
+ | value=STRING { helper.emit($value, DroolsEditorType.IDENTIFIER); }
+ -> VT_ENTRYPOINT_ID[$value]
+ ;
+
+
+from_source
+ : fs=expression -> VT_FROM_SOURCE[$fs.text]
+ ;
+
+/*from_source_matcher
+ : ( ID
+ | square_chunk
+ | {input.LA(1) == LEFT_PAREN}? args=paren_chunk )
+ expression_chain?
+ ;
+
+expression_chain
+ : ( DOT ID
+ | square_chunk
+ | {input.LA(1) == LEFT_PAREN}? paren_chunk )
+ expression_chain?
+ ;
+
+
+( ID { helper.emit($ID, DroolsEditorType.IDENTIFIER); }
+ ( (LEFT_PAREN)=> args=paren_chunk )?
+ expression_chain?
+ { if ( input.LA(1) == EOF && input.get(input.index() - 1).getType() == WS) {
+ helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION);
+ } else if ( input.LA(1) != EOF ) {
+ helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION);
+ }
+ }
+ -> ^(VT_FROM_SOURCE ID paren_chunk? expression_chain?)
+ )
+ |
+ ( square_chunk expression_chain? -> ^(VT_FROM_SOURCE square_chunk expression_chain? ) )
+ ;
+
+expression_chain
+ :
+ DOT { helper.emit($DOT, DroolsEditorType.IDENTIFIER); }
+ ID { helper.emit($ID, DroolsEditorType.IDENTIFIER); }
+ (
+ {input.LA(1) == LEFT_PAREN}? paren_chunk
+ |
+ square_chunk
+ )?
+ expression_chain?
+ -> ^(VT_EXPRESSION_CHAIN[$DOT] ID square_chunk? paren_chunk? expression_chain?)
+ ;
+*/
+
+// --------------------------------------------------------
+// PATTERN
+// --------------------------------------------------------
+lhs_pattern
+ : fact_binding -> ^(VT_PATTERN fact_binding)
+ | fact -> ^(VT_PATTERN fact)
+ ;
+
+fact_binding
+ : label
+ ( fact
+ | LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ fact_binding_expression
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ )
+ -> ^(VT_FACT_BINDING label fact? fact_binding_expression? RIGHT_PAREN?)
+ ;
+
+fact_binding_expression
+ at init{
+ Token orToken = null;
+} : (fact -> fact) ( (value=or_key {orToken = $value.start;}|pipe=DOUBLE_PIPE {orToken = $pipe;}) fact
+ -> ^(VT_FACT_OR[orToken] $fact_binding_expression fact) )*
+ ;
+
+fact
+ at init { boolean isFailedOnConstraints = true; helper.pushParaphrases(DroolsParaphraseTypes.PATTERN); }
+ at after { helper.popParaphrases(); }
+ : pattern_type
+ LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ { helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_START); }
+ constraints?
+ RIGHT_PAREN { isFailedOnConstraints = false; }
+ { if ($RIGHT_PAREN.text.equals(")") ){ //WORKAROUND FOR ANTLR BUG!
+ helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL);
+ helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION);
+ } }
+ -> ^(VT_FACT pattern_type constraints? RIGHT_PAREN)
+ ;
+finally {
+ if (helper.isEditorInterfaceEnabled && isFailedOnConstraints && input.LA(1) == EOF && input.get(input.index() - 1).getType() == WS){
+ if (!(helper.getActiveSentence().getContent().getLast() instanceof Integer) && input.LA(-1) != COLON) {
+ helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
+ }
+ }
+}
+
+constraints
+ : constraint ( COMMA!
+ { helper.emit($COMMA, DroolsEditorType.SYMBOL);
+ helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_START); } constraint )*
+ ;
+
+constraint
+ : or_constr
+ ;
+
+or_constr
+ : and_constr ( DOUBLE_PIPE^
+ { helper.emit($DOUBLE_PIPE, DroolsEditorType.SYMBOL); } and_constr )*
+ ;
+
+and_constr
+ : unary_constr ( DOUBLE_AMPER^
+ { helper.emit($DOUBLE_AMPER, DroolsEditorType.SYMBOL);; } unary_constr )*
+ ;
+
+unary_constr
+options { k=2; }
+ at init { boolean isFailed = true; }
+ at after { isFailed = false; }
+ : eval_key^ paren_chunk
+ | field_constraint
+ | LEFT_PAREN! { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ or_constr
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ ;
+finally {
+ if (helper.isEditorInterfaceEnabled && isFailed && input.LA(2) == EOF && input.LA(1) == ID) {
+ helper.emit(input.LT(1), DroolsEditorType.IDENTIFIER);
+ input.consume();
+ if (input.get(input.index() - 1).getType() == WS)
+ helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
+ }
+}
+
+field_constraint
+ at init{
+ boolean isArrow = false;
+} : label accessor_path
+ ( or_restr_connective | arw=ARROW { helper.emit($ARROW, DroolsEditorType.SYMBOL); } paren_chunk {isArrow = true;})?
+ -> {isArrow}? ^(VT_BIND_FIELD label ^(VT_FIELD accessor_path)) ^(VK_EVAL[$arw] paren_chunk)?
+ -> ^(VT_BIND_FIELD label ^(VT_FIELD accessor_path or_restr_connective?))
+ | accessor_path or_restr_connective
+ -> ^(VT_FIELD accessor_path or_restr_connective)
+ ;
+
+label
+ : value=ID { helper.emit($ID, DroolsEditorType.IDENTIFIER_VARIABLE); }
+ COLON { helper.emit($COLON, DroolsEditorType.SYMBOL); }
+ -> VT_LABEL[$value]
+ ;
+
+or_restr_connective
+ : and_restr_connective ({(helper.validateRestr())}?=> DOUBLE_PIPE^
+ { helper.emit($DOUBLE_PIPE, DroolsEditorType.SYMBOL); } and_restr_connective )*
+ ;
+catch [ RecognitionException re ] {
+ if (!helper.lookaheadTest){
+ helper.reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+ } else {
+ throw re;
+ }
+}
+
+and_restr_connective
+ : constraint_expression ({(helper.validateRestr())}?=> DOUBLE_AMPER^
+ { helper.emit($DOUBLE_AMPER, DroolsEditorType.SYMBOL); } constraint_expression )*
+ ;
+catch [ RecognitionException re ] {
+ if (!helper.lookaheadTest){
+ helper.reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+ } else {
+ throw re;
+ }
+}
+
+constraint_expression
+options{ k=3; }
+ : compound_operator
+ | simple_operator
+ | LEFT_PAREN! { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ or_restr_connective
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ ;
+catch [ RecognitionException re ] {
+ if (!helper.lookaheadTest){
+ helper.reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+ } else {
+ throw re;
+ }
+}
+finally {
+ if (helper.isEditorInterfaceEnabled && input.LA(2) == EOF && input.LA(1) == ID) {
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ input.consume();
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT);
+ } else if (helper.isEditorInterfaceEnabled && input.LA(3) == EOF && input.LA(1) == ID &&
+ input.LA(2) == ID && helper.validateLT(1, DroolsSoftKeywords.NOT)) {
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(2), DroolsEditorType.KEYWORD);
+ input.consume();
+ input.consume();
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT);
+ } else if (helper.isEditorInterfaceEnabled && input.LA(3) == EOF && input.LA(1) == ID && helper.validateLT(1, DroolsSoftKeywords.IN)) {
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(2), DroolsEditorType.SYMBOL);
+ input.consume();
+ input.consume();
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT);
+ } else if (helper.isEditorInterfaceEnabled && input.LA(3) == EOF && input.LA(1) == ID) {
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
+ helper.emit(input.LT(1), DroolsEditorType.KEYWORD);
+ helper.emit(input.LT(2), DroolsEditorType.IDENTIFIER);
+ input.consume();
+ input.consume();
+ if (input.get(input.index() - 1).getType() == WS){
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_END);
+ }
+ }
+}
+
+simple_operator
+ at init {if ( state.backtracking==0 ) helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);}
+ :
+ (
+ EQUALS^ { helper.emit($EQUALS, DroolsEditorType.SYMBOL); }
+ | GREATER^ { helper.emit($GREATER, DroolsEditorType.SYMBOL); }
+ | GREATER_EQUALS^ { helper.emit($GREATER_EQUALS, DroolsEditorType.SYMBOL); }
+ | LESS^ { helper.emit($LESS, DroolsEditorType.SYMBOL); }
+ | LESS_EQUALS^ { helper.emit($LESS_EQUALS, DroolsEditorType.SYMBOL); }
+ | NOT_EQUALS^ { helper.emit($NOT_EQUALS, DroolsEditorType.SYMBOL); }
+ | not_key?
+ ( operator_key^ square_chunk? )
+ )
+ { helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT); }
+ expression_value
+ ;
+
+//Simple Syntax Sugar
+compound_operator
+ at init { if ( state.backtracking==0 ) helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR); }
+ :
+ ( in_key^ | not_key in_key^ )
+ { helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT); }
+ LEFT_PAREN! { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ expression_value ( COMMA! { helper.emit($COMMA, DroolsEditorType.SYMBOL); } expression_value )*
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ { helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_END); }
+ ;
+finally {
+ if (helper.isEditorInterfaceEnabled && input.LA(2) == EOF && input.LA(1) == DOUBLE_PIPE) {
+ helper.emit(input.LT(1), DroolsEditorType.SYMBOL);
+ input.consume();
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
+ } }
+
+expression_value
+ : (accessor_path
+ | literal
+ | paren_chunk)
+ { if (helper.isEditorInterfaceEnabled && !(input.LA(1) == EOF && input.get(input.index() - 1).getType() != WS))
+ helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_END); }
+ ;
+finally {
+ if (helper.isEditorInterfaceEnabled && input.LA(2) == EOF) {
+ if (input.LA(1) == DOUBLE_PIPE) {
+ helper.emit(input.LT(1), DroolsEditorType.SYMBOL);
+ input.consume();
+ helper.emit(true, Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
+ }
+ }
+}
+
+pattern_type
+ : id+=ID ( id+=DOT id+=ID )*
+ { helper.emit($id, DroolsEditorType.IDENTIFIER);
+ helper.setParaphrasesValue(DroolsParaphraseTypes.PATTERN, helper.buildStringFromTokens($id)); }
+ dimension_definition*
+ -> ^(VT_PATTERN_TYPE ID+ dimension_definition*)
+ ;
+
+data_type
+ : id+=ID ( id+=DOT id+=ID )* dimension_definition*
+ { helper.emit($id, DroolsEditorType.IDENTIFIER); }
+ -> ^(VT_DATA_TYPE ID+ dimension_definition*)
+ ;
+
+dimension_definition
+ : LEFT_SQUARE { helper.emit($LEFT_SQUARE, DroolsEditorType.SYMBOL); }
+ RIGHT_SQUARE { helper.emit($RIGHT_SQUARE, DroolsEditorType.SYMBOL); }
+ ;
+
+accessor_path
+ : accessor_element ( DOT { helper.emit($DOT, DroolsEditorType.IDENTIFIER); } accessor_element )*
+ -> ^(VT_ACCESSOR_PATH accessor_element+)
+ ;
+
+accessor_element
+ : ID { helper.emit($ID, DroolsEditorType.IDENTIFIER); }
+ square_chunk*
+ -> ^(VT_ACCESSOR_ELEMENT ID square_chunk*)
+ ;
+
+// --------------------------------------------------------
+// CHUNKS
+// --------------------------------------------------------
+rhs_chunk
+ at init{
+ String text = "";
+} : rc=rhs_chunk_data {text = $rc.text;}
+ -> VT_RHS_CHUNK[$rc.start,text]
+ ;
+
+rhs_chunk_data
+ : THEN
+ { if ($THEN.text.equalsIgnoreCase("then")){
+ helper.emit($THEN, DroolsEditorType.KEYWORD);
+ helper.emit(Location.LOCATION_RHS);
+ } }
+ not_end_key*
+ end_key
+ SEMICOLON? { helper.emit($SEMICOLON, DroolsEditorType.KEYWORD); }
+ ;
+
+curly_chunk
+ at init{
+ String text = "";
+} : cc=curly_chunk_data[false] {text = $cc.text;}
+ -> VT_CURLY_CHUNK[$cc.start,text]
+ ;
+
+curly_chunk_data[boolean isRecursive]
+ : lc1=LEFT_CURLY
+ { if (!isRecursive) {
+ helper.emit($lc1, DroolsEditorType.SYMBOL);
+ } else {
+ helper.emit($lc1, DroolsEditorType.CODE_CHUNK);
+ }
+ }
+ (any=~ ( LEFT_CURLY | RIGHT_CURLY ) { helper.emit($any, DroolsEditorType.CODE_CHUNK); } | curly_chunk_data[true] )*
+ rc1=RIGHT_CURLY
+ { if (!isRecursive) {
+ helper.emit($rc1, DroolsEditorType.SYMBOL);
+ } else {
+ helper.emit($rc1, DroolsEditorType.CODE_CHUNK);
+ }
+ }
+ ;
+
+paren_chunk
+ at init{
+ String text = "";
+} : pc=paren_chunk_data[false] {text = $pc.text;}
+ -> VT_PAREN_CHUNK[$pc.start,text]
+ ;
+
+paren_chunk_data[boolean isRecursive]
+ : lp1=LEFT_PAREN
+ { if (!isRecursive) {
+ helper.emit($lp1, DroolsEditorType.SYMBOL);
+ } else {
+ helper.emit($lp1, DroolsEditorType.CODE_CHUNK);
+ }
+ }
+ (any=~ ( LEFT_PAREN | RIGHT_PAREN ) { helper.emit($any, DroolsEditorType.CODE_CHUNK); } | paren_chunk_data[true] )*
+ rp1=RIGHT_PAREN
+ { if (!isRecursive) {
+ helper.emit($rp1, DroolsEditorType.SYMBOL);
+ } else {
+ helper.emit($rp1, DroolsEditorType.CODE_CHUNK);
+ }
+ }
+ ;
+
+square_chunk
+ at init{
+ String text = "";
+} : sc=square_chunk_data[false] {text = $sc.text;}
+ -> VT_SQUARE_CHUNK[$sc.start,text]
+ ;
+
+square_chunk_data[boolean isRecursive]
+ : ls1=LEFT_SQUARE
+ { if (!isRecursive) {
+ helper.emit($ls1, DroolsEditorType.SYMBOL);
+ } else {
+ helper.emit($ls1, DroolsEditorType.CODE_CHUNK);
+ }
+ }
+ (any=~ ( LEFT_SQUARE | RIGHT_SQUARE ) { helper.emit($any, DroolsEditorType.CODE_CHUNK); }| square_chunk_data[true] )*
+ rs1=RIGHT_SQUARE
+ { if (!isRecursive) {
+ helper.emit($rs1, DroolsEditorType.SYMBOL);
+ } else {
+ helper.emit($rs1, DroolsEditorType.CODE_CHUNK);
+ }
+ }
+ ;
Added: labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Combined.g
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Combined.g (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Combined.g 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,5869 @@
+grammar DRLv6Combined;
+
+
+options {
+ language = Java;
+ output = AST;
+ ASTLabelType=CommonTree;
+ k=2;
+}
+
+
+
+tokens {
+
+
+ VT_COMPILATION_UNIT;
+ VT_PACKAGE_ID;
+ VT_PACKAGE;
+ VT_IMPORT_SECTION;
+ VT_ONTOLOGY_SECTION;
+ VT_DECLARATION_SECTION;
+ VT_RULEBASE_SECTION;
+
+ VT_GLOBAL_ID;
+ VT_DATA_TYPE;
+ VT_DIM_SIZE;
+
+ VT_IMPORT;
+ VT_FUNCTION_IMPORT;
+ VT_STAR;
+ VT_FUNCTION;
+ VT_FUNCTION_ID;
+ VT_PARAM;
+ VT_PARAM_LIST;
+ VT_NAME;
+
+ VT_TEMPLATE;
+ VT_TEMPLATE_ID;
+ VT_SLOT;
+ VT_SLOT_ID;
+
+ VT_TYPE_DECLARE;
+ VT_TYPE_DECLARE_ID;
+ VT_EXTENDS;
+ VT_DL_DEFINITION;
+ VT_DL_TYPE;
+ VT_FIELD;
+
+ VT_ENTITY_TYPE;
+
+ VT_RULE_ID;
+ VT_ATTRIBUTES;
+ VT_DIALECT;
+
+ VT_LHS;
+ VT_ARROW;
+
+ VT_RHS;
+ VT_THEN;
+ VT_CLOSURE;
+
+ VT_BRANCH;
+ VT_BRANCH_DEFAULT;
+ VT_BRANCH_LABEL;
+ VT_NEG_BRANCH_LABEL;
+
+ VT_RISING_EDGE;
+ VT_FALLING_EDGE;
+
+ VT_RHS_CHUNK;
+ VT_CURLY_CHUNK;
+ VT_SQUARE_CHUNK;
+ VT_PAREN_CHUNK;
+
+ VT_NEW_OBJ;
+ VT_TYPE;
+ VT_ARGS;
+ VT_MSR;
+
+ VT_AND_IMPLICIT;
+ VT_IMPLIES;
+ VT_OR;
+ VT_NEG;
+ VT_XOR;
+ VT_EQUIV;
+ VT_AND;
+
+ VT_HEDGE_VERY;
+ VT_HEDGE_MOL;
+
+ VT_EXISTS;
+ VT_FORALL;
+ VT_NEXISTS;
+ VT_COUNT;
+ VT_MIN;
+ VT_MAX;
+ VT_VALUE;
+
+ VT_PATTERN;
+ VT_NESTED_PATTERN;
+ VT_ENABLED;
+ VT_QUERY_PATTERN;
+
+ VT_POSITIONAL_VAR;
+ VT_POSITIONAL_CONST;
+ VT_POSITIONAL_INDEX;
+ VT_POSITIONAL_SKIP;
+
+ VT_BINDING;
+ VT_ACCESSOR;
+ VT_VERSION;
+ VT_INDEXER;
+ VT_INDEX_ALL;
+ VT_METHOD;
+ VT_EXPR;
+ VT_DEBUG_LEFT_EXPR;
+ VT_DEBUG_RIGHT_EXPR;
+ VT_OTHERWISE;
+
+ VT_FILTER;
+ VT_SET;
+
+ VT_SEQUENCE;
+ VT_TRAIL;
+ VT_TRAIL_NODE;
+
+ VT_LIST;
+ VT_RANGE;
+
+ VT_BEHAVIOR;
+ VT_ENTRYPOINT;
+ VT_ENTRYPOINT_ID;
+ VT_FROM_SOURCE;
+ VT_EXPRESSION_CHAIN;
+
+ VT_ACCUMULATE_LEFT;
+ VT_ACCUMULATE_RIGHT;
+ VT_ACCUMULATE_ITERATION;
+ VT_ACCUMULATE_FUNCTION;
+ VT_ACC_ITER_INIT;
+ VT_ACC_ITER_ACT;
+ VT_ACC_ITER_REV;
+ VT_ACC_ITER_RES;
+
+ VT_COLLECT_LIST;
+
+ VT_IRI;
+
+ /*
+ VT_ONTOLOGY;
+ VT_PREFIX;
+ VT_ANNOTATIONS;
+ VT_ANNOTATION;
+ VT_DL_DEFINITION;
+ VT_FIELD;
+ VT_KEYS;
+
+ VT_DL_TYPE;
+ VT_DL_PROP;
+ VT_DL_RESTRICTION;
+ VT_DL_RESTRICTED_TYPE;
+
+ VT_EQUIVALENTTO;
+ VT_SUBCLASSOF;
+ VT_DISJOINTWITH;
+ VT_DISJOINTUNIONOF;
+ VT_SUBPROPERTYOF;
+ VT_INVERSEOF;
+ VT_SUBPROPERTYCHAIN;
+ VT_DOMAIN;
+ VT_RANGE;
+
+ VT_FACTS;
+ VT_FACT;
+ VT_TYPES;
+ VT_SAMEAS;
+ VT_DIFFERENTFROM;
+
+ VT_EQV_CLASS;
+ VT_DIF_CLASS;
+ VT_EQV_PROP;
+ VT_DIF_PROP;
+ VT_EQV_INDV;
+ VT_DIF_INDV;
+
+
+ */
+
+
+
+
+
+
+ VK_A_ACTGROUP;
+ VK_A_AGENDAGROUP;
+ VK_A_AUTOFOCUS;
+ VK_A_CALENDAR;
+ VK_A_DATE_EFFECTIVE;
+ VK_A_DATE_EXPIRES;
+ VK_A_DEDUCTION;
+ VK_A_DIALECT;
+ VK_A_DIRECTION_ABDUCTIVE;
+ VK_A_DIRECTION_DEDUCTIVE;
+ VK_A_DIRECTION_EQUIVALENCE;
+ VK_A_DURATION;
+ VK_A_ENABLED;
+ VK_A_IMPLICATION;
+ VK_A_LOCKONACTIVE;
+ VK_A_NOLOOP;
+ VK_A_RULEFLOWGROUP;
+ VK_A_SALIENCE;
+ VK_A_TIMER;
+ VK_ACC;
+ VK_ACCL;
+ VK_ACCUMULATE;
+ VK_ACCUMULATE_RIGHT;
+ VK_ACTION;
+ VK_ACTIVATION;
+ VK_ACTIVE;
+ VK_AGENDA;
+ VK_ALL;
+ VK_AND;
+ VK_ANNOTATIONS;
+ VK_ANOTHER;
+ VK_AS;
+ VK_ATTRIBUTES;
+ VK_AUTO;
+ VK_AVERAGE;
+ VK_BOOL;
+ VK_BOOLEAN;
+ VK_BRANCH;
+ VK_BYTE;
+ VK_CALENDARS;
+ VK_CHAR;
+ VK_CHARACTERISTICS;
+ VK_CLASS;
+ VK_CLOSURE;
+ VK_COLLECT;
+ VK_COLLECT_LIST;
+ VK_CONTAINS;
+ VK_COUNT;
+ VK_DATATYPE;
+ VK_DATE;
+ VK_DECLARE;
+ VK_DEFEATS;
+ VK_DIALECT;
+ VK_DIFFERENT_INDIVIDUALS;
+ VK_DIFFERENTFROM;
+ VK_DISJOINT;
+ VK_DISJOINT_CLASSES;
+ VK_DISJOINT_PROPERTIES;
+ VK_DISJOINT_UNION;
+ VK_DISTINCT;
+ VK_DO;
+ VK_DOMAIN;
+ VK_DOUBLE;
+ VK_DURATION;
+ VK_EFFECTIVE;
+ VK_ENABLED;
+ VK_END;
+ VK_ENTITY;
+ VK_ENTRY;
+ VK_ENTRYPOINT;
+ VK_EQUIV;
+ VK_EQUIVALENT_CLASSES;
+ VK_EQUIVALENT_PROPERTIES;
+ VK_EQUIVALENTTO;
+ VK_EVAL;
+ VK_EVENT;
+ VK_EXACTLY;
+ VK_EXCLUDES;
+ VK_EXISTS;
+ VK_EXPIRES;
+ VK_EXTEND;
+ VK_EXTENDS;
+ VK_FACTS;
+ VK_FALLING;
+ VK_FILTER;
+ VK_FLOAT;
+ VK_FOCUS;
+ VK_FORALL;
+ VK_FROM;
+ VK_FUNCTION;
+ VK_GLOBAL;
+ VK_GROUP;
+ VK_HASKEY;
+ VK_IMPLIES;
+ VK_IMPORT;
+ VK_IN;
+ VK_INDIVIDUAL;
+ VK_INIT;
+ VK_INSERT;
+ VK_INSERT_LOG;
+ VK_INSTANCEOF;
+ VK_INT;
+ VK_INVERSE;
+ VK_INVERSEOF;
+ VK_JAVA;
+ VK_KEY;
+ VK_LENGTH;
+ VK_LENGTH_MAX;
+ VK_LENGTH_MIN;
+ VK_LIMIT;
+ VK_LOCK;
+ VK_LONG;
+ VK_LOOP;
+ VK_MATCHES;
+ VK_MAX;
+ VK_MDA_FUNCTIONAL;
+ VK_MDA_FUNCTIONAL_INV;
+ VK_MDA_REFLEXIVE;
+ VK_MDA_REFLEXIVE_INV;
+ VK_MDA_SYMMETRIC;
+ VK_MDA_SYMMETRIC_INV;
+ VK_MDA_TRANSITIVE;
+ VK_MEMBEROF;
+ VK_MIN;
+ VK_MODIFY;
+ VK_MODIFY_LOG;
+ VK_MOL;
+ VK_MVEL;
+ VK_NAMESPACE;
+ VK_NEG;
+ VK_NEW;
+ VK_NO;
+ VK_NOT;
+ VK_NULL;
+ VK_OA_CRISP;
+ VK_OA_DEFAULT;
+ VK_OA_DEFEAT;
+ VK_OA_DEGREE;
+ VK_OA_ID;
+ VK_OA_KIND;
+ VK_OA_MERGE;
+ VK_OA_MISSING;
+ VK_OA_OTHERWISE;
+ VK_OA_PARAMS;
+ VK_ON;
+ VK_ONCHANGE;
+ VK_ONLY;
+ VK_ONTOLOGY;
+ VK_OR;
+ VK_ORDERBY;
+ VK_OTHERWISE;
+ VK_OVER;
+ VK_PACKAGE;
+ VK_PATTERN;
+ VK_PATTERN_LANG;
+ VK_POINT;
+ VK_PREFIX;
+ VK_PROPERTY;
+ VK_PROPERTY_ANNOTATION;
+ VK_PROPERTY_DATA;
+ VK_PROPERTY_OBJECT;
+ VK_QUERY;
+ VK_RANGE;
+ VK_RESULT;
+ VK_RETRACT;
+ VK_RETRACT_LOG;
+ VK_REVERSE;
+ VK_RISING;
+ VK_ROLE;
+ VK_RULE;
+ VK_RULEFLOW;
+ VK_SALIENCE;
+ VK_SAME_INDIVIDUAL;
+ VK_SAMEAS;
+ VK_SELF;
+ VK_SEQ;
+ VK_SHORT;
+ VK_SOME;
+ VK_SOUNDSLIKE;
+ VK_START;
+ VK_SUBCLASSOF;
+ VK_SUBPROPERTYCHAIN;
+ VK_SUBPROPERTYOF;
+ VK_SUM;
+ VK_SUPER;
+ VK_TEMPLATE;
+ VK_THAT;
+ VK_THEN;
+ VK_THIS;
+ VK_THROTTLE;
+ VK_TIME;
+ VK_TIMER;
+ VK_TYPE;
+ VK_TYPE_BOOLEAN;
+ VK_TYPE_DOUBLE;
+ VK_TYPE_FLOAT;
+ VK_TYPE_INTEGER;
+ VK_TYPE_STRING;
+ VK_TYPES;
+ VK_UNIQUE;
+ VK_UPDATE;
+ VK_VALUE;
+ VK_VERY;
+ VK_VOID;
+ VK_WHEN;
+ VK_WINDOW;
+ VK_XOR;
+ VK_OPERATOR;
+ VK_LOCK_ON_ACTIVE;
+ VK_DATE_EFFECTIVE;
+ VK_DATE_EXPIRES;
+ VK_NO_LOOP;
+ VK_AUTO_FOCUS;
+ VK_ACTIVATION_GROUP;
+ VK_AGENDA_GROUP;
+ VK_RULEFLOW_GROUP;
+ VK_ENTRY_POINT;
+ VK_PRIMITIVE_TYPE;
+
+}
+//import General, Expression;
+//import DRLv6Keywords, Attributes, Manchester;
+
+
+
+ at lexer::header {
+ package org.drools.lang;
+
+ import java.util.List;
+ import java.util.LinkedList;
+ import java.util.Set;
+ import java.util.HashSet;
+ import org.drools.compiler.DroolsParserException;
+}
+
+ at parser::header {
+ package org.drools.lang;
+
+ import java.util.List;
+ import java.util.LinkedList;
+ import java.util.Set;
+ import java.util.HashSet;
+ import org.drools.compiler.DroolsParserException;
+}
+
+ at members {
+
+ private Tree curField;
+ private Set prefixes = new HashSet();
+ private ParserHelper helper = new ParserHelper( null,
+ tokenNames,
+ input,
+ state );
+
+ /**
+ * The dummy parameter bellow is just to enable constructor overloading
+ * so that we can initialise the parser helper on delegate grammars
+ */
+ public DRLv6CombinedParser(TokenStream input, boolean dummy ) {
+ this(input);
+// gDRLv6Keywords.setParserHelper( helper );
+// gExpression.setParserHelper( helper );
+// gGeneral.setParserHelper( helper );
+// gAttributes.setParserHelper( helper );
+// gManchester.setParserHelper( helper );
+// gManchester.setPrefixSet( prefixes );
+ }
+
+ public ParserHelper getHelper() { return helper; }
+ public boolean hasErrors() { return helper.hasErrors(); }
+ public List<DroolsParserException> getErrors() { return helper.getErrors(); }
+ public List<String> getErrorMessages() { return helper.getErrorMessages(); }
+ public void enableEditorInterface() { helper.enableEditorInterface(); }
+ public void disableEditorInterface() { helper.disableEditorInterface(); }
+ public LinkedList<DroolsSentence> getEditorInterface() { return helper.getEditorInterface(); }
+ public void reportError(RecognitionException ex) { helper.reportError( ex ); }
+
+
+
+
+
+}
+
+
+
+compilation_unit
+ : package_statement?
+ import_section
+ declaration_section
+ ontology_section?
+ rulebase_section?
+ EOF
+ -> ^(VT_COMPILATION_UNIT package_statement?
+ ^(VT_IMPORT_SECTION import_section?)
+ ^(VT_DECLARATION_SECTION declaration_section?)
+ ^(VT_ONTOLOGY_SECTION ontology_section?)
+ ^(VT_RULEBASE_SECTION rulebase_section?)
+ )
+ ;
+
+
+
+
+
+package_statement
+ : package_key package_id SEMICOLON?
+ -> ^(VT_PACKAGE package_id)
+ ;
+
+package_id
+ : procedural_name
+ ;
+
+
+
+
+import_section
+ : general_import_statement*
+ ;
+
+
+general_import_statement
+options{
+ k=3;
+}
+ : function_import_statement
+ | import_statement
+ ;
+
+
+
+declaration_section
+ : declaration_statement*
+ ;
+
+declaration_statement
+ : global
+ | function
+ ;
+
+ontology_section
+ : //manDL_ontology
+ ontology_key
+ ;
+
+rulebase_section
+ : rulebase_statement+
+ ;
+
+rulebase_statement
+ : rule
+ | query
+ ;
+
+
+
+
+
+
+global
+ : global_key data_type global_id SEMICOLON?
+ -> ^(global_key data_type global_id)
+ ;
+
+global_id
+ : id=ID
+ -> VT_GLOBAL_ID[$id]
+ ;
+
+
+
+
+
+
+
+import_statement
+ : import_key import_name SEMICOLON?
+ -> ^(VT_IMPORT import_name)
+ ;
+
+function_import_statement
+ : import_key function_key import_name SEMICOLON?
+ -> ^(VT_FUNCTION_IMPORT import_name)
+ ;
+
+import_name
+ : procedural_name star=DOT_STAR?
+ -> {star==null}? procedural_name
+ -> ^(VT_STAR procedural_name)
+ ;
+
+
+
+
+function
+ : function_key data_type? function_id parameters curly_chunk
+ -> ^(VT_FUNCTION data_type? function_id parameters curly_chunk)
+ ;
+
+function_id
+ : id=ID
+ -> VT_FUNCTION_ID[$id]
+ ;
+
+
+
+
+
+
+
+
+
+rule
+ : rule_key {System.out.println("rule - check for rule key");}
+ rule_id parameters? {System.out.println("rule - check for rule params");}
+ (extends_key rule_id)? {System.out.println("rule - check for rule ext");}
+ //rule_attributes? {System.out.println("rule - check for rule atts");}
+ rule_arrow? {System.out.println("rule - check for rule arrow");}
+ when_part {System.out.println("rule - check for rule when");}
+ then_part {System.out.println("rule - check for rule then");}
+ -> ^(rule_key rule_id
+ ^(VT_EXTENDS rule_id)?
+ parameters?
+ // rule_attributes?
+ rule_arrow?
+ when_part?
+ then_part)
+ ;
+
+
+
+rule_id
+ : id=ID
+ -> VT_RULE_ID[$id]
+ | id=STRING
+ -> VT_RULE_ID[$id]
+ ;
+
+
+rule_arrow
+ : (
+ (implication) => implication deduction?
+ | (deduction) => deduction implication?
+ )
+ -> ^(VT_ARROW implication? deduction?)
+ ;
+
+deduction
+ : ra_deduction_key^ operator_attributes
+ ;
+
+
+implication
+ : ra_implication_key^ operator_attributes
+ ;
+
+
+
+
+
+
+
+when_part
+ : (
+ when_key
+ lhs_root?
+ )
+ -> ^(VT_LHS lhs_root?)
+ ;
+
+lhs_root
+ : lhs_implies more=lhs_implies*
+ -> {more==null}? lhs_implies
+ -> ^(VT_AND_IMPLICIT lhs_implies+)
+ ;
+
+lhs_base
+ : LEFT_PAREN! lhs_root RIGHT_PAREN!
+ | lhs_atom_pattern
+ ;
+
+
+lhs_implies
+ : left=lhs_or (imp=imply_connective operator_attributes? right=lhs_or)?
+ -> {imp != null}? ^($imp operator_attributes? $left $right)
+ -> ^($left)
+ ;
+
+
+lhs_or
+ : (lhs_diff -> lhs_diff)
+ (
+ or_connective ops=operator_attributes? right=lhs_diff
+ -> ^(or_connective $ops? $lhs_or $right)
+ )*
+ ;
+
+
+
+
+
+
+lhs_diff
+ : lhs_and (( xor_connective^ | eq_connective^ ) operator_attributes? lhs_and)?
+ ;
+
+
+
+
+
+lhs_and
+ : (lhs_unary -> lhs_unary)
+ (
+ and_connective ops=operator_attributes? right=lhs_unary
+ -> ^(and_connective $ops? $lhs_and $right)
+ )*
+ ;
+
+
+
+lhs_unary
+options{
+ k=*;
+}
+ : lhs_modified_unary filter_chain^?
+ | lhs_query
+ ;
+
+lhs_modified_unary
+options{
+ k=*;
+ backtrack=true;
+}
+ :
+ unary_operator^ operator_attributes? lhs_modified_unary
+ | LEFT_PAREN! lhs_root RIGHT_PAREN!
+ | lhs_quantifiexpr
+ | lhs_edge
+ | lhs_branch
+ | lhs_sequence
+ | lhs_label_atom_pattern
+ | relation_join_pattern
+ ;
+
+
+
+//TODO
+relation_join_pattern
+ : empty_prefix_name^ another_modifier?
+ ;
+
+another_modifier
+ : another_key
+ ;
+
+
+
+lhs_quantifiexpr
+ : lhs_exists
+ | lhs_not
+ | lhs_forall
+ ;
+
+
+lhs_exists
+ : lab=label? exists_key operator_attributes?
+ lhs_base
+ -> {lab==null}? ^(VT_EXISTS operator_attributes? lhs_base)
+ -> ^(VT_BINDING label ^(VT_EXISTS operator_attributes? lhs_base))
+ ;
+
+
+
+lhs_forall
+ : forall_key operator_attributes?
+ (
+ pat=lhs_atom_pattern
+ | LEFT_PAREN lhs_unary lhs_unary RIGHT_PAREN
+ )
+ -> {pat!=null}? ^(VT_FORALL operator_attributes? lhs_atom_pattern)
+ -> ^(VT_FORALL operator_attributes? lhs_unary lhs_unary)
+ ;
+
+lhs_not
+ : not_key operator_attributes? lhs_base
+ -> ^(VT_NEXISTS operator_attributes? lhs_base)
+ ;
+
+
+lhs_label_atom_pattern
+ : lab=label? ( lhs_atom_pattern | ordered_obj_pattern )
+ -> {lab==null}? lhs_atom_pattern? ordered_obj_pattern?
+ -> ^(VT_BINDING label lhs_atom_pattern ordered_obj_pattern?)
+ ;
+
+
+lhs_atom_pattern
+ : procedural_name LEFT_PAREN constraints? RIGHT_PAREN
+ pattern_attributes? from?
+ -> ^(VT_PATTERN
+ ^(VT_AND pattern_attributes?
+ VT_ENABLED ^(VT_TYPE procedural_name) constraints?
+ ) from?
+ )
+ ;
+
+
+
+
+
+
+lhs_edge
+ : rising_key lhs_base
+ -> ^(VT_RISING_EDGE lhs_base)
+ | falling_key lhs_base
+ -> ^(VT_FALLING_EDGE lhs_base)
+ ;
+
+
+lhs_branch
+ : branch_key
+ LEFT_PAREN
+ lhs_base?
+ branch_alternative+
+ RIGHT_PAREN
+ -> ^(VT_BRANCH ^(VT_BRANCH_DEFAULT lhs_base)? branch_alternative+ )
+ ;
+
+branch_alternative
+ : branch_label^ lhs_base
+ ;
+
+branch_label
+ : LESS neg=NEG_MARK? ID GREATER
+ -> {neg!=null}? ^(VT_NEG_BRANCH_LABEL ID)
+ -> ^(VT_BRANCH_LABEL ID)
+ ;
+
+
+
+filter_chain
+ : PIPE filter (PIPE filter)*
+ -> ^(VT_FILTER filter+ )
+ ;
+
+filter
+ : over_filter
+ | unique_filter
+ | throttle_filter
+ | filter_key ID
+ ;
+
+
+
+
+lhs_sequence
+ :
+ seq_key LEFT_PAREN
+ trail+
+ RIGHT_PAREN
+ -> ^(VT_SEQUENCE trail+)
+ ;
+
+trail
+ : trail_path
+ -> ^(VT_TRAIL trail_path)
+ ;
+
+trail_path
+ : trail_node
+ (lhs_root DOUBLE_GREATER! trail_node)+
+ SEMICOLON!
+ ;
+
+trail_node
+ : ID trail_attributes?
+ -> ^(VT_TRAIL_NODE ID trail_attributes?)
+ ;
+
+
+
+
+constraints
+scope {
+ int j;
+}
+ :
+ general_constraint {$constraints::j++;}
+ (COMMA general_constraint {$constraints::j++;})*
+ -> ^(VT_AND general_constraint+)
+ ;
+
+positional_constraints
+scope {
+ int k;
+}
+ :
+ positional_constraint {$positional_constraints::k++;}
+ (COMMA positional_constraint {$positional_constraints::k++;})*
+ -> ^(VT_AND positional_constraint+)
+ ;
+
+
+general_constraint
+ : (slotted_constraint) => slotted_constraint
+ | positional_constraint
+ ;
+
+
+positional_constraint
+ at init{
+
+ String idx;
+ if ( constraints_stack.isEmpty()) {
+ idx = ""+$positional_constraints::k;
+ } else {
+ idx = ""+$constraints::j;
+ }
+
+}
+ :
+ (
+ right_expression
+ -> ^(VT_POSITIONAL_CONST VT_POSITIONAL_INDEX[$start,idx] ^(EQUAL right_expression))
+
+ | QUESTION_MARK rest=restriction_root?
+ ->{rest==null}? ^(VT_POSITIONAL_SKIP VT_POSITIONAL_INDEX[$start,idx])
+ -> ^(VT_POSITIONAL_CONST VT_POSITIONAL_INDEX[$start,idx] restriction_root)
+ )
+ ;
+
+slotted_constraint
+options{
+ backtrack=true;
+}
+ :
+ nested_accessor_path
+ |
+ constr_implies
+ ;
+
+
+
+
+
+constr_implies
+ : left=constr_or
+ (imp=imply_symbol operator_attributes? right=constr_or)?
+ -> {imp != null}? ^($imp operator_attributes? $left $right)
+ -> ^($left)
+ ;
+
+
+
+constr_or
+ : (constr_diff -> constr_diff)
+ (
+ or_symbol ops=operator_attributes? right=constr_diff
+ -> ^(or_symbol $ops? $constr_or $right)
+ )*
+ ;
+
+
+constr_diff
+ : constr_and (( xor_symbol^ | eq_symbol^ ) operator_attributes? constr_and)?
+ ;
+
+
+
+
+constr_and
+ : (constr_unary -> constr_unary)
+ (
+ and_symbol ops=operator_attributes? right=constr_unary
+ -> ^(and_symbol $ops? $constr_and $right)
+ )*
+ ;
+
+
+
+constr_unary
+options{
+ backtrack=true;
+} // required!
+ : unary_operator^ operator_attributes? constr_unary
+ | constr_atom
+ | LEFT_PAREN! constr_implies RIGHT_PAREN!
+ ;
+
+
+constr_atom
+options{
+ backtrack=true;
+}
+ : bound_constrained_expr
+ | constrained_expr
+ | bound_expr
+ ;
+
+bound_constrained_expr
+ :
+ bound_expr restr=restriction_root
+ -> ^(VT_AND_IMPLICIT
+ bound_expr
+ $restr
+ )
+ ;
+
+constrained_expr
+ :
+ expr_root restr=restriction_root
+ -> ^(VT_AND_IMPLICIT
+ ^(VT_EXPR expr_root)
+ $restr
+ )
+ ;
+
+bound_expr
+options{
+ backtrack=true;
+}
+ : label general_accessor_path
+ -> ^(VT_BINDING label ^(VT_EXPR general_accessor_path))
+ | label LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_BINDING label ^(VT_EXPR expr_root))
+ ;
+
+
+
+
+
+
+ /*
+ left_expression
+ : (VAR COLON) => label
+ (
+ expr_root
+ -> ^(VT_BINDING label ^(VT_DEBUG_LEFT_EXPR expr_root))
+ )
+ | expr_root
+ -> ^(VT_DEBUG_LEFT_EXPR expr_root)
+ ;
+ */
+
+
+restriction_root
+ : restr_implies
+ ;
+
+
+
+
+restr_implies
+ : left=restr_or
+ (
+ (imply_symbol operator_attributes? restr_unary) =>
+ imp=imply_symbol operator_attributes?
+ right=restr_or
+
+ )?
+ -> {imp != null}? ^($imp operator_attributes? $left $right)
+ -> ^($left)
+ ;
+
+
+
+
+restr_or
+ : (restr_diff -> restr_diff)
+ (
+ (or_symbol operator_attributes? restr_diff) =>
+ or_symbol ops=operator_attributes? right=restr_diff
+ -> ^(or_symbol $ops? $restr_or $right)
+ )*
+ ;
+
+
+
+restr_diff
+ : restr_and
+ (
+ (( xor_symbol^ | eq_symbol^ ) operator_attributes? restr_and) =>
+ ( xor_symbol^ | eq_symbol^ ) operator_attributes? restr_and
+ )?
+ ;
+
+
+
+restr_and
+ : (restr_unary -> restr_unary)
+ (
+ (and_symbol operator_attributes? restr_unary) =>
+ and_symbol ops=operator_attributes? right=restr_unary
+ -> ^(and_symbol $ops? $restr_and $right)
+ )*
+ ;
+
+
+
+restr_unary
+ : unary_operator operator_attributes? restr_unary
+ | LEFT_PAREN! restr_implies RIGHT_PAREN!
+ | restr_atom
+ ;
+
+
+restr_atom
+options{
+ backtrack=true;
+}
+ : qnt=inner_quantifier? eval=evaluator operator_attributes? right_expression
+ -> {qnt==null}? ^(evaluator operator_attributes? right_expression)
+ -> ^(inner_quantifier ^(evaluator operator_attributes? right_expression))
+ ;
+
+
+
+
+right_expression
+ : expr_root
+ -> ^(VT_DEBUG_RIGHT_EXPR expr_root)
+ | otherwise_key
+ -> ^(VT_OTHERWISE)
+ ;
+
+
+
+
+nested_accessor_path
+ : general_accessor_path^ DOT! nested_obj_pattern
+ | nested_obj_pattern
+ ;
+
+
+general_accessor_path
+options{
+ backtrack=true;
+}
+ : accessor_path
+ | var
+ ;
+
+accessor_path
+ : accessor (DOT accessor)*
+ -> ^(VT_ACCESSOR accessor+)
+ | var (DOT accessor)+
+ -> ^(VT_ACCESSOR var accessor+)
+ ;
+
+
+
+
+accessor
+options{
+ backtrack=true;
+ k=*;
+}
+ :
+ m=method ix=indexer?
+ {
+ if (ix != null ) {
+ Tree t = ix.tree;
+ Tree temp = t.getChild(0);
+ t.setChild(0,m.tree);
+ t.addChild(temp);
+ }
+ }
+ -> {ix==null}? ^($m)
+ -> ^($ix)
+ | id=versioned_accessor ix=indexer?
+ {
+ if (ix != null ) {
+ Tree t = ix.tree;
+ Tree temp = t.getChild(0);
+ t.setChild(0,id.tree);
+ t.addChild(temp);
+ }
+ }
+ -> {ix==null}? ^($id)
+ -> ^($ix)
+ ;
+
+
+versioned_accessor
+ : ID v=version?
+ -> {v!=null}? ^(VT_VERSION ID version)
+ -> ID
+ ;
+
+
+version
+options{
+ k=3;
+}
+ : DOUBLE_LESS! DECIMAL DOUBLE_GREATER!
+ | DOUBLE_LESS! integer_range DOUBLE_GREATER!
+ ;
+
+
+
+nested_obj_pattern
+ : GATE fqn=procedural_name? LEFT_PAREN constraints RIGHT_PAREN
+ -> {fqn==null}? ^(VT_NESTED_PATTERN constraints )
+ -> ^(VT_NESTED_PATTERN
+ ^(VT_AND ^(VT_TYPE procedural_name) constraints )
+ )
+ ;
+
+
+indexer
+ : LEFT_SQUARE
+ (
+ DECIMAL
+ -> ^(VT_INDEXER DECIMAL)
+ | STRING
+ -> ^(VT_INDEXER STRING)
+ | method
+ -> ^(VT_INDEXER method)
+ | GATE lhs_label_atom_pattern
+ -> ^(VT_INDEXER lhs_label_atom_pattern)
+ )
+ RIGHT_SQUARE
+
+ | LEFT_SQUARE RIGHT_SQUARE
+ -> ^(VT_INDEXER VT_INDEX_ALL)
+
+ ;
+
+
+
+
+
+
+
+
+
+over_filter
+ : id1=window_key DOUBLE_COLON
+ ( id2=time_key paren_chunk
+ -> ^(VT_BEHAVIOR $id1 $id2 paren_chunk)
+ | id3=length_key LEFT_PAREN DECIMAL RIGHT_PAREN
+ -> ^(VT_BEHAVIOR $id1 $id3 DECIMAL)
+ )
+ ;
+
+unique_filter
+ : unique_key
+ -> ^(VT_BEHAVIOR unique_key)
+ ;
+
+throttle_filter
+ : throttle_key LEFT_PAREN DECIMAL RIGHT_PAREN
+ -> ^(VT_BEHAVIOR throttle_key DECIMAL)
+ ;
+
+
+
+
+from
+ : from_key^
+ ( accumulate_statement
+ | collect_statement
+ | entrypoint_statement
+ | from_source
+ )
+ ;
+
+
+
+
+collect_statement
+ : collect_key
+ LEFT_PAREN
+ lhs_label_atom_pattern
+ RIGHT_PAREN
+ -> ^(collect_key lhs_label_atom_pattern)
+ ;
+
+entrypoint_statement
+ : entry_point_key
+ entrypoint_id
+ -> ^(VT_ENTRYPOINT entrypoint_id)
+ ;
+
+
+entrypoint_id
+ : value=ID
+ -> VT_ENTRYPOINT_ID[$value]
+ | value=STRING
+ -> VT_ENTRYPOINT_ID[$value]
+ ;
+
+from_source
+options{
+ k=*;
+}
+ : var
+ | accessor_path
+ | LEFT_SQUARE! literal_list RIGHT_SQUARE!
+ | LEFT_SQUARE! var_list RIGHT_SQUARE!
+ | LEFT_SQUARE! integer_range RIGHT_SQUARE!
+ ;
+
+
+
+
+accumulate_statement
+ : acc_left
+ | acc_right
+ ;
+
+
+acc_left
+ : (accumulate_key | accL_key | acc_key ) accumulate_body
+ -> ^(VT_ACCUMULATE_LEFT accumulate_body)
+ ;
+
+acc_right
+ : accR_key accumulate_body
+ -> ^(VT_ACCUMULATE_RIGHT accumulate_body)
+ ;
+
+accumulate_body
+ : LEFT_PAREN
+ lhs_root
+ ( COMMA
+ (
+ l=label? accumulate_functions
+ | accumulate_iteration
+ )
+ )?
+ RIGHT_PAREN
+ -> {l==null}? lhs_root accumulate_iteration? accumulate_functions?
+ -> lhs_root ^(VT_BINDING label accumulate_functions?)
+ ;
+
+
+accumulate_functions
+ : acc_collect_list
+ | acc_avg
+ | acc_min
+ | acc_max
+ | acc_sum
+ | acc_count
+ | acc_distinct
+ | acc_orderby
+ | acc_limit
+
+ ;
+
+
+
+
+
+acc_collect_list
+ : collectList_key
+ LEFT_PAREN
+ ( (constr_implies) => constr_implies
+ | expr_root )
+ RIGHT_PAREN
+ -> ^(VT_COLLECT_LIST constr_implies? expr_root? )
+ ;
+
+acc_avg
+ : avg_key LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION avg_key ^(VT_EXPR expr_root))
+ ;
+
+acc_min
+ : min_key LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION min_key ^(VT_EXPR expr_root))
+ ;
+
+acc_max
+ : max_key LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION max_key ^(VT_EXPR expr_root))
+ ;
+
+acc_sum
+ : sum_key LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION sum_key ^(VT_EXPR expr_root))
+ ;
+
+acc_count
+ : count_key LEFT_PAREN RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION count_key)
+ ;
+
+acc_distinct
+ : distinct_key LEFT_PAREN gen_accessor_list RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION distinct_key gen_accessor_list)
+ ;
+
+acc_orderby
+ : orderby_key LEFT_PAREN gen_accessor_list RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION orderby_key gen_accessor_list)
+ ;
+
+acc_limit
+ : limit_key LEFT_PAREN DECIMAL RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION limit_key DECIMAL)
+ ;
+
+
+
+accumulate_iteration
+ : init_key pc1=accumulate_paren_chunk COMMA?
+ action_key pc2=accumulate_paren_chunk COMMA?
+ reverse_key pc3=accumulate_paren_chunk COMMA?
+ result_key pc4=accumulate_paren_chunk COMMA?
+ -> ^(VT_ACCUMULATE_ITERATION ^(VT_ACC_ITER_INIT $pc1) ^(VT_ACC_ITER_ACT $pc2) ^(VT_ACC_ITER_REV $pc3)? ^(VT_ACC_ITER_RES $pc4))
+ ;
+
+
+accumulate_paren_chunk
+ at init{
+ String text = "";
+}
+ : pc=accumulate_paren_chunk_data[false] {text = $pc.text;}
+ -> VT_PAREN_CHUNK[$pc.start,text]
+ ;
+
+accumulate_paren_chunk_data[boolean isRecursive]
+ : LEFT_PAREN
+ (any=~ ( LEFT_PAREN | RIGHT_PAREN )
+ | accumulate_paren_chunk_data[true] )*
+ RIGHT_PAREN
+ ;
+
+
+
+
+
+
+query
+ : query_key ID parameters?
+ query_body+
+ end_key
+ -> ^(query_key ID parameters? ^(VT_AND_IMPLICIT query_body+) )
+ ;
+
+query_body
+ : lhs_label_atom_pattern
+ | lhs_query
+ ;
+
+
+lhs_query
+ : QUESTION_MARK ID LEFT_PAREN
+ positional_constraints?
+ RIGHT_PAREN query_attributes? from?
+ -> ^(VT_QUERY_PATTERN ID
+ query_attributes?
+ positional_constraints?
+ from?
+ )
+ ;
+
+
+
+
+
+
+
+
+
+
+inner_quantifier
+ : (only_key | all_key) -> VT_FORALL
+ | some_key -> VT_EXISTS
+ | value_key -> VT_VALUE
+ | count_key (AT LEFT_SQUARE
+ (
+ val=DECIMAL
+ | inner_attrs
+ )
+ RIGHT_SQUARE)
+ -> {val!=null}? ^(VT_COUNT ^(VT_MIN $val) ^(VT_MAX $val))
+ -> ^(VT_COUNT inner_attrs )
+ ;
+
+
+
+
+evaluator
+ : (TILDE!)?
+ (
+ simple_evaluator
+ | complex_evaluator
+ | custom_evaluator
+ // TODO : | temporal_evaluator
+ )
+ ;
+
+simple_evaluator
+ : EQUAL^
+ | GREATER^
+ | GREATER_EQUAL^
+ | LESS^
+ | LESS_EQUAL^
+ | NOT_EQUAL^
+ ;
+
+complex_evaluator
+ : in_key
+ | contains_key
+ ;
+
+custom_evaluator
+ : ID
+ ;
+
+
+
+
+
+
+
+imply_connective
+ : implies_key
+ -> ^(VT_IMPLIES)
+ ;
+
+or_connective
+ : or_key
+ -> ^(VT_OR)
+ ;
+
+and_connective
+ : and_key
+ -> ^(VT_AND)
+ ;
+
+xor_connective
+ : xor_key
+ -> ^(VT_XOR)
+ ;
+
+eq_connective
+ : equiv_key
+ -> ^(VT_EQUIV)
+ ;
+
+
+imply_symbol
+ : ARROW
+ -> ^(VT_IMPLIES)
+ ;
+
+or_symbol
+ : DOUBLE_PIPE
+ -> ^(VT_OR)
+ ;
+
+and_symbol
+ : DOUBLE_AMPER
+ -> ^(VT_AND)
+ ;
+
+xor_symbol
+ : DOUBLE_ANG
+ -> ^(VT_XOR)
+ ;
+
+eq_symbol
+ : DOUBLE_COLON
+ -> ^(VT_EQUIV)
+ ;
+
+
+unary_operator
+ : neg_key
+ -> ^(VT_NEG)
+ | hedge^
+ ;
+
+
+hedge
+ : very_key
+ -> ^(VT_HEDGE_VERY)
+ | mol_key
+ -> ^(VT_HEDGE_VERY)
+ ;
+
+
+
+
+
+
+then_part
+ :
+ (then_key) => rhs_then
+ | (do_key) => rhs_do
+ ;
+
+
+rhs_then
+ : then_key then? (closure_key closure)? end_key
+ -> ^(VT_RHS then? closure?)
+ ;
+
+rhs_do
+ : do_key LEFT_CURLY rhs_atom* RIGHT_CURLY
+ -> ^(VT_RHS ^(VT_THEN rhs_atom+) )
+ ;
+
+then
+ : rhs_atom+
+ -> ^(VT_THEN rhs_atom+)
+ ;
+
+closure
+ : rhs_atom+
+ -> ^(VT_CLOSURE rhs_atom+)
+ ;
+
+
+rhs_atom
+ : rhs_insert
+ | rhs_insert_logical
+ | rhs_retract
+ | rhs_retract_logical
+ | rhs_update
+ | rhs_modify
+ | rhs_modify_logical
+ | rhs_side_effect
+ ;
+
+rhs_insert
+ : insert_key^ literal_object
+ SEMICOLON!
+ ;
+
+rhs_insert_logical
+ : insertLogical_key^ literal_object
+ SEMICOLON!
+ ;
+
+rhs_retract
+ : retract_key^
+ ( literal_object
+ | var
+ )
+ SEMICOLON!
+ ;
+
+rhs_retract_logical
+ : retractLogical_key^
+ ( literal_object
+ | var
+ )
+ SEMICOLON!
+ ;
+
+rhs_update
+ : update_key^
+ var
+ SEMICOLON!
+ ;
+
+rhs_modify
+ : modify_key^ LEFT_PAREN! var RIGHT_PAREN!
+ LEFT_CURLY!
+ set_action+
+ RIGHT_CURLY!
+ SEMICOLON?
+ ;
+
+rhs_modify_logical
+ : modifyLogical_key^ LEFT_PAREN! var RIGHT_PAREN!
+ LEFT_CURLY!
+ set_action+
+ RIGHT_CURLY!
+ SEMICOLON?
+ ;
+
+set_action
+ : accessor_path EQUALS
+ right_expression
+ SEMICOLON
+ -> ^(VT_SET accessor_path
+ right_expression
+ )
+ ;
+
+
+rhs_side_effect
+ at init{
+ String text = "";
+}
+ :
+ LESS_PERCENT rc=side_effect_chunk {text = $rc.text;} PERCENT_GREATER
+ -> VT_RHS_CHUNK[$rc.start,text]
+ | LESS dialect MOD
+ rc=side_effect_chunk {text = $rc.text;}
+ PERCENT_GREATER
+ -> ^(VT_DIALECT dialect VT_RHS_CHUNK[$rc.start,text])
+ ;
+
+dialect
+ : java_key
+ | mvel_key
+ ;
+
+side_effect_chunk
+ : ~ ( PERCENT_GREATER )*
+ ;
+
+
+
+
+
+
+
+
+
+
+
+/*
+rhs_chunk
+ at init{
+ String text = "";
+} : then_key
+ rc=rhs_chunk_data {text = $rc.text;}
+ end_key
+ SEMICOLON?
+ -> VT_RHS_CHUNK[$rc.start,text]
+ ;
+
+rhs_chunk_data
+ :
+ ~'end'*
+ ;
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+curly_chunk
+ at init{
+ String text = "";
+} : cc=curly_chunk_data[false] {text = $cc.text;}
+ -> VT_CURLY_CHUNK[$cc.start,text]
+ ;
+
+curly_chunk_data[boolean isRecursive]
+ : lc1=LEFT_CURLY
+ (any=~ ( LEFT_CURLY | RIGHT_CURLY ) | curly_chunk_data[true] )*
+ rc1=RIGHT_CURLY
+ ;
+
+square_chunk
+ at init{
+ String text = "";
+} : sc=square_chunk_data[false] {text = $sc.text;}
+ -> VT_SQUARE_CHUNK[$sc.start,text]
+ ;
+
+square_chunk_data[boolean isRecursive]
+ : ls1=LEFT_SQUARE
+ (any=~ ( LEFT_SQUARE | RIGHT_SQUARE ) | square_chunk_data[true] )*
+ rs1=RIGHT_SQUARE
+ ;
+
+
+paren_chunk
+ at init{
+ String text = "";
+} : cc=paren_chunk_data[false] {text = $cc.text;}
+ -> VT_PAREN_CHUNK[$cc.start,text]
+ ;
+
+paren_chunk_data[boolean isRecursive]
+ : lc1=LEFT_PAREN
+ (any=~ ( LEFT_PAREN | RIGHT_PAREN ) | paren_chunk_data[true] )*
+ rc1=RIGHT_PAREN
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// --------------------------------------------------------
+// GENERAL RULES
+// --------------------------------------------------------
+
+
+
+literal
+ : STRING m=msr_unit?
+ -> {m==null}? STRING
+ -> ^(VT_MSR STRING $m)
+ | DECIMAL m=msr_unit?
+ -> {m==null}? DECIMAL
+ -> ^(VT_MSR DECIMAL $m)
+ | FLOAT m=msr_unit?
+ -> {m==null}? FLOAT
+ -> ^(VT_MSR FLOAT $m)
+ | HEX
+ | OCTAL
+ | BOOL
+ | null_key
+ | literal_object
+ | list_literal
+ ;
+
+
+typeList
+ : data_type (COMMA data_type)*
+ ;
+
+// // helper.validateLT(2, "-")
+//type
+//options { backtrack=true; memoize=true; k=*; }
+// : (primitiveType) => ( primitiveType (LEFT_SQUARE RIGHT_SQUARE)* )
+// | ( ID (typeArguments)? (DOT ID (typeArguments)? )* (LEFT_SQUARE RIGHT_SQUARE)* )
+// ;
+
+
+typeArguments
+ : LESS typeArgument (COMMA typeArgument)* GREATER
+ ;
+
+typeArgument
+ : data_type
+ | QUESTION_MARK ((extends_key | super_key) data_type)?
+ ;
+
+parameters
+ : LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ ( param_definition (COMMA { helper.emit($COMMA, DroolsEditorType.SYMBOL); } param_definition)* )?
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ -> ^(VT_PARAM_LIST param_definition* )
+ ;
+
+param_definition
+ : data_type argument
+ -> ^(VT_PARAM data_type argument)
+ ;
+
+argument
+ : ID { helper.emit($ID, DroolsEditorType.IDENTIFIER); }
+ dimension_definition*
+ ;
+
+string_list
+ at init {
+ StringBuilder buf = new StringBuilder();
+}
+ : first=STRING { buf.append( "[ "+ $first.text ); }
+ (COMMA next=STRING { buf.append( ", " + $next.text ); } )*
+ -> STRING[$first,buf.toString()+" ]"]
+ ;
+
+
+
+
+primitiveType
+ : boolean_key
+ | char_key
+ | byte_key
+ | short_key
+ | int_key
+ | long_key
+ | float_key
+ | double_key
+ ;
+
+data_type returns [int dim]
+ at init{
+ $dim=0;
+}
+ : (procedural_name) (dimension_definition {$dim++;})*
+ -> ^(VT_DATA_TYPE VT_DIM_SIZE[$start,""+$dim] procedural_name? )
+ ;
+dimension_definition
+ : LEFT_SQUARE RIGHT_SQUARE
+ ;
+
+
+
+
+
+
+iri
+ : (semantic_name) => semantic_name -> ^(VT_IRI semantic_name)
+ | simple_name -> ^(VT_IRI simple_name)
+ ;
+
+
+nodeID
+ : BLANK_ID
+ ;
+
+full_iri
+ : LESS!
+ any_iri
+ //TODO : full iri syntax
+ GREATER!
+ ;
+
+
+any_iri
+ at init{
+ String text = "";
+} : cc=any_iri_content {text = $cc.text;}
+ -> ^(VT_PAREN_CHUNK[$cc.start,text])
+ ;
+
+any_iri_content
+ : (~ (GREATER | SLASH) | SLASH)*
+ ;
+
+
+/*********************************************
+* ATOMIC DATA DEFINITIONS
+************************************************/
+
+
+
+procedural_name
+ : fully_qualified_name
+ | simple_name
+ ;
+
+semantic_name
+ : prefixed_name
+ | empty_prefix_name
+ | full_iri
+ ;
+
+
+/*
+prefixed_name
+ : {prefixes.contains(input.LT(1))}?=> pref=ID COLON nam=ID
+ -> ^(VT_IRI $pref? $nam)
+ | COLON nam=ID
+ -> ^(VT_IRI STRING["EMPTY_NS"] $nam)
+ ;
+*/
+
+prefixed_name
+ : pref=ID COLON nam=ID
+ -> ^(VT_IRI $pref? $nam)
+ ;
+
+empty_prefix_name
+ : COLON nam=ID
+ -> ^(VT_IRI $nam)
+ ;
+
+fully_qualified_name
+/*
+ : (ID DOT)+ primitiveType
+ -> ^(VT_NAME ID* primitiveType)
+ | ID ( DOT ID )+
+ -> ^(VT_NAME ID+)
+ ;
+ */
+ : (ID DOT)+
+ ( (primitiveType) => primitiveType
+ | ID
+ )
+ ;
+
+
+simple_name
+ : primitiveType
+ | ID
+ ;
+
+
+
+gen_accessor_list
+ : first=general_accessor_path (COMMA next=general_accessor_path)*
+ -> ^(VT_LIST general_accessor_path+)
+ ;
+
+literal_list
+ : first=literal (COMMA next=literal)*
+ -> ^(VT_LIST literal+)
+ ;
+
+var_list
+ : first=VAR (COMMA next=VAR)*
+ -> ^(VT_LIST VAR+)
+ ;
+
+members_list
+ : (literal|var_literal) (COMMA! (literal|var_literal))*
+ ;
+
+integer_range
+ : DECIMAL DOUBLE_DOT DECIMAL
+ -> ^(VT_RANGE DECIMAL DECIMAL)
+ ;
+
+list_literal
+ : LEFT_CURLY members_list? RIGHT_CURLY
+ ->^(VT_LIST members_list?)
+ ;
+
+
+
+var
+ : VAR
+ ;
+
+
+var_literal
+ : VAR m=msr_unit?
+ -> {m==null}? VAR
+ -> ^(VT_MSR VAR $m)
+ ;
+
+label
+ : var COLON!
+ ;
+
+msr_unit
+ : (GATE! (simple_name))+
+ | (DOUBLE_CAP! (semantic_name))+
+ ;
+
+
+
+
+
+
+
+
+literal_object
+ : new_object
+ | ordered_object_literal
+ ;
+
+new_object
+ : (new_key) => new_key procedural_name LEFT_PAREN literal_object_args? RIGHT_PAREN
+ -> ^(VT_NEW_OBJ ^(VT_TYPE procedural_name) ^(VT_ARGS literal_object_args)?)
+ ;
+
+literal_object_args
+ : method_args
+ ;
+
+
+time_string
+ : STRING m=msr_unit?
+ -> {m==null}? STRING
+ -> ^(VT_MSR STRING $m)
+ ;
+
+/******************************************* QUICK OBJS **********************/
+
+
+ordered_object_literal
+ : DOUBLE_SQUARE_LEFT
+ method_args
+ DOUBLE_SQUARE_RIGHT
+ -> ^(VT_NEW_OBJ ^(VT_ARGS method_args))
+ ;
+
+ordered_obj_pattern
+ : DOUBLE_SQUARE_LEFT
+ positional_constraints
+ DOUBLE_SQUARE_RIGHT
+ -> ^(VT_PATTERN ^(VT_AND ^(VT_AND positional_constraints)))
+ ;
+
+method_args
+ : method_arg (COMMA! method_arg)*
+ ;
+
+
+method_arg
+ : expr_root
+ ;
+
+method
+ : core=method_core m=msr_unit?
+ -> {m==null}? $core
+ -> ^(VT_MSR $core $m)
+ ;
+
+method_core
+ : ID LEFT_PAREN args=method_args? RIGHT_PAREN
+ -> {args==null}? ^(VT_METHOD ID )
+ -> ^(VT_METHOD ID ^(VT_ARGS method_args?))
+ ;
+
+
+
+
+
+
+
+
+
+// --------------------------------------------------------
+// EXPRESSIONS
+// --------------------------------------------------------
+
+
+
+
+
+/*
+expr_root
+ : additiveExpression
+ ;
+*/
+
+
+expr_root
+ : factor ( (PLUS | MINUS)^ factor )*
+ ;
+
+
+
+
+factor
+ : term ( (TIMES | SLASH)^ term )*
+ ;
+
+term
+ : (MINUS^)? expr_unary
+ ;
+
+expr_unary
+ : expr_atom
+ | LEFT_PAREN! expr_root RIGHT_PAREN!
+ ;
+
+
+expr_atom
+ : var_literal
+ | literal
+ | accessor_path
+ ;
+
+
+
+
+
+
+
+
+
+
+/*
+
+expression
+ : conditionalExpression ((assignmentOperator) => assignmentOperator expression)?
+ ;
+
+conditionalExpression
+ : conditionalOrExpression ( QUESTION_MARK expression COLON expression )?
+ ;
+conditionalOrExpression
+ : conditionalAndExpression ( DOUBLE_PIPE conditionalAndExpression )*
+ ;
+
+conditionalAndExpression
+ : inclusiveOrExpression ( DOUBLE_AMPER inclusiveOrExpression )*
+ ;
+
+inclusiveOrExpression
+ : exclusiveOrExpression ( PIPE exclusiveOrExpression )*
+ ;
+
+exclusiveOrExpression
+ : andExpression ( XOR andExpression )*
+ ;
+
+andExpression
+ : equalityExpression ( AMPER equalityExpression )*
+ ;
+
+equalityExpression
+ : instanceOfExpression ( ( EQUALS | NOT_EQUAL ) instanceOfExpression )*
+ ;
+
+instanceOfExpression
+ : relationalExpression (instanceof_key data_type)?
+ ;
+
+relationalExpression
+ : shiftExpression ( relationalOp shiftExpression )*
+ ;
+
+relationalOp
+ : (LESS_EQUAL| GREATER_EQUAL | LESS | GREATER)
+ ;
+
+shiftExpression
+ : additiveExpression ( shiftOp additiveExpression )*
+ ;
+
+shiftOp
+ : (DOUBLE_LESS | TRIPLE_GREATER | DOUBLE_GREATER )
+ ;
+
+additiveExpression
+ : multiplicativeExpression ( (PLUS | MINUS) multiplicativeExpression )*
+ ;
+
+multiplicativeExpression
+ : unaryExpression ( ( TIMES | SLASH | MOD ) unaryExpression )*
+ ;
+
+unaryExpression
+ : PLUS unaryExpression
+ | MINUS unaryExpression
+ | DOUBLE_PLUS primary
+ | DOUBLE_MINUS primary
+ | unaryExpressionNotPlusMinus
+ ;
+
+unaryExpressionNotPlusMinus
+ : TILDE unaryExpression
+ | QUESTION_MARK unaryExpression
+ | castExpression
+ | primary selector* (DOUBLE_PLUS|DOUBLE_MINUS)?
+ ;
+
+castExpression
+ : (LEFT_PAREN primitiveType) => LEFT_PAREN primitiveType RIGHT_PAREN unaryExpression
+ | (LEFT_PAREN data_type) => LEFT_PAREN data_type RIGHT_PAREN unaryExpressionNotPlusMinus
+ | LEFT_PAREN expression RIGHT_PAREN unaryExpressionNotPlusMinus
+ ;
+
+
+
+primary
+ : // accessor_path
+ | parExpression
+ | nonWildcardTypeArguments (explicitGenericInvocationSuffix | this_key arguments)
+ | literal
+ | var_literal
+ | this_key ({!helper.validateSpecialID(2)}?=> DOT ID)* ({helper.validateIdentifierSufix()}?=> identifierSuffix)?
+ | super_key superSuffix
+ | new_key creator
+ | primitiveType (LEFT_SQUARE RIGHT_SQUARE)* DOT class_key
+ | void_key DOT class_key
+| ID ({!helper.validateSpecialID(2)}?=> DOT ID)* ({helper.validateIdentifierSufix()}?=> identifierSuffix)?
+ ;
+
+
+parExpression
+ : LEFT_PAREN expression RIGHT_PAREN
+ ;
+
+identifierSuffix
+options { backtrack=true; memoize=true; }
+ : (LEFT_SQUARE RIGHT_SQUARE)+ DOT class_key
+ | ((LEFT_SQUARE) => LEFT_SQUARE expression RIGHT_SQUARE)+ // can also be matched by selector, but do here
+ | arguments
+ | DOT class_key
+ | DOT explicitGenericInvocation
+ | DOT this_key
+ | DOT super_key arguments
+ | DOT new_key (nonWildcardTypeArguments)? innerCreator
+ ;
+
+creator
+ : nonWildcardTypeArguments? createdName
+ (arrayCreatorRest | classCreatorRest)
+ ;
+
+createdName
+ : ID typeArguments?
+ ( DOT ID typeArguments?)*
+ | primitiveType
+ ;
+
+innerCreator
+ : {!(helper.validateIdentifierKey(DroolsSoftKeywords.INSTANCEOF))}?=> ID classCreatorRest
+ ;
+
+arrayCreatorRest
+ : LEFT_SQUARE
+ ( RIGHT_SQUARE (LEFT_SQUARE RIGHT_SQUARE)* arrayInitializer
+ | expression RIGHT_SQUARE ({!helper.validateLT(2,"]")}?=>LEFT_SQUARE expression RIGHT_SQUARE)* ((LEFT_SQUARE RIGHT_SQUARE)=> LEFT_SQUARE RIGHT_SQUARE)*
+ )
+ ;
+
+variableInitializer
+options{ backtrack=true; memoize=true; }
+ : arrayInitializer
+ | expression
+ ;
+
+arrayInitializer
+ : LEFT_CURLY (variableInitializer (COMMA variableInitializer)* (COMMA)? )? RIGHT_CURLY
+ ;
+
+classCreatorRest
+ : arguments
+ ;
+
+explicitGenericInvocation
+ : nonWildcardTypeArguments arguments
+ ;
+
+nonWildcardTypeArguments
+ : LESS typeList GREATER
+ ;
+
+explicitGenericInvocationSuffix
+ : super_key superSuffix
+ | ID arguments
+ ;
+
+selector
+options { backtrack=true; memoize=true; }
+ : DOT ID ((LEFT_PAREN) => arguments)?
+ | DOT this_key
+ | DOT super_key superSuffix
+ | DOT new_key (nonWildcardTypeArguments)? innerCreator
+ | LEFT_SQUARE expression RIGHT_SQUARE
+ ;
+
+superSuffix
+ : arguments
+ | DOT ID ((LEFT_PAREN) => arguments)?
+ ;
+
+arguments
+ : LEFT_PAREN expressionList? RIGHT_PAREN
+ ;
+
+expressionList
+ : expression (COMMA expression)*
+ ;
+
+assignmentOperator
+options { k=1; }
+ : EQUAL
+ | PLUS_ASSIGN
+ | MINUS_ASSIGN
+ | MULT_ASSIGN
+ | DIV_ASSIGN
+ | AND_ASSIGN
+ | OR_ASSIGN
+ | XOR_ASSIGN
+ | MOD_ASSIGN
+ | DOUBLE_LESS EQUAL
+ | DOUBLE_GREATER EQUAL
+ | TRIPLE_GREATER EQUAL
+ ;
+
+*/
+
+
+
+//******************************************************************
+// MANCHESTER SYNTAX
+//******************************************************************
+
+/*
+manDL_ontology
+options{
+ k=5;
+}
+ :
+ manDL_prefix*
+ ontology_key COLON (nam=iri ver=iri?)?
+ manDL_inport*
+ ((AT? annotations_key) => manDL_annotations)?
+ manDL_type_declaration*
+ -> ^(VT_ONTOLOGY ^(VT_NAME $nam? $ver?)
+ manDL_prefix*
+ manDL_inport*
+ manDL_annotations?
+ manDL_type_declaration*
+ )
+ ;
+
+
+manDL_inport // :)
+ : import_key COLON iri
+ -> ^(VT_IMPORT iri)
+ ;
+
+
+
+manDL_prefix
+ : (prefix_key | namespace_key) COLON pref=ID COLON? full_iri
+ { prefixes.add($pref.text); }
+ -> ^(VT_PREFIX ID full_iri)
+ ;
+
+
+
+manDL_annotations
+ : annotations_key COLON manDL_annotation_list
+ -> ^(VT_ANNOTATIONS manDL_annotation_list)
+ ;
+
+manDL_annotation_list
+ : manDL_annotation (COMMA! manDL_annotation)*
+ ;
+
+manDL_annotation
+ : manDL_annotations? manDL_annotationPropertyIRI manDL_annotation_target
+ -> ^(VT_ANNOTATION manDL_annotations? manDL_annotationPropertyIRI manDL_annotation_target )
+ ;
+
+manDL_annotation_target
+ : manDL_individual | literal
+ ;
+
+
+
+manDL_type_declaration
+options{
+ backtrack=true;
+}
+ : manDL_datatype_def
+ | manDL_class
+ | manDL_objectProperty
+ | manDL_dataProperty
+ | manDL_annotationProperty
+ | manDL_namedIndividual
+ //| manDL_misc
+ ;
+
+
+
+
+
+
+
+
+manDL_class
+scope{
+ CommonTree keys;
+}
+ at init{
+ ((manDL_class_scope) manDL_class_stack.peek()).keys = new CommonTree(new CommonToken(DRLv6CombinedLexer.VT_KEYS,"VT_KEYS"));
+}
+ at after{
+ retval.tree.addChild(((manDL_class_scope) manDL_class_stack.peek()).keys);
+}
+ :
+
+ ( (AT typ=classevent_key)? declare_key
+ | typ=classevent_key COLON )
+
+ iri
+ manDL_class_frame*
+ manDL_decl_fields?
+ end_key?
+ -> {typ!=null}? ^(VT_TYPE_DECLARE
+ ^(VT_ENTITY_TYPE[$typ.text])
+ ^(VT_TYPE_DECLARE_ID iri)
+ manDL_class_frame* manDL_decl_fields?)
+ -> ^(VT_TYPE_DECLARE
+ ^(VT_ENTITY_TYPE["Class"])
+ ^(VT_TYPE_DECLARE_ID iri)
+ manDL_class_frame*
+ manDL_decl_fields?)
+
+ ;
+
+classevent_key
+ : class_key
+ | event_key
+ ;
+
+
+manDL_decl_fields
+ : manDL_decl_field more=manDL_decl_field*
+ -> ^(VT_EQUIVALENTTO ^(VT_DL_DEFINITION ^(VT_AND manDL_decl_field+)))
+ ;
+
+
+manDL_decl_field
+ : manDL_field^ manDL_decl_field_attributes? COLON!
+ ;
+
+manDL_field
+ : (manDL_property_expression COLON) => manDL_property_expression COLON manDL_data_type_restriction
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MIN DECIMAL["1"]) ^(VT_MAX DECIMAL["1"]) manDL_data_type_restriction)
+ | manDL_quantified_restriction_core
+ -> manDL_quantified_restriction_core
+ ;
+
+
+manDL_decl_field_attributes
+ :
+ AT LEFT_SQUARE
+ manDL_decl_field_attribute (COMMA manDL_decl_field_attribute)*
+ RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES manDL_decl_field_attribute+)
+ | ( AT manDL_decl_field_attribute )+
+ -> ^(VT_ATTRIBUTES manDL_decl_field_attribute+)
+ ;
+
+manDL_decl_field_attribute
+ :
+ key_key
+ {
+ if ($manDL_class::keys != null)
+ $manDL_class::keys.addChild(curField);
+ }
+ ;
+
+
+
+
+
+
+
+
+
+manDL_class_frame
+ : (annotations_key) => manDL_annotations
+ | (disjointUnionOf_key) => manDL_disjointUnionOf
+ | (disjointWith_key) => manDL_disjointWith
+ | (as_key | equivalentTo_key) => manDL_equivalentTo
+ | (subClassOf_key) => manDL_subClassOf
+ | (hasKey_key) => manDL_hasKey ->
+ ;
+
+
+
+manDL_disjointUnionOf
+ : disjointUnionOf_key COLON manDL_disjointUnionOf_list
+ -> ^(VT_DISJOINTUNIONOF manDL_disjointUnionOf_list)
+ ;
+
+manDL_disjointUnionOf_list
+ : manDL_annotated_description (COMMA! manDL_annotated_description)+
+ ;
+
+manDL_disjointWith
+ : disjointWith_key COLON manDL_annotated_description_list
+ -> ^(VT_DISJOINTWITH manDL_annotated_description_list)
+ ;
+
+manDL_equivalentTo
+ : ( as_key | equivalentTo_key COLON) manDL_annotated_description_list
+ -> ^(VT_EQUIVALENTTO manDL_annotated_description_list)
+ ;
+
+manDL_subClassOf
+ : subClassOf_key COLON manDL_annotated_description_list
+ -> ^(VT_SUBCLASSOF manDL_annotated_description_list)
+ ;
+
+manDL_hasKey
+ at after{
+ ((manDL_class_scope) manDL_class_stack.peek()).keys.addChildren(retval.tree.getChildren());
+}
+ : hasKey_key^ COLON! manDL_annotations? manDL_property_expression (COMMA! manDL_property_expression)*
+
+ ;
+
+
+
+
+
+
+manDL_annotated_description_list
+ : manDL_annotated_description (COMMA! manDL_annotated_description)*
+ ;
+
+
+manDL_annotated_description
+ : manDL_annotations? manDL_description
+ -> ^(VT_DL_DEFINITION manDL_annotations? manDL_description)
+ ;
+
+
+
+manDL_description
+ : manDL_conjunction ( (or_key manDL_primary) => or=or_key manDL_conjunction)*
+ -> {or==null}? manDL_conjunction
+ -> ^(VT_OR manDL_conjunction+)
+ ;
+
+manDL_conjunction
+ : (manDL_classIRI that_key) => manDL_classIRI that_key manDL_restriction (and_key manDL_restriction)*
+ -> ^(VT_AND ^(VT_DL_TYPE manDL_classIRI) manDL_restriction+)
+
+ | manDL_primary ( (and_key manDL_primary) => and=and_key manDL_primary)*
+ -> {and==null}? manDL_primary
+ -> ^(VT_AND manDL_primary+)
+ ;
+
+
+manDL_primary
+options{
+ backtrack=true;
+}
+ : manDL_restriction
+ | manDL_atomic
+ ;
+
+manDL_atomic
+ : not=not_key? manDL_atomic_core
+ -> {not!=null}? ^(VT_NEG manDL_atomic_core)
+ -> manDL_atomic_core
+ ;
+
+manDL_atomic_core
+ : LEFT_CURLY! literal_list RIGHT_CURLY!
+ | manDL_data_type_restriction
+ -> manDL_data_type_restriction
+ | LEFT_PAREN! manDL_description RIGHT_PAREN!
+ ;
+
+manDL_restriction
+ : not=not_key? manDL_quantified_restriction_core
+ -> {not!=null}? ^(VT_NEG manDL_quantified_restriction_core)
+ -> manDL_quantified_restriction_core
+ ;
+
+
+manDL_quantified_restriction_core
+ : p=manDL_property_expression {curField = $p.tree;}
+ ( (some_key) => some_key manDL_primary
+ -> ^(VT_EXISTS manDL_property_expression manDL_primary)
+ | (only_key) => only_key manDL_primary
+ -> ^(VT_FORALL manDL_property_expression manDL_primary)
+ | (all_key) => all_key manDL_primary
+ -> ^(VT_FORALL manDL_property_expression manDL_primary)
+ | (value_key) => value_key (manDL_individual | literal)
+ -> ^(VT_VALUE manDL_property_expression manDL_individual? literal?)
+ | (self_key) => self_key
+ -> ^(self_key manDL_property_expression)
+ | (min_key) => min_key DECIMAL
+ ((and_key) =>
+ | (or_key) =>
+ | (manDL_primary) => manDL_primary)?
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MIN DECIMAL) manDL_primary?)
+ | (max_key) => max_key DECIMAL
+ ((and_key) =>
+ | (or_key) =>
+ | (manDL_primary) => manDL_primary)?
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MAX DECIMAL) manDL_primary?)
+
+ | (exactly_key) => exactly_key DECIMAL
+ ((and_key) =>
+ | (or_key) =>
+ | (manDL_primary) => manDL_primary)?
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MIN DECIMAL) ^(VT_MAX DECIMAL) manDL_primary?)
+
+
+ | (manDL_data_type_restriction) => manDL_data_type_restriction
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MIN DECIMAL["1"]) ^(VT_MAX DECIMAL["1"]) manDL_data_type_restriction)
+ )
+ ;
+
+manDL_data_type_restriction
+ : manDL_data_type (LEFT_SQUARE fac=manDL_facets RIGHT_SQUARE)?
+ -> {fac!=null}? ^(VT_DL_RESTRICTED_TYPE manDL_data_type manDL_facets)
+ -> ^(VT_DL_TYPE manDL_data_type)
+ ;
+
+
+manDL_facets
+ : manDL_facet manDL_restriction_value more=(COMMA manDL_facet manDL_restriction_value)*
+ -> {more==null}? ^(VT_DL_RESTRICTION manDL_facet manDL_restriction_value*)
+ -> ^(VT_AND ^(VT_DL_RESTRICTION manDL_facet manDL_restriction_value)+)
+ ;
+
+manDL_restriction_value
+ : literal
+ ;
+
+manDL_facet
+ : facet_length_key
+ | facet_minLength_key
+ | facet_maxLength_key
+ | facet_pattern_key
+ | facet_langPattern_key
+ | GREATER_EQUAL
+ | GREATER
+ | LESS_EQUAL
+ | LESS
+ ;
+
+
+
+
+
+
+
+
+
+
+
+manDL_datatype_def
+ : (AT typ=datatype_key declare_key
+ | typ=datatype_key COLON )
+ iri
+ manDL_datatype_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_TYPE_DECLARE_ID iri) manDL_datatype_frame*)
+ ;
+
+manDL_datatype_frame
+ : manDL_annotations
+ | manDL_equivalentTo
+ ;
+
+
+
+
+
+manDL_objectProperty
+ : ( AT typ=objectProperty_key declare_key
+ | typ=objectProperty_key COLON)
+ iri
+ manDL_quick_attributes
+ manDL_objProp_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_TYPE_DECLARE_ID iri) manDL_quick_attributes? manDL_objProp_frame*)
+ ;
+
+manDL_objProp_frame
+ : manDL_annotations
+ | manDL_attributes
+ | manDL_disjointWith
+ | manDL_equivalentTo
+ | manDL_inverseOf
+ | manDL_domain
+ | manDL_range
+ | manDL_subPropertyOf
+ | manDL_subPropChain
+ ;
+
+
+
+manDL_dataProperty
+ :
+ (AT typ=dataProperty_key declare_key
+ | typ=dataProperty_key COLON)
+ iri
+ manDL_quick_attributes
+ manDL_dataProp_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_TYPE_DECLARE_ID iri) manDL_quick_attributes? manDL_dataProp_frame*)
+ ;
+
+
+manDL_dataProp_frame
+ : manDL_annotations
+ | manDL_domain
+ | manDL_range
+ | manDL_attributes
+ | manDL_disjointWith
+ | manDL_equivalentTo
+ | manDL_subPropertyOf
+ ;
+
+
+manDL_domain
+ : domain_key COLON manDL_annotated_description_list
+ -> ^(VT_DOMAIN manDL_annotated_description_list)
+ ;
+
+manDL_range
+ : range_key COLON manDL_annotated_description_list
+ -> ^(VT_RANGE manDL_annotated_description_list)
+ ;
+
+
+
+
+
+manDL_subPropertyOf
+ : subPropertyOf_key COLON manDL_property_list
+ -> ^(VT_SUBPROPERTYOF manDL_property_list)
+ ;
+
+manDL_inverseOf
+ : inverseOf_key COLON manDL_property_list
+ -> ^(VT_INVERSEOF manDL_property_list)
+ ;
+
+manDL_subPropChain
+ : subPropertyChain_key COLON manDL_annotations? manDL_property_expression ( CHAIN_SEP manDL_property_expression )*
+ -> ^(VT_SUBPROPERTYCHAIN manDL_annotations? manDL_property_expression+)
+ ;
+
+
+
+
+
+
+
+
+manDL_annotationProperty
+ : ( AT typ=annotationProperty_key declare_key
+ | typ=annotationProperty_key COLON)
+ iri
+ manDL_annProp_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_TYPE_DECLARE_ID iri) manDL_annProp_frame*)
+ ;
+
+
+manDL_annProp_frame
+ : manDL_annotations
+ | manDL_domain
+ | manDL_range
+ | manDL_subPropertyOf
+ ;
+
+
+
+
+
+
+
+manDL_namedIndividual
+ : (AT typ=individual_key declare_key
+ | typ=individual_key COLON)
+ iri
+ manDL_indiv_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_NAME iri) manDL_indiv_frame*)
+ ;
+
+manDL_indiv_frame
+ : manDL_annotations
+ | manDL_types
+ | manDL_facts
+ | manDL_sameAs
+ | manDL_differentFrom
+ ;
+
+manDL_types
+ : types_key COLON manDL_annotated_description_list
+ -> ^(VT_TYPES manDL_annotated_description_list)
+ ;
+
+manDL_individual_list
+ : manDL_annotated_individual (COMMA! manDL_annotated_individual)*
+ ;
+
+manDL_annotated_individual
+ : ^(manDL_individual manDL_annotations?)
+ ;
+
+manDL_facts
+ : facts_key COLON manDL_fact_annotated_list
+ -> ^(VT_FACTS manDL_fact_annotated_list)
+ ;
+
+manDL_fact_annotated_list
+ : manDL_annotated_fact (COMMA! manDL_annotated_fact)*
+ ;
+
+manDL_annotated_fact
+ : ^(manDL_fact manDL_annotations?)
+ ;
+
+manDL_fact
+ : neg=not_key? manDL_property_expression (manDL_individual | literal)
+ -> {neg==null}? ^(VT_FACT manDL_property_expression manDL_individual? literal?)
+ -> ^(VT_NEG ^(VT_FACT manDL_property_expression manDL_individual? literal?))
+ ;
+
+
+
+manDL_sameAs
+ : sameAs_key COLON manDL_individual_list
+ -> ^(VT_SAMEAS manDL_individual_list)
+ ;
+
+manDL_differentFrom
+ : differentFrom_key COLON manDL_individual_list
+ -> ^(VT_DIFFERENTFROM manDL_individual_list)
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+manDL_misc
+ : (eq=equivalentClasses_key | df=disjointClasses_key) COLON
+ manDL_annotations? manDL_description (COMMA manDL_description)+
+ -> {eq!=null}? ^(VT_EQV_CLASS manDL_annotations? manDL_description+)
+ -> ^(VT_DIF_CLASS manDL_annotations? manDL_description+)
+
+ | (eq2=equivalentProperties_key | df2=disjointProperties_key) COLON
+ manDL_annotations? manDL_property_expression (COMMA manDL_property_expression)+
+ -> {eq2!=null}? ^(VT_EQV_PROP manDL_annotations? manDL_property_expression+)
+ -> ^(VT_DIF_PROP manDL_annotations? manDL_property_expression+)
+
+ | (eq3=sameIndividual_key | df3=differentIndividuals_key) COLON
+ manDL_annotations? manDL_individual (COMMA manDL_individual)+
+ -> {eq3!=null}? ^(VT_EQV_INDV manDL_annotations? manDL_individual+)
+ -> ^(VT_DIF_INDV manDL_annotations? manDL_individual+)
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+manDL_attributes
+ : characteristics_key COLON (manDL_annotations? manDL_attribute) (COMMA manDL_annotations? manDL_attribute)*
+ -> ^(VT_ATTRIBUTES ^(manDL_attribute manDL_annotations?)+)
+ ;
+
+
+manDL_quick_attributes
+ : (AT manDL_att_functional) => AT! manDL_attribute manDL_quick_attributes^
+ | (AT manDL_att_inverseFunctional) => AT! manDL_attribute manDL_quick_attributes^
+ | (AT manDL_att_reflexive) => AT! manDL_attribute manDL_quick_attributes^
+ | (AT manDL_att_irreflexive) => AT! manDL_attribute manDL_quick_attributes^
+ | (AT manDL_att_symmetric) => AT! manDL_attribute manDL_quick_attributes^
+ | (AT manDL_att_asymmetric) => AT! manDL_attribute manDL_quick_attributes^
+ | (AT manDL_att_transitive) => AT! manDL_attribute manDL_quick_attributes^
+ ;
+
+manDL_attribute
+ :
+ manDL_att_functional
+ | manDL_att_inverseFunctional
+ | manDL_att_reflexive
+ | manDL_att_irreflexive
+ | manDL_att_symmetric
+ | manDL_att_asymmetric
+ | manDL_att_transitive
+ ;
+
+
+
+manDL_att_functional
+ : mda_functional_key
+ ;
+
+manDL_att_inverseFunctional
+ : mda_inverseFunctional_key
+ ;
+
+manDL_att_reflexive
+ : mda_reflexive_key
+ ;
+
+manDL_att_irreflexive
+ : mda_irreflexive_key
+ ;
+
+manDL_att_symmetric
+ : mda_symmetric_key
+ ;
+
+manDL_att_asymmetric
+ : mda_asymmetric_key
+ ;
+
+manDL_att_transitive
+ : mda_transitive_key
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+manDL_property_list
+ : manDL_annotatedProperty (COMMA! manDL_annotatedProperty)?
+ ;
+
+manDL_annotatedProperty
+ : manDL_annotations? manDL_property_expression
+ ;
+
+manDL_property_expression
+ : inv=inverse_key? manDL_propertyIRI
+ -> ^(VT_DL_PROP manDL_propertyIRI $inv?)
+ ;
+
+
+
+manDL_classIRI
+ : iri
+ ;
+
+manDL_data_type returns [int dim]
+ at init{
+ $dim=0;
+}
+ : iri (dimension_definition {$dim++;})*
+ -> ^(VT_DATA_TYPE VT_DIM_SIZE[$start,""+$dim] iri)
+ ;
+
+manDL_objectPropertyIRI
+ : iri
+ ;
+
+manDL_dataPropertyIRI
+ : iri
+ ;
+
+manDL_annotationPropertyIRI
+ : iri
+ ;
+
+manDL_propertyIRI
+ : iri
+ ;
+
+manDL_individual
+ : manDL_individualIRI
+ | nodeID
+ ;
+
+manDL_individualIRI
+ : iri
+ ;
+
+
+ */
+
+//****************************************************+
+// rule attributes
+//******************************************************
+
+/*
+rule_attributes
+ : AT {System.out.println("Look for rule attr");}
+ rule_attribute ( COMMA? AT rule_attribute)*
+ -> ^(VT_ATTRIBUTES rule_attribute+)
+ ;
+
+rule_attribute
+ : ra_salience
+ | ra_agenda_group
+ | ra_timer
+ | ra_activation_group
+ | ra_auto_focus
+ | ra_date_effective
+ | ra_date_expires
+ | ra_enabled
+ | ra_ruleflow_group
+ | ra_lock_on_active
+ | ra_dialect
+ | ra_calendars
+ | ra_defeats
+ | ra_deductive
+ | ra_abductive
+ | ra_equivalence
+ | ra_no_loop
+ ;
+
+ra_date_effective
+ : ra_date_effective_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+ra_date_expires
+ : ra_date_expires_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+ra_enabled
+ : ra_enabled_key^
+ LEFT_PAREN! BOOL RIGHT_PAREN!
+ ;
+
+ra_salience
+ : ra_salience_key^
+ LEFT_PAREN! DECIMAL RIGHT_PAREN!
+ ;
+
+ra_no_loop
+ : ra_no_loop_key^ LEFT_PAREN! BOOL RIGHT_PAREN!
+ ;
+
+ra_auto_focus
+ : ra_auto_focus_key^ LEFT_PAREN! BOOL RIGHT_PAREN!
+ ;
+
+ra_activation_group
+ : ra_activation_group_key^ (LEFT_PAREN! STRING RIGHT_PAREN!)
+ ;
+
+ra_ruleflow_group
+ : ra_ruleflow_group_key^ (LEFT_PAREN! STRING RIGHT_PAREN!)
+ ;
+
+ra_agenda_group
+ : ra_agenda_group_key^ (LEFT_PAREN! STRING RIGHT_PAREN!)
+ ;
+
+ra_timer
+ : (ra_duration_key^| ra_timer_key^)
+ LEFT_PAREN! DECIMAL RIGHT_PAREN!
+ ;
+
+ra_calendars
+ : ra_calendar_key^ LEFT_PAREN! literal_list RIGHT_PAREN!
+ ;
+
+
+ra_dialect
+ : ra_dialect_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+ra_lock_on_active
+ : ra_lock_on_active_key^ LEFT_PAREN! BOOL RIGHT_PAREN!
+ ;
+
+ra_deductive
+ : ra_deductive_key
+ ;
+
+ra_abductive
+ : ra_abductive_key
+ ;
+
+ra_equivalence
+ : ra_equivalence_key
+ ;
+
+ra_defeats
+ : ra_defeats_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+
+*/
+
+//****************************************************+
+// operator attributes
+//******************************************************
+
+
+
+
+
+
+operator_attributes
+ : (AT single_operator_attribute)+
+ -> ^(VT_ATTRIBUTES single_operator_attribute+)
+ | AT LEFT_SQUARE single_operator_attribute (COMMA single_operator_attribute)* RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES single_operator_attribute+)
+ ;
+
+
+single_operator_attribute
+ : oa_kind
+ | oa_id
+ | oa_params
+ | oa_degree
+ | oa_merge
+ | oa_missing
+ | oa_defeat
+ | oa_default
+ | oa_crisp
+ | oa_otherwise
+ ;
+
+oa_kind
+ : oa_kind_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_id
+ : oa_id_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_params
+ : oa_params_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_degree
+ : oa_degree_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_crisp
+ : oa_crisp_key^
+ ;
+
+oa_merge
+ : oa_merge_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_missing
+ : oa_missing_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_defeat
+ : oa_defeat_key^
+ ;
+
+oa_default
+ : oa_default_key^
+ ;
+
+oa_otherwise
+ : oa_otherwise_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+
+
+
+
+//****************************************************+
+// pattern attributes
+//******************************************************
+
+
+
+
+pattern_attributes
+ : (AT single_pattern_attribute)+
+ -> ^(VT_ATTRIBUTES single_pattern_attribute+)
+ | AT LEFT_SQUARE single_pattern_attribute (COMMA single_pattern_attribute)* RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES single_pattern_attribute+)
+ ;
+
+single_pattern_attribute
+ : single_operator_attribute
+ | pa_onChange
+ ;
+
+pa_onChange
+ : onChange_key^ LEFT_PAREN!
+ (
+ TIMES (COMMA! NEG_MARK! ID)*
+ | ID (COMMA! ID)*
+ )
+ RIGHT_PAREN!
+ ;
+
+
+
+
+//****************************************************+
+// query attributes
+//******************************************************
+
+
+
+
+query_attributes
+ : (AT single_query_attribute)+
+ -> ^(VT_ATTRIBUTES single_query_attribute+)
+ | AT LEFT_SQUARE single_query_attribute (COMMA single_query_attribute)* RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES single_query_attribute+)
+ ;
+
+single_query_attribute
+ :
+ ;
+
+
+
+
+//****************************************************+
+// event sequence attributes
+//******************************************************
+
+
+
+
+trail_attributes
+ : (AT single_trail_attribute)+
+ -> ^(VT_ATTRIBUTES single_trail_attribute+)
+ | AT LEFT_SQUARE single_trail_attribute (COMMA single_trail_attribute)* RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES single_trail_attribute+)
+ ;
+
+single_trail_attribute
+ : ta_trail_start
+ | ta_trail_end
+ ;
+
+ta_trail_start
+ : start_key
+ ;
+
+ta_trail_end
+ : end_key
+ ;
+
+
+
+
+
+//****************************************************+
+// inner quantifier attributes
+//******************************************************
+
+
+
+
+attr_min
+ : (min_key EQUALS DECIMAL)
+ -> ^(VT_MIN DECIMAL)
+ ;
+
+attr_max
+ : (max_key EQUALS DECIMAL)
+ -> ^(VT_MAX DECIMAL)
+ ;
+
+inner_attrs
+ : attr_min (COMMA! attr_max)?
+ | attr_max (COMMA! attr_min)?
+ ;
+
+
+
+
+
+
+
+// --------------------------------------------------------
+// KEYWORDS
+// --------------------------------------------------------
+operator_key
+ : {(helper.isPluggableEvaluator(false))}? id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER); }
+ -> VK_OPERATOR[$id]
+ ;
+
+neg_operator_key
+ : {(helper.isPluggableEvaluator(true))}? id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER); }
+ -> VK_OPERATOR[$id]
+ ;
+
+ra_lock_on_active_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.LOCK) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.ON) && helper.validateLT(4, "-") && helper.validateLT(5, DroolsSoftKeywords.ACTIVE))}? id1=ID mis1=MINUS id2=ID mis2=MINUS id3=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD);
+ helper.emit($mis2, DroolsEditorType.KEYWORD);
+ helper.emit($id3, DroolsEditorType.KEYWORD); }
+ -> VK_LOCK_ON_ACTIVE[$start, text]
+ ;
+
+ra_date_effective_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.DATE) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.EFFECTIVE))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_DATE_EFFECTIVE[$start, text]
+ ;
+
+ra_date_expires_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.DATE) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.EXPIRES))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_DATE_EXPIRES[$start, text]
+ ;
+
+ra_no_loop_key
+ at init{
+ String text = "";
+} :
+ {(helper.validateIdentifierKey(DroolsSoftKeywords.NO)
+ && helper.validateLT(2, "-")
+ && helper.validateLT(3, DroolsSoftKeywords.LOOP))}?
+
+ id1=ID mis1=MINUS id2=ID {text = $text;}
+
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_AUTO_FOCUS[$start, text]
+ ;
+
+
+
+ra_auto_focus_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.AUTO) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.FOCUS))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_AUTO_FOCUS[$start, text]
+ ;
+
+ra_activation_group_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACTIVATION) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.GROUP))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_ACTIVATION_GROUP[$start, text]
+ ;
+
+ra_agenda_group_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.AGENDA) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.GROUP))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_AGENDA_GROUP[$start, text]
+ ;
+
+ra_ruleflow_group_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.RULEFLOW) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.GROUP))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_RULEFLOW_GROUP[$start, text]
+ ;
+
+entry_point_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.ENTRY) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.POINT))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_ENTRY_POINT[$start, text]
+ ;
+
+timer_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TIMER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TIMER[$id]
+ ;
+
+
+
+calendars_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CALENDARS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CALENDARS[$id]
+ ;
+
+package_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PACKAGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PACKAGE[$id]
+ ;
+
+import_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.IMPORT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_IMPORT[$id]
+ ;
+
+
+salience_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SALIENCE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SALIENCE[$id]
+ ;
+
+enabled_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ENABLED))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ENABLED[$id]
+ ;
+
+attributes_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ATTRIBUTES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ATTRIBUTES[$id]
+ ;
+
+rule_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RULE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RULE[$id]
+ ;
+
+extend_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXTEND))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXTEND[$id]
+ ;
+
+template_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TEMPLATE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TEMPLATE[$id]
+ ;
+
+query_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.QUERY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_QUERY[$id]
+ ;
+
+declare_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DECLARE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DECLARE[$id]
+ ;
+
+function_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FUNCTION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FUNCTION[$id]
+ ;
+
+
+
+
+not_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NOT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NOT[$id]
+ ;
+
+in_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.IN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_IN[$id]
+ ;
+
+or_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OR))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OR[$id]
+ ;
+
+and_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.AND))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_AND[$id]
+ ;
+
+exists_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXISTS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXISTS[$id]
+ ;
+
+forall_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FORALL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FORALL[$id]
+ ;
+
+action_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACTION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACTION[$id]
+ ;
+
+reverse_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.REVERSE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_REVERSE[$id]
+ ;
+
+result_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RESULT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RESULT[$id]
+ ;
+
+end_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.END))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_END[$id]
+ ;
+
+//not_end_key
+// : {!(helper.validateIdentifierKey(DroolsSoftKeywords.END))}? any=.
+// { helper.emit($any, DroolsEditorType.CODE_CHUNK); }
+// ;
+
+init_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INIT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INIT[$id]
+ ;
+
+instanceof_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INSTANCEOF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INSTANCEOF[$id]
+ ;
+
+extends_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXTENDS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXTENDS[$id]
+ ;
+
+super_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUPER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUPER[$id]
+ ;
+
+boolean_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.BOOLEAN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+char_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CHAR))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+byte_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.BYTE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+short_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SHORT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+int_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+long_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LONG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+float_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FLOAT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+
+
+this_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.THIS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_THIS[$id]
+ ;
+
+void_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.VOID))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_VOID[$id]
+ ;
+
+class_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CLASS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CLASS[$id]
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ra_calendar_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_CALENDAR))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_CALENDAR[$id]
+ ;
+
+ra_effective_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DATE_EFFECTIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DATE_EFFECTIVE[$id]
+ ;
+
+ra_expires_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DATE_EXPIRES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DATE_EXPIRES[$id]
+ ;
+
+ra_deduction_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DEDUCTION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DEDUCTION[$id]
+ ;
+
+ra_dialect_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DIALECT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DIALECT[$id]
+ ;
+
+ra_abductive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DIRECTION_ABDUCTIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DIRECTION_ABDUCTIVE[$id]
+ ;
+
+ra_deductive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DIRECTION_DEDUCTIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DIRECTION_DEDUCTIVE[$id]
+ ;
+
+ra_equivalence_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DIRECTION_EQUIVALENCE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DIRECTION_EQUIVALENCE[$id]
+ ;
+
+ra_duration_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DURATION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DURATION[$id]
+ ;
+
+ra_enabled_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_ENABLED))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_ENABLED[$id]
+ ;
+
+ra_implication_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_IMPLICATION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_IMPLICATION[$id]
+ ;
+
+
+
+ra_salience_key
+ : {System.out.println("Called salience key");}
+ {(helper.validateIdentifierKey(DroolsSoftKeywords.A_SALIENCE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_SALIENCE[$id]
+ ;
+
+ra_timer_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_TIMER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_TIMER[$id]
+ ;
+
+acc_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACC))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACC[$id]
+ ;
+
+accL_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACCL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACCL[$id]
+ ;
+
+accumulate_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACCUMULATE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACCUMULATE[$id]
+ ;
+
+accR_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACCUMULATE_RIGHT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACCUMULATE_RIGHT[$id]
+ ;
+
+
+activation_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACTIVATION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACTIVATION[$id]
+ ;
+
+active_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACTIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACTIVE[$id]
+ ;
+
+agenda_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.AGENDA))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_AGENDA[$id]
+ ;
+
+all_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ALL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ALL[$id]
+ ;
+
+
+
+annotations_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ANNOTATIONS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ANNOTATIONS[$id]
+ ;
+
+
+another_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ANOTHER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ANOTHER[$id]
+ ;
+
+
+as_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.AS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_AS[$id]
+ ;
+
+
+
+
+
+avg_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.AVERAGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_AVERAGE[$id]
+ ;
+
+true_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.BOOL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_BOOL[$id]
+ ;
+
+
+
+branch_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.BRANCH))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_BRANCH[$id]
+ ;
+
+
+
+
+characteristics_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CHARACTERISTICS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CHARACTERISTICS[$id]
+ ;
+
+closure_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CLOSURE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CLOSURE[$id]
+ ;
+
+collect_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.COLLECT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_COLLECT[$id]
+ ;
+
+collectList_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.COLLECT_LIST))}?=> id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_COLLECT_LIST[$id]
+ ;
+
+contains_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CONTAINS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CONTAINS[$id]
+ ;
+
+count_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.COUNT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_COUNT[$id]
+ ;
+
+datatype_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DATATYPE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DATATYPE[$id]
+ ;
+
+date_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DATE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DATE[$id]
+ ;
+
+
+
+ra_defeats_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DEFEATS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DEFEATS[$id]
+ ;
+
+
+differentIndividuals_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DIFFERENT_INDIVIDUALS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DIFFERENT_INDIVIDUALS[$id]
+ ;
+
+differentFrom_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DIFFERENTFROM))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DIFFERENTFROM[$id]
+ ;
+
+disjointWith_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISJOINT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISJOINT[$id]
+ ;
+
+disjointClasses_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISJOINT_CLASSES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISJOINT_CLASSES[$id]
+ ;
+
+disjointProperties_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISJOINT_PROPERTIES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISJOINT_PROPERTIES[$id]
+ ;
+
+disjointUnionOf_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISJOINT_UNION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISJOINT_UNION[$id]
+ ;
+
+distinct_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISTINCT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISTINCT[$id]
+ ;
+
+do_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DO))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DO[$id]
+ ;
+
+domain_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DOMAIN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DOMAIN[$id]
+ ;
+
+double_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DOUBLE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DOUBLE[$id]
+ ;
+
+
+
+
+
+entry_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ENTRY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ENTRY[$id]
+ ;
+
+
+
+equiv_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EQUIV))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EQUIV[$id]
+ ;
+
+equivalentClasses_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EQUIVALENT_CLASSES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EQUIVALENT_CLASSES[$id]
+ ;
+
+equivalentProperties_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EQUIVALENT_PROPERTIES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EQUIVALENT_PROPERTIES[$id]
+ ;
+
+equivalentTo_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EQUIVALENTTO))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EQUIVALENTTO[$id]
+ ;
+
+
+
+event_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EVENT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EVENT[$id]
+ ;
+
+exactly_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXACTLY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXACTLY[$id]
+ ;
+
+excludes_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXCLUDES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXCLUDES[$id]
+ ;
+
+
+
+expires_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXPIRES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXPIRES[$id]
+ ;
+
+
+
+
+
+facts_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FACTS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FACTS[$id]
+ ;
+
+falling_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FALLING))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FALLING[$id]
+ ;
+
+filter_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FILTER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FILTER[$id]
+ ;
+
+
+
+
+
+
+
+from_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FROM))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FROM[$id]
+ ;
+
+global_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.GLOBAL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_GLOBAL[$id]
+ ;
+
+group_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.GROUP))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_GROUP[$id]
+ ;
+
+hasKey_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.HASKEY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_HASKEY[$id]
+ ;
+
+implies_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.IMPLIES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_IMPLIES[$id]
+ ;
+
+
+
+
+individual_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INDIVIDUAL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INDIVIDUAL[$id]
+ ;
+
+
+
+insert_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INSERT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INSERT[$id]
+ ;
+
+insertLogical_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INSERT_LOG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INSERT_LOG[$id]
+ ;
+
+
+
+inverse_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INVERSE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INVERSE[$id]
+ ;
+
+inverseOf_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INVERSEOF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INVERSEOF[$id]
+ ;
+
+java_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.JAVA))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_JAVA[$id]
+ ;
+
+key_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.KEY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_KEY[$id]
+ ;
+
+facet_length_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LENGTH))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LENGTH[$id]
+ ;
+
+length_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LENGTH))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LENGTH[$id]
+ ;
+
+
+facet_maxLength_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LENGTH_MAX))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LENGTH_MAX[$id]
+ ;
+
+facet_minLength_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LENGTH_MIN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LENGTH_MIN[$id]
+ ;
+
+limit_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LIMIT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LIMIT[$id]
+ ;
+
+lock_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LOCK))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LOCK[$id]
+ ;
+
+
+matches_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MATCHES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MATCHES[$id]
+ ;
+
+max_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MAX))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MAX[$id]
+ ;
+
+mda_functional_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_FUNCTIONAL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_FUNCTIONAL[$id]
+ ;
+
+mda_inverseFunctional_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_FUNCTIONAL_INV))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_FUNCTIONAL_INV[$id]
+ ;
+
+mda_reflexive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_REFLEXIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_REFLEXIVE[$id]
+ ;
+
+mda_irreflexive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_REFLEXIVE_INV))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_REFLEXIVE_INV[$id]
+ ;
+
+mda_symmetric_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_SYMMETRIC))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_SYMMETRIC[$id]
+ ;
+
+mda_asymmetric_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_SYMMETRIC_INV))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_SYMMETRIC_INV[$id]
+ ;
+
+mda_transitive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_TRANSITIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_TRANSITIVE[$id]
+ ;
+
+memberof_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MEMBEROF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MEMBEROF[$id]
+ ;
+
+min_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MIN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MIN[$id]
+ ;
+
+modify_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MODIFY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MODIFY[$id]
+ ;
+
+modifyLogical_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MODIFY_LOG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MODIFY_LOG[$id]
+ ;
+
+mol_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MOL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MOL[$id]
+ ;
+
+mvel_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MVEL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MVEL[$id]
+ ;
+
+namespace_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NAMESPACE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NAMESPACE[$id]
+ ;
+
+neg_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NEG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NEG[$id]
+ ;
+
+new_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NEW))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NEW[$id]
+ ;
+
+
+
+null_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NULL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NULL[$id]
+ ;
+
+oa_crisp_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_CRISP))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_CRISP[$id]
+ ;
+
+oa_default_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_DEFAULT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_DEFAULT[$id]
+ ;
+
+oa_defeat_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_DEFEAT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_DEFEAT[$id]
+ ;
+
+oa_degree_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_DEGREE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_DEGREE[$id]
+ ;
+
+oa_id_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_ID))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_ID[$id]
+ ;
+
+oa_kind_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_KIND))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_KIND[$id]
+ ;
+
+oa_merge_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_MERGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_MERGE[$id]
+ ;
+
+oa_missing_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_MISSING))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_MISSING[$id]
+ ;
+
+oa_otherwise_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_OTHERWISE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_OTHERWISE[$id]
+ ;
+
+oa_params_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_PARAMS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_PARAMS[$id]
+ ;
+
+on_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ON))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ON[$id]
+ ;
+
+onChange_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ONCHANGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ONCHANGE[$id]
+ ;
+
+only_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ONLY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ONLY[$id]
+ ;
+
+ontology_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ONTOLOGY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ONTOLOGY[$id]
+ ;
+
+orderby_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ORDERBY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ORDERBY[$id]
+ ;
+
+otherwise_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OTHERWISE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OTHERWISE[$id]
+ ;
+
+over_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OVER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OVER[$id]
+ ;
+
+facet_pattern_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PATTERN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PATTERN[$id]
+ ;
+
+facet_langPattern_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PATTERN_LANG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PATTERN_LANG[$id]
+ ;
+
+point_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.POINT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_POINT[$id]
+ ;
+
+prefix_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PREFIX))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PREFIX[$id]
+ ;
+
+property_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PROPERTY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PROPERTY[$id]
+ ;
+
+annotationProperty_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PROPERTY_ANNOTATION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PROPERTY_ANNOTATION[$id]
+ ;
+
+dataProperty_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PROPERTY_DATA))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PROPERTY_DATA[$id]
+ ;
+
+objectProperty_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PROPERTY_OBJECT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PROPERTY_OBJECT[$id]
+ ;
+
+
+
+range_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RANGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RANGE[$id]
+ ;
+
+
+retract_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RETRACT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RETRACT[$id]
+ ;
+
+retractLogical_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RETRACT_LOG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RETRACT_LOG[$id]
+ ;
+
+
+
+rising_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RISING))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RISING[$id]
+ ;
+
+role_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ROLE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ROLE[$id]
+ ;
+
+
+
+ruleflow_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RULEFLOW))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RULEFLOW[$id]
+ ;
+
+
+sameIndividual_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SAME_INDIVIDUAL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SAME_INDIVIDUAL[$id]
+ ;
+
+sameAs_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SAMEAS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SAMEAS[$id]
+ ;
+
+self_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SELF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SELF[$id]
+ ;
+
+seq_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SEQ))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SEQ[$id]
+ ;
+
+some_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SOME))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SOME[$id]
+ ;
+
+soundslike_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SOUNDSLIKE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SOUNDSLIKE[$id]
+ ;
+
+start_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.START))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_START[$id]
+ ;
+
+subClassOf_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUBCLASSOF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUBCLASSOF[$id]
+ ;
+
+subPropertyChain_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUBPROPERTYCHAIN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUBPROPERTYCHAIN[$id]
+ ;
+
+subPropertyOf_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUBPROPERTYOF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUBPROPERTYOF[$id]
+ ;
+
+sum_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUM))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUM[$id]
+ ;
+
+
+
+that_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.THAT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_THAT[$id]
+ ;
+
+then_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.THEN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_THEN[$id]
+ ;
+
+
+
+throttle_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.THROTTLE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_THROTTLE[$id]
+ ;
+
+time_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TIME))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TIME[$id]
+ ;
+
+
+
+type_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TYPE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TYPE[$id]
+ ;
+
+
+
+
+integer_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TYPE_INTEGER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TYPE_INTEGER[$id]
+ ;
+
+string_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TYPE_STRING))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TYPE_STRING[$id]
+ ;
+
+types_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TYPES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TYPES[$id]
+ ;
+
+unique_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.UNIQUE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_UNIQUE[$id]
+ ;
+
+update_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.UPDATE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_UPDATE[$id]
+ ;
+
+value_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.VALUE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_VALUE[$id]
+ ;
+
+very_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.VERY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_VERY[$id]
+ ;
+
+
+
+when_key
+ :
+ {(helper.validateIdentifierKey(DroolsSoftKeywords.WHEN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_WHEN[$id]
+ ;
+
+window_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.WINDOW))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_WINDOW[$id]
+ ;
+
+xor_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.XOR))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_XOR[$id]
+ ;
+
+
+
+
+
+
+
+
+
+AMPER
+ : '&'
+ ;
+
+
+AT
+ : '@'
+ ;
+
+ARROW
+ : '->'
+ ;
+
+CHAIN_SEP
+ : 'o'
+ ;
+
+COLON
+ : ':'
+ ;
+
+COMMA
+ : ','
+ ;
+
+
+DOT : '.'
+ ;
+
+DOT_STAR
+ : '.*'
+ ;
+
+DOUBLE_AMPER
+ : '&&'
+ ;
+
+DOUBLE_PLUS
+ : '++'
+ ;
+
+
+
+DOUBLE_ANG
+ : '<>'
+ ;
+
+DOUBLE_CAP
+ : '^^'
+ ;
+
+DOUBLE_COLON
+ : '::'
+ ;
+
+DOUBLE_MINUS
+ : '--'
+ ;
+
+DOUBLE_DOT
+ : '..'
+ ;
+
+DOUBLE_GREATER
+ : '>>'
+ ;
+
+DOUBLE_LESS
+ : '<<'
+ ;
+
+DOUBLE_PIPE
+ : '||'
+ ;
+
+DOUBLE_SLASH
+ : '//'
+ ;
+
+DOUBLE_SQUARE_LEFT
+ : '[['
+ ;
+
+DOUBLE_SQUARE_RIGHT
+ : ']]'
+ ;
+
+EQUAL
+ : '=='
+ ;
+
+EQUALS
+ : '='
+ ;
+
+GATE
+ : '#'
+ ;
+
+GREATER
+ : '>'
+ ;
+
+GREATER_EQUAL
+ : '>='
+ ;
+
+LESS
+ : '<'
+ ;
+
+LESS_PERCENT
+ : '<%'
+ ;
+
+LESS_EQUAL
+ : '<='
+ ;
+
+MINUS
+ : '-'
+ ;
+
+MOD
+ : '%'
+ ;
+
+NEG_MARK
+ : '!'
+ ;
+
+NOT_EQUAL
+ : '!='
+ ;
+
+
+PERCENT_GREATER
+ : '%>'
+ ;
+
+PIPE
+ : '|'
+ ;
+
+PLUS
+ : '+'
+ ;
+
+QUESTION_MARK
+ : '?'
+ ;
+
+SEMICOLON
+ : ';'
+ ;
+
+SLASH
+ : '/'
+ ;
+
+TILDE
+ : '~'
+ ;
+
+TIMES
+ : '*'
+ ;
+
+TRIPLE_GREATER
+ : '>>>'
+ ;
+
+XOR
+ : '^'
+ ;
+
+
+
+PLUS_ASSIGN
+ : '+='
+ ;
+
+MINUS_ASSIGN
+ : '-='
+ ;
+
+
+MULT_ASSIGN
+ : '*='
+ ;
+
+DIV_ASSIGN
+ : '/='
+ ;
+
+AND_ASSIGN
+ : '&='
+ ;
+
+OR_ASSIGN
+ : '|='
+ ;
+
+XOR_ASSIGN
+ : '^='
+ ;
+
+MOD_ASSIGN
+ : '%='
+ ;
+
+
+
+LEFT_PAREN
+ : '('
+ ;
+
+RIGHT_PAREN
+ : ')'
+ ;
+
+LEFT_SQUARE
+ : '['
+ ;
+
+RIGHT_SQUARE
+ : ']'
+ ;
+
+LEFT_CURLY
+ : '{'
+ ;
+
+RIGHT_CURLY
+ : '}'
+ ;
+
+
+
+
+
+
+
+HEX : '0' ('x'|'X') HexDigit+ IntegerTypeSuffix? ;
+
+DECIMAL : MINUS? ('0' | '1'..'9' '0'..'9'*) IntegerTypeSuffix? ;
+
+OCTAL : '0' ('0'..'7')+ IntegerTypeSuffix? ;
+
+
+
+FLOAT
+ : MINUS? ('0'..'9')+ '.' ('0'..'9')* Exponent? FloatTypeSuffix?
+ | MINUS? '.' ('0'..'9')+ Exponent? FloatTypeSuffix?
+ | MINUS? ('0'..'9')+ Exponent FloatTypeSuffix?
+ | MINUS? ('0'..'9')+ FloatTypeSuffix
+ ;
+
+
+BOOL
+ : 'true'
+ | 'false'
+ ;
+
+
+
+
+
+
+
+STRING
+ : ('"' ( EscapeSequence | ~('\\'|'"') )+ '"')
+ | ('\'' ( EscapeSequence | ~('\\'|'\'') )+ '\'')
+ ;
+
+
+
+
+C_STYLE_SINGLE_LINE_COMMENT
+ : '/*' (~('\r'|'\n'))* EOL?
+ { $channel=HIDDEN; }
+ ;
+
+MULTI_LINE_COMMENT
+ : '/*' (options{greedy=false;} : .)* '*/'
+ { $channel=HIDDEN; }
+ ;
+
+ID
+ : IdentifierStart IdentifierPart*
+ | '`' IdentifierStart IdentifierPart* '`'
+ { state.text = $text.substring(1, $text.length() - 1); }
+ ;
+
+//TODO Deprecated
+//PREFIXED_ID
+// : ':' IdentifierStart IdentifierPart*
+// { state.text = $text.substring(1, $text.length() ); }
+// ;
+
+BLANK_ID
+ : '_' IdentifierStart IdentifierPart*
+ { state.text = $text.substring(1, $text.length() ); }
+ ;
+
+
+
+VAR
+ : '$' IdentifierPart+
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+MISC :
+ '\'' | '\\'
+ ;
+
+
+
+WS : ( ' '
+ | '\t'
+ | '\f'
+ | EOL
+ )+
+ { $channel=HIDDEN; }
+ ;
+
+fragment
+EOL :
+ ( ( '\r\n' )=> '\r\n' // Evil DOS
+ | '\r' // Macintosh
+ | '\n' // Unix (the right way)
+ )
+ ;
+
+
+fragment
+HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
+
+fragment
+EscapeSequence
+ : '\\' ('b'|'B'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\'|'.'|'o'|
+ 'x'|'a'|'e'|'c'|'d'|'D'|'s'|'S'|'w'|'W'|'p'|'A'|
+ 'G'|'Z'|'z'|'Q'|'E'|'*'|'['|']'|'('|')'|'$'|'^'|
+ '{'|'}'|'?'|'+'|'-'|'&'|'|')
+ | UnicodeEscape
+ | OctalEscape
+ ;
+
+fragment
+OctalEscape
+ : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7')
+ ;
+
+fragment
+UnicodeEscape
+ : '\\' 'u' HexDigit HexDigit HexDigit HexDigit
+ ;
+
+fragment
+IntegerTypeSuffix : ('l'|'L') ;
+
+fragment
+Exponent : ('e'|'E') ('+'|'-')? ('0'..'9')+ ;
+
+fragment
+FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
+
+
+
+
+
+
+
+
+fragment
+IdentifierStart
+ : //'\u0024'
+ '\u0041'..'\u005a'
+// | '\u005f'
+ | '\u0061'..'\u007a'
+ | '\u00a2'..'\u00a5'
+ | '\u00aa'
+ | '\u00b5'
+ | '\u00ba'
+ | '\u00c0'..'\u00d6'
+ | '\u00d8'..'\u00f6'
+ | '\u00f8'..'\u0236'
+ | '\u0250'..'\u02c1'
+ | '\u02c6'..'\u02d1'
+ | '\u02e0'..'\u02e4'
+ | '\u02ee'
+ | '\u037a'
+ | '\u0386'
+ | '\u0388'..'\u038a'
+ | '\u038c'
+ | '\u038e'..'\u03a1'
+ | '\u03a3'..'\u03ce'
+ | '\u03d0'..'\u03f5'
+ | '\u03f7'..'\u03fb'
+ | '\u0400'..'\u0481'
+ | '\u048a'..'\u04ce'
+ | '\u04d0'..'\u04f5'
+ | '\u04f8'..'\u04f9'
+ | '\u0500'..'\u050f'
+ | '\u0531'..'\u0556'
+ | '\u0559'
+ | '\u0561'..'\u0587'
+ | '\u05d0'..'\u05ea'
+ | '\u05f0'..'\u05f2'
+ | '\u0621'..'\u063a'
+ | '\u0640'..'\u064a'
+ | '\u066e'..'\u066f'
+ | '\u0671'..'\u06d3'
+ | '\u06d5'
+ | '\u06e5'..'\u06e6'
+ | '\u06ee'..'\u06ef'
+ | '\u06fa'..'\u06fc'
+ | '\u06ff'
+ | '\u0710'
+ | '\u0712'..'\u072f'
+ | '\u074d'..'\u074f'
+ | '\u0780'..'\u07a5'
+ | '\u07b1'
+ | '\u0904'..'\u0939'
+ | '\u093d'
+ | '\u0950'
+ | '\u0958'..'\u0961'
+ | '\u0985'..'\u098c'
+ | '\u098f'..'\u0990'
+ | '\u0993'..'\u09a8'
+ | '\u09aa'..'\u09b0'
+ | '\u09b2'
+ | '\u09b6'..'\u09b9'
+ | '\u09bd'
+ | '\u09dc'..'\u09dd'
+ | '\u09df'..'\u09e1'
+ | '\u09f0'..'\u09f3'
+ | '\u0a05'..'\u0a0a'
+ | '\u0a0f'..'\u0a10'
+ | '\u0a13'..'\u0a28'
+ | '\u0a2a'..'\u0a30'
+ | '\u0a32'..'\u0a33'
+ | '\u0a35'..'\u0a36'
+ | '\u0a38'..'\u0a39'
+ | '\u0a59'..'\u0a5c'
+ | '\u0a5e'
+ | '\u0a72'..'\u0a74'
+ | '\u0a85'..'\u0a8d'
+ | '\u0a8f'..'\u0a91'
+ | '\u0a93'..'\u0aa8'
+ | '\u0aaa'..'\u0ab0'
+ | '\u0ab2'..'\u0ab3'
+ | '\u0ab5'..'\u0ab9'
+ | '\u0abd'
+ | '\u0ad0'
+ | '\u0ae0'..'\u0ae1'
+ | '\u0af1'
+ | '\u0b05'..'\u0b0c'
+ | '\u0b0f'..'\u0b10'
+ | '\u0b13'..'\u0b28'
+ | '\u0b2a'..'\u0b30'
+ | '\u0b32'..'\u0b33'
+ | '\u0b35'..'\u0b39'
+ | '\u0b3d'
+ | '\u0b5c'..'\u0b5d'
+ | '\u0b5f'..'\u0b61'
+ | '\u0b71'
+ | '\u0b83'
+ | '\u0b85'..'\u0b8a'
+ | '\u0b8e'..'\u0b90'
+ | '\u0b92'..'\u0b95'
+ | '\u0b99'..'\u0b9a'
+ | '\u0b9c'
+ | '\u0b9e'..'\u0b9f'
+ | '\u0ba3'..'\u0ba4'
+ | '\u0ba8'..'\u0baa'
+ | '\u0bae'..'\u0bb5'
+ | '\u0bb7'..'\u0bb9'
+ | '\u0bf9'
+ | '\u0c05'..'\u0c0c'
+ | '\u0c0e'..'\u0c10'
+ | '\u0c12'..'\u0c28'
+ | '\u0c2a'..'\u0c33'
+ | '\u0c35'..'\u0c39'
+ | '\u0c60'..'\u0c61'
+ | '\u0c85'..'\u0c8c'
+ | '\u0c8e'..'\u0c90'
+ | '\u0c92'..'\u0ca8'
+ | '\u0caa'..'\u0cb3'
+ | '\u0cb5'..'\u0cb9'
+ | '\u0cbd'
+ | '\u0cde'
+ | '\u0ce0'..'\u0ce1'
+ | '\u0d05'..'\u0d0c'
+ | '\u0d0e'..'\u0d10'
+ | '\u0d12'..'\u0d28'
+ | '\u0d2a'..'\u0d39'
+ | '\u0d60'..'\u0d61'
+ | '\u0d85'..'\u0d96'
+ | '\u0d9a'..'\u0db1'
+ | '\u0db3'..'\u0dbb'
+ | '\u0dbd'
+ | '\u0dc0'..'\u0dc6'
+ | '\u0e01'..'\u0e30'
+ | '\u0e32'..'\u0e33'
+ | '\u0e3f'..'\u0e46'
+ | '\u0e81'..'\u0e82'
+ | '\u0e84'
+ | '\u0e87'..'\u0e88'
+ | '\u0e8a'
+ | '\u0e8d'
+ | '\u0e94'..'\u0e97'
+ | '\u0e99'..'\u0e9f'
+ | '\u0ea1'..'\u0ea3'
+ | '\u0ea5'
+ | '\u0ea7'
+ | '\u0eaa'..'\u0eab'
+ | '\u0ead'..'\u0eb0'
+ | '\u0eb2'..'\u0eb3'
+ | '\u0ebd'
+ | '\u0ec0'..'\u0ec4'
+ | '\u0ec6'
+ | '\u0edc'..'\u0edd'
+ | '\u0f00'
+ | '\u0f40'..'\u0f47'
+ | '\u0f49'..'\u0f6a'
+ | '\u0f88'..'\u0f8b'
+ | '\u1000'..'\u1021'
+ | '\u1023'..'\u1027'
+ | '\u1029'..'\u102a'
+ | '\u1050'..'\u1055'
+ | '\u10a0'..'\u10c5'
+ | '\u10d0'..'\u10f8'
+ | '\u1100'..'\u1159'
+ | '\u115f'..'\u11a2'
+ | '\u11a8'..'\u11f9'
+ | '\u1200'..'\u1206'
+ | '\u1208'..'\u1246'
+ | '\u1248'
+ | '\u124a'..'\u124d'
+ | '\u1250'..'\u1256'
+ | '\u1258'
+ | '\u125a'..'\u125d'
+ | '\u1260'..'\u1286'
+ | '\u1288'
+ | '\u128a'..'\u128d'
+ | '\u1290'..'\u12ae'
+ | '\u12b0'
+ | '\u12b2'..'\u12b5'
+ | '\u12b8'..'\u12be'
+ | '\u12c0'
+ | '\u12c2'..'\u12c5'
+ | '\u12c8'..'\u12ce'
+ | '\u12d0'..'\u12d6'
+ | '\u12d8'..'\u12ee'
+ | '\u12f0'..'\u130e'
+ | '\u1310'
+ | '\u1312'..'\u1315'
+ | '\u1318'..'\u131e'
+ | '\u1320'..'\u1346'
+ | '\u1348'..'\u135a'
+ | '\u13a0'..'\u13f4'
+ | '\u1401'..'\u166c'
+ | '\u166f'..'\u1676'
+ | '\u1681'..'\u169a'
+ | '\u16a0'..'\u16ea'
+ | '\u16ee'..'\u16f0'
+ | '\u1700'..'\u170c'
+ | '\u170e'..'\u1711'
+ | '\u1720'..'\u1731'
+ | '\u1740'..'\u1751'
+ | '\u1760'..'\u176c'
+ | '\u176e'..'\u1770'
+ | '\u1780'..'\u17b3'
+ | '\u17d7'
+ | '\u17db'..'\u17dc'
+ | '\u1820'..'\u1877'
+ | '\u1880'..'\u18a8'
+ | '\u1900'..'\u191c'
+ | '\u1950'..'\u196d'
+ | '\u1970'..'\u1974'
+ | '\u1d00'..'\u1d6b'
+ | '\u1e00'..'\u1e9b'
+ | '\u1ea0'..'\u1ef9'
+ | '\u1f00'..'\u1f15'
+ | '\u1f18'..'\u1f1d'
+ | '\u1f20'..'\u1f45'
+ | '\u1f48'..'\u1f4d'
+ | '\u1f50'..'\u1f57'
+ | '\u1f59'
+ | '\u1f5b'
+ | '\u1f5d'
+ | '\u1f5f'..'\u1f7d'
+ | '\u1f80'..'\u1fb4'
+ | '\u1fb6'..'\u1fbc'
+ | '\u1fbe'
+ | '\u1fc2'..'\u1fc4'
+ | '\u1fc6'..'\u1fcc'
+ | '\u1fd0'..'\u1fd3'
+ | '\u1fd6'..'\u1fdb'
+ | '\u1fe0'..'\u1fec'
+ | '\u1ff2'..'\u1ff4'
+ | '\u1ff6'..'\u1ffc'
+ | '\u203f'..'\u2040'
+ | '\u2054'
+ | '\u2071'
+ | '\u207f'
+ | '\u20a0'..'\u20b1'
+ | '\u2102'
+ | '\u2107'
+ | '\u210a'..'\u2113'
+ | '\u2115'
+ | '\u2119'..'\u211d'
+ | '\u2124'
+ | '\u2126'
+ | '\u2128'
+ | '\u212a'..'\u212d'
+ | '\u212f'..'\u2131'
+ | '\u2133'..'\u2139'
+ | '\u213d'..'\u213f'
+ | '\u2145'..'\u2149'
+ | '\u2160'..'\u2183'
+ | '\u3005'..'\u3007'
+ | '\u3021'..'\u3029'
+ | '\u3031'..'\u3035'
+ | '\u3038'..'\u303c'
+ | '\u3041'..'\u3096'
+ | '\u309d'..'\u309f'
+ | '\u30a1'..'\u30ff'
+ | '\u3105'..'\u312c'
+ | '\u3131'..'\u318e'
+ | '\u31a0'..'\u31b7'
+ | '\u31f0'..'\u31ff'
+ | '\u3400'..'\u4db5'
+ | '\u4e00'..'\u9fa5'
+ | '\ua000'..'\ua48c'
+ | '\uac00'..'\ud7a3'
+ | '\uf900'..'\ufa2d'
+ | '\ufa30'..'\ufa6a'
+ | '\ufb00'..'\ufb06'
+ | '\ufb13'..'\ufb17'
+ | '\ufb1d'
+ | '\ufb1f'..'\ufb28'
+ | '\ufb2a'..'\ufb36'
+ | '\ufb38'..'\ufb3c'
+ | '\ufb3e'
+ | '\ufb40'..'\ufb41'
+ | '\ufb43'..'\ufb44'
+ | '\ufb46'..'\ufbb1'
+ | '\ufbd3'..'\ufd3d'
+ | '\ufd50'..'\ufd8f'
+ | '\ufd92'..'\ufdc7'
+ | '\ufdf0'..'\ufdfc'
+ | '\ufe33'..'\ufe34'
+ | '\ufe4d'..'\ufe4f'
+ | '\ufe69'
+ | '\ufe70'..'\ufe74'
+ | '\ufe76'..'\ufefc'
+ | '\uff04'
+ | '\uff21'..'\uff3a'
+ | '\uff3f'
+ | '\uff41'..'\uff5a'
+ | '\uff65'..'\uffbe'
+ | '\uffc2'..'\uffc7'
+ | '\uffca'..'\uffcf'
+ | '\uffd2'..'\uffd7'
+ | '\uffda'..'\uffdc'
+ | '\uffe0'..'\uffe1'
+ | '\uffe5'..'\uffe6'
+// UTF-16: | ('\ud800'..'\udbff') ('\udc00'..'\udfff')
+ ;
+
+fragment
+IdentifierPart
+ : '\u0000'..'\u0008'
+ | '\u000e'..'\u001b'
+ | '\u0024'
+ | '\u0030'..'\u0039'
+ | '\u0041'..'\u005a'
+ | '\u005f'
+ | '\u0061'..'\u007a'
+ | '\u007f'..'\u009f'
+ | '\u00a2'..'\u00a5'
+ | '\u00aa'
+ | '\u00ad'
+ | '\u00b5'
+ | '\u00ba'
+ | '\u00c0'..'\u00d6'
+ | '\u00d8'..'\u00f6'
+ | '\u00f8'..'\u0236'
+ | '\u0250'..'\u02c1'
+ | '\u02c6'..'\u02d1'
+ | '\u02e0'..'\u02e4'
+ | '\u02ee'
+ | '\u0300'..'\u0357'
+ | '\u035d'..'\u036f'
+ | '\u037a'
+ | '\u0386'
+ | '\u0388'..'\u038a'
+ | '\u038c'
+ | '\u038e'..'\u03a1'
+ | '\u03a3'..'\u03ce'
+ | '\u03d0'..'\u03f5'
+ | '\u03f7'..'\u03fb'
+ | '\u0400'..'\u0481'
+ | '\u0483'..'\u0486'
+ | '\u048a'..'\u04ce'
+ | '\u04d0'..'\u04f5'
+ | '\u04f8'..'\u04f9'
+ | '\u0500'..'\u050f'
+ | '\u0531'..'\u0556'
+ | '\u0559'
+ | '\u0561'..'\u0587'
+ | '\u0591'..'\u05a1'
+ | '\u05a3'..'\u05b9'
+ | '\u05bb'..'\u05bd'
+ | '\u05bf'
+ | '\u05c1'..'\u05c2'
+ | '\u05c4'
+ | '\u05d0'..'\u05ea'
+ | '\u05f0'..'\u05f2'
+ | '\u0600'..'\u0603'
+ | '\u0610'..'\u0615'
+ | '\u0621'..'\u063a'
+ | '\u0640'..'\u0658'
+ | '\u0660'..'\u0669'
+ | '\u066e'..'\u06d3'
+ | '\u06d5'..'\u06dd'
+ | '\u06df'..'\u06e8'
+ | '\u06ea'..'\u06fc'
+ | '\u06ff'
+ | '\u070f'..'\u074a'
+ | '\u074d'..'\u074f'
+ | '\u0780'..'\u07b1'
+ | '\u0901'..'\u0939'
+ | '\u093c'..'\u094d'
+ | '\u0950'..'\u0954'
+ | '\u0958'..'\u0963'
+ | '\u0966'..'\u096f'
+ | '\u0981'..'\u0983'
+ | '\u0985'..'\u098c'
+ | '\u098f'..'\u0990'
+ | '\u0993'..'\u09a8'
+ | '\u09aa'..'\u09b0'
+ | '\u09b2'
+ | '\u09b6'..'\u09b9'
+ | '\u09bc'..'\u09c4'
+ | '\u09c7'..'\u09c8'
+ | '\u09cb'..'\u09cd'
+ | '\u09d7'
+ | '\u09dc'..'\u09dd'
+ | '\u09df'..'\u09e3'
+ | '\u09e6'..'\u09f3'
+ | '\u0a01'..'\u0a03'
+ | '\u0a05'..'\u0a0a'
+ | '\u0a0f'..'\u0a10'
+ | '\u0a13'..'\u0a28'
+ | '\u0a2a'..'\u0a30'
+ | '\u0a32'..'\u0a33'
+ | '\u0a35'..'\u0a36'
+ | '\u0a38'..'\u0a39'
+ | '\u0a3c'
+ | '\u0a3e'..'\u0a42'
+ | '\u0a47'..'\u0a48'
+ | '\u0a4b'..'\u0a4d'
+ | '\u0a59'..'\u0a5c'
+ | '\u0a5e'
+ | '\u0a66'..'\u0a74'
+ | '\u0a81'..'\u0a83'
+ | '\u0a85'..'\u0a8d'
+ | '\u0a8f'..'\u0a91'
+ | '\u0a93'..'\u0aa8'
+ | '\u0aaa'..'\u0ab0'
+ | '\u0ab2'..'\u0ab3'
+ | '\u0ab5'..'\u0ab9'
+ | '\u0abc'..'\u0ac5'
+ | '\u0ac7'..'\u0ac9'
+ | '\u0acb'..'\u0acd'
+ | '\u0ad0'
+ | '\u0ae0'..'\u0ae3'
+ | '\u0ae6'..'\u0aef'
+ | '\u0af1'
+ | '\u0b01'..'\u0b03'
+ | '\u0b05'..'\u0b0c'
+ | '\u0b0f'..'\u0b10'
+ | '\u0b13'..'\u0b28'
+ | '\u0b2a'..'\u0b30'
+ | '\u0b32'..'\u0b33'
+ | '\u0b35'..'\u0b39'
+ | '\u0b3c'..'\u0b43'
+ | '\u0b47'..'\u0b48'
+ | '\u0b4b'..'\u0b4d'
+ | '\u0b56'..'\u0b57'
+ | '\u0b5c'..'\u0b5d'
+ | '\u0b5f'..'\u0b61'
+ | '\u0b66'..'\u0b6f'
+ | '\u0b71'
+ | '\u0b82'..'\u0b83'
+ | '\u0b85'..'\u0b8a'
+ | '\u0b8e'..'\u0b90'
+ | '\u0b92'..'\u0b95'
+ | '\u0b99'..'\u0b9a'
+ | '\u0b9c'
+ | '\u0b9e'..'\u0b9f'
+ | '\u0ba3'..'\u0ba4'
+ | '\u0ba8'..'\u0baa'
+ | '\u0bae'..'\u0bb5'
+ | '\u0bb7'..'\u0bb9'
+ | '\u0bbe'..'\u0bc2'
+ | '\u0bc6'..'\u0bc8'
+ | '\u0bca'..'\u0bcd'
+ | '\u0bd7'
+ | '\u0be7'..'\u0bef'
+ | '\u0bf9'
+ | '\u0c01'..'\u0c03'
+ | '\u0c05'..'\u0c0c'
+ | '\u0c0e'..'\u0c10'
+ | '\u0c12'..'\u0c28'
+ | '\u0c2a'..'\u0c33'
+ | '\u0c35'..'\u0c39'
+ | '\u0c3e'..'\u0c44'
+ | '\u0c46'..'\u0c48'
+ | '\u0c4a'..'\u0c4d'
+ | '\u0c55'..'\u0c56'
+ | '\u0c60'..'\u0c61'
+ | '\u0c66'..'\u0c6f'
+ | '\u0c82'..'\u0c83'
+ | '\u0c85'..'\u0c8c'
+ | '\u0c8e'..'\u0c90'
+ | '\u0c92'..'\u0ca8'
+ | '\u0caa'..'\u0cb3'
+ | '\u0cb5'..'\u0cb9'
+ | '\u0cbc'..'\u0cc4'
+ | '\u0cc6'..'\u0cc8'
+ | '\u0cca'..'\u0ccd'
+ | '\u0cd5'..'\u0cd6'
+ | '\u0cde'
+ | '\u0ce0'..'\u0ce1'
+ | '\u0ce6'..'\u0cef'
+ | '\u0d02'..'\u0d03'
+ | '\u0d05'..'\u0d0c'
+ | '\u0d0e'..'\u0d10'
+ | '\u0d12'..'\u0d28'
+ | '\u0d2a'..'\u0d39'
+ | '\u0d3e'..'\u0d43'
+ | '\u0d46'..'\u0d48'
+ | '\u0d4a'..'\u0d4d'
+ | '\u0d57'
+ | '\u0d60'..'\u0d61'
+ | '\u0d66'..'\u0d6f'
+ | '\u0d82'..'\u0d83'
+ | '\u0d85'..'\u0d96'
+ | '\u0d9a'..'\u0db1'
+ | '\u0db3'..'\u0dbb'
+ | '\u0dbd'
+ | '\u0dc0'..'\u0dc6'
+ | '\u0dca'
+ | '\u0dcf'..'\u0dd4'
+ | '\u0dd6'
+ | '\u0dd8'..'\u0ddf'
+ | '\u0df2'..'\u0df3'
+ | '\u0e01'..'\u0e3a'
+ | '\u0e3f'..'\u0e4e'
+ | '\u0e50'..'\u0e59'
+ | '\u0e81'..'\u0e82'
+ | '\u0e84'
+ | '\u0e87'..'\u0e88'
+ | '\u0e8a'
+ | '\u0e8d'
+ | '\u0e94'..'\u0e97'
+ | '\u0e99'..'\u0e9f'
+ | '\u0ea1'..'\u0ea3'
+ | '\u0ea5'
+ | '\u0ea7'
+ | '\u0eaa'..'\u0eab'
+ | '\u0ead'..'\u0eb9'
+ | '\u0ebb'..'\u0ebd'
+ | '\u0ec0'..'\u0ec4'
+ | '\u0ec6'
+ | '\u0ec8'..'\u0ecd'
+ | '\u0ed0'..'\u0ed9'
+ | '\u0edc'..'\u0edd'
+ | '\u0f00'
+ | '\u0f18'..'\u0f19'
+ | '\u0f20'..'\u0f29'
+ | '\u0f35'
+ | '\u0f37'
+ | '\u0f39'
+ | '\u0f3e'..'\u0f47'
+ | '\u0f49'..'\u0f6a'
+ | '\u0f71'..'\u0f84'
+ | '\u0f86'..'\u0f8b'
+ | '\u0f90'..'\u0f97'
+ | '\u0f99'..'\u0fbc'
+ | '\u0fc6'
+ | '\u1000'..'\u1021'
+ | '\u1023'..'\u1027'
+ | '\u1029'..'\u102a'
+ | '\u102c'..'\u1032'
+ | '\u1036'..'\u1039'
+ | '\u1040'..'\u1049'
+ | '\u1050'..'\u1059'
+ | '\u10a0'..'\u10c5'
+ | '\u10d0'..'\u10f8'
+ | '\u1100'..'\u1159'
+ | '\u115f'..'\u11a2'
+ | '\u11a8'..'\u11f9'
+ | '\u1200'..'\u1206'
+ | '\u1208'..'\u1246'
+ | '\u1248'
+ | '\u124a'..'\u124d'
+ | '\u1250'..'\u1256'
+ | '\u1258'
+ | '\u125a'..'\u125d'
+ | '\u1260'..'\u1286'
+ | '\u1288'
+ | '\u128a'..'\u128d'
+ | '\u1290'..'\u12ae'
+ | '\u12b0'
+ | '\u12b2'..'\u12b5'
+ | '\u12b8'..'\u12be'
+ | '\u12c0'
+ | '\u12c2'..'\u12c5'
+ | '\u12c8'..'\u12ce'
+ | '\u12d0'..'\u12d6'
+ | '\u12d8'..'\u12ee'
+ | '\u12f0'..'\u130e'
+ | '\u1310'
+ | '\u1312'..'\u1315'
+ | '\u1318'..'\u131e'
+ | '\u1320'..'\u1346'
+ | '\u1348'..'\u135a'
+ | '\u1369'..'\u1371'
+ | '\u13a0'..'\u13f4'
+ | '\u1401'..'\u166c'
+ | '\u166f'..'\u1676'
+ | '\u1681'..'\u169a'
+ | '\u16a0'..'\u16ea'
+ | '\u16ee'..'\u16f0'
+ | '\u1700'..'\u170c'
+ | '\u170e'..'\u1714'
+ | '\u1720'..'\u1734'
+ | '\u1740'..'\u1753'
+ | '\u1760'..'\u176c'
+ | '\u176e'..'\u1770'
+ | '\u1772'..'\u1773'
+ | '\u1780'..'\u17d3'
+ | '\u17d7'
+ | '\u17db'..'\u17dd'
+ | '\u17e0'..'\u17e9'
+ | '\u180b'..'\u180d'
+ | '\u1810'..'\u1819'
+ | '\u1820'..'\u1877'
+ | '\u1880'..'\u18a9'
+ | '\u1900'..'\u191c'
+ | '\u1920'..'\u192b'
+ | '\u1930'..'\u193b'
+ | '\u1946'..'\u196d'
+ | '\u1970'..'\u1974'
+ | '\u1d00'..'\u1d6b'
+ | '\u1e00'..'\u1e9b'
+ | '\u1ea0'..'\u1ef9'
+ | '\u1f00'..'\u1f15'
+ | '\u1f18'..'\u1f1d'
+ | '\u1f20'..'\u1f45'
+ | '\u1f48'..'\u1f4d'
+ | '\u1f50'..'\u1f57'
+ | '\u1f59'
+ | '\u1f5b'
+ | '\u1f5d'
+ | '\u1f5f'..'\u1f7d'
+ | '\u1f80'..'\u1fb4'
+ | '\u1fb6'..'\u1fbc'
+ | '\u1fbe'
+ | '\u1fc2'..'\u1fc4'
+ | '\u1fc6'..'\u1fcc'
+ | '\u1fd0'..'\u1fd3'
+ | '\u1fd6'..'\u1fdb'
+ | '\u1fe0'..'\u1fec'
+ | '\u1ff2'..'\u1ff4'
+ | '\u1ff6'..'\u1ffc'
+ | '\u200c'..'\u200f'
+ | '\u202a'..'\u202e'
+ | '\u203f'..'\u2040'
+ | '\u2054'
+ | '\u2060'..'\u2063'
+ | '\u206a'..'\u206f'
+ | '\u2071'
+ | '\u207f'
+ | '\u20a0'..'\u20b1'
+ | '\u20d0'..'\u20dc'
+ | '\u20e1'
+ | '\u20e5'..'\u20ea'
+ | '\u2102'
+ | '\u2107'
+ | '\u210a'..'\u2113'
+ | '\u2115'
+ | '\u2119'..'\u211d'
+ | '\u2124'
+ | '\u2126'
+ | '\u2128'
+ | '\u212a'..'\u212d'
+ | '\u212f'..'\u2131'
+ | '\u2133'..'\u2139'
+ | '\u213d'..'\u213f'
+ | '\u2145'..'\u2149'
+ | '\u2160'..'\u2183'
+ | '\u3005'..'\u3007'
+ | '\u3021'..'\u302f'
+ | '\u3031'..'\u3035'
+ | '\u3038'..'\u303c'
+ | '\u3041'..'\u3096'
+ | '\u3099'..'\u309a'
+ | '\u309d'..'\u309f'
+ | '\u30a1'..'\u30ff'
+ | '\u3105'..'\u312c'
+ | '\u3131'..'\u318e'
+ | '\u31a0'..'\u31b7'
+ | '\u31f0'..'\u31ff'
+ | '\u3400'..'\u4db5'
+ | '\u4e00'..'\u9fa5'
+ | '\ua000'..'\ua48c'
+ | '\uac00'..'\ud7a3'
+ | '\uf900'..'\ufa2d'
+ | '\ufa30'..'\ufa6a'
+ | '\ufb00'..'\ufb06'
+ | '\ufb13'..'\ufb17'
+ | '\ufb1d'..'\ufb28'
+ | '\ufb2a'..'\ufb36'
+ | '\ufb38'..'\ufb3c'
+ | '\ufb3e'
+ | '\ufb40'..'\ufb41'
+ | '\ufb43'..'\ufb44'
+ | '\ufb46'..'\ufbb1'
+ | '\ufbd3'..'\ufd3d'
+ | '\ufd50'..'\ufd8f'
+ | '\ufd92'..'\ufdc7'
+ | '\ufdf0'..'\ufdfc'
+ | '\ufe00'..'\ufe0f'
+ | '\ufe20'..'\ufe23'
+ | '\ufe33'..'\ufe34'
+ | '\ufe4d'..'\ufe4f'
+ | '\ufe69'
+ | '\ufe70'..'\ufe74'
+ | '\ufe76'..'\ufefc'
+ | '\ufeff'
+ | '\uff04'
+ | '\uff10'..'\uff19'
+ | '\uff21'..'\uff3a'
+ | '\uff3f'
+ | '\uff41'..'\uff5a'
+ | '\uff65'..'\uffbe'
+ | '\uffc2'..'\uffc7'
+ | '\uffca'..'\uffcf'
+ | '\uffd2'..'\uffd7'
+ | '\uffda'..'\uffdc'
+ | '\uffe0'..'\uffe1'
+ | '\uffe5'..'\uffe6'
+ | '\ufff9'..'\ufffb'
+// UTF-16 | ('\ud800'..'\udbff') ('\udc00'..'\udfff')
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Keywords.g
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Keywords.g (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Keywords.g 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,1366 @@
+parser grammar DRLv6Keywords;
+
+
+
+ at parser::members {
+ private ParserHelper helper = null;
+ public void setParserHelper( ParserHelper helper ) { this.helper = helper; }
+ public void reportError(RecognitionException ex) { helper.reportError( ex ); }
+}
+
+
+// --------------------------------------------------------
+// KEYWORDS
+// --------------------------------------------------------
+operator_key
+ : {(helper.isPluggableEvaluator(false))}? id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER); }
+ -> VK_OPERATOR[$id]
+ ;
+
+neg_operator_key
+ : {(helper.isPluggableEvaluator(true))}? id=ID
+ { helper.emit($id, DroolsEditorType.IDENTIFIER); }
+ -> VK_OPERATOR[$id]
+ ;
+
+ra_lock_on_active_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.LOCK) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.ON) && helper.validateLT(4, "-") && helper.validateLT(5, DroolsSoftKeywords.ACTIVE))}? id1=ID mis1=MINUS id2=ID mis2=MINUS id3=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD);
+ helper.emit($mis2, DroolsEditorType.KEYWORD);
+ helper.emit($id3, DroolsEditorType.KEYWORD); }
+ -> VK_LOCK_ON_ACTIVE[$start, text]
+ ;
+
+ra_date_effective_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.DATE) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.EFFECTIVE))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_DATE_EFFECTIVE[$start, text]
+ ;
+
+ra_date_expires_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.DATE) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.EXPIRES))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_DATE_EXPIRES[$start, text]
+ ;
+
+ra_no_loop_key
+ at init{
+ String text = "";
+} :
+ {(helper.validateIdentifierKey(DroolsSoftKeywords.NO)
+ && helper.validateLT(2, "-")
+ && helper.validateLT(3, DroolsSoftKeywords.LOOP))}?
+
+ id1=ID mis1=MINUS id2=ID {text = $text;}
+
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_AUTO_FOCUS[$start, text]
+ ;
+
+
+
+ra_auto_focus_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.AUTO) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.FOCUS))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_AUTO_FOCUS[$start, text]
+ ;
+
+ra_activation_group_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACTIVATION) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.GROUP))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_ACTIVATION_GROUP[$start, text]
+ ;
+
+ra_agenda_group_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.AGENDA) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.GROUP))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_AGENDA_GROUP[$start, text]
+ ;
+
+ra_ruleflow_group_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.RULEFLOW) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.GROUP))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_RULEFLOW_GROUP[$start, text]
+ ;
+
+entry_point_key
+ at init{
+ String text = "";
+} : {(helper.validateIdentifierKey(DroolsSoftKeywords.ENTRY) && helper.validateLT(2, "-") && helper.validateLT(3, DroolsSoftKeywords.POINT))}? id1=ID mis1=MINUS id2=ID {text = $text;}
+ { helper.emit($id1, DroolsEditorType.KEYWORD);
+ helper.emit($mis1, DroolsEditorType.KEYWORD);
+ helper.emit($id2, DroolsEditorType.KEYWORD); }
+ -> VK_ENTRY_POINT[$start, text]
+ ;
+
+timer_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TIMER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TIMER[$id]
+ ;
+
+
+
+calendars_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CALENDARS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CALENDARS[$id]
+ ;
+
+package_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PACKAGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PACKAGE[$id]
+ ;
+
+import_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.IMPORT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_IMPORT[$id]
+ ;
+
+
+salience_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SALIENCE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SALIENCE[$id]
+ ;
+
+enabled_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ENABLED))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ENABLED[$id]
+ ;
+
+attributes_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ATTRIBUTES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ATTRIBUTES[$id]
+ ;
+
+rule_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RULE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RULE[$id]
+ ;
+
+extend_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXTEND))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXTEND[$id]
+ ;
+
+template_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TEMPLATE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TEMPLATE[$id]
+ ;
+
+query_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.QUERY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_QUERY[$id]
+ ;
+
+declare_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DECLARE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DECLARE[$id]
+ ;
+
+function_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FUNCTION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FUNCTION[$id]
+ ;
+
+
+
+
+not_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NOT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NOT[$id]
+ ;
+
+in_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.IN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_IN[$id]
+ ;
+
+or_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OR))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OR[$id]
+ ;
+
+and_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.AND))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_AND[$id]
+ ;
+
+exists_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXISTS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXISTS[$id]
+ ;
+
+forall_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FORALL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FORALL[$id]
+ ;
+
+action_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACTION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACTION[$id]
+ ;
+
+reverse_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.REVERSE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_REVERSE[$id]
+ ;
+
+result_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RESULT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RESULT[$id]
+ ;
+
+end_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.END))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_END[$id]
+ ;
+
+//not_end_key
+// : {!(helper.validateIdentifierKey(DroolsSoftKeywords.END))}? any=.
+// { helper.emit($any, DroolsEditorType.CODE_CHUNK); }
+// ;
+
+init_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INIT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INIT[$id]
+ ;
+
+instanceof_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INSTANCEOF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INSTANCEOF[$id]
+ ;
+
+extends_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXTENDS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXTENDS[$id]
+ ;
+
+super_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUPER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUPER[$id]
+ ;
+
+boolean_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.BOOLEAN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+char_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CHAR))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+byte_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.BYTE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+short_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SHORT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+int_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+long_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LONG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+float_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FLOAT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PRIMITIVE_TYPE[$id]
+ ;
+
+
+
+this_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.THIS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_THIS[$id]
+ ;
+
+void_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.VOID))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_VOID[$id]
+ ;
+
+class_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CLASS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CLASS[$id]
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ra_calendar_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_CALENDAR))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_CALENDAR[$id]
+ ;
+
+ra_effective_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DATE_EFFECTIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DATE_EFFECTIVE[$id]
+ ;
+
+ra_expires_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DATE_EXPIRES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DATE_EXPIRES[$id]
+ ;
+
+ra_deduction_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DEDUCTION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DEDUCTION[$id]
+ ;
+
+ra_dialect_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DIALECT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DIALECT[$id]
+ ;
+
+ra_abductive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DIRECTION_ABDUCTIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DIRECTION_ABDUCTIVE[$id]
+ ;
+
+ra_deductive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DIRECTION_DEDUCTIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DIRECTION_DEDUCTIVE[$id]
+ ;
+
+ra_equivalence_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DIRECTION_EQUIVALENCE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DIRECTION_EQUIVALENCE[$id]
+ ;
+
+ra_duration_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_DURATION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_DURATION[$id]
+ ;
+
+ra_enabled_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_ENABLED))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_ENABLED[$id]
+ ;
+
+ra_implication_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_IMPLICATION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_IMPLICATION[$id]
+ ;
+
+
+
+ra_salience_key
+ : {System.out.println("Called salience key");}
+ {(helper.validateIdentifierKey(DroolsSoftKeywords.A_SALIENCE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_SALIENCE[$id]
+ ;
+
+ra_timer_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.A_TIMER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_A_TIMER[$id]
+ ;
+
+acc_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACC))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACC[$id]
+ ;
+
+accL_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACCL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACCL[$id]
+ ;
+
+accumulate_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACCUMULATE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACCUMULATE[$id]
+ ;
+
+accR_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACCUMULATE_RIGHT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACCUMULATE_RIGHT[$id]
+ ;
+
+
+activation_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACTIVATION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACTIVATION[$id]
+ ;
+
+active_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ACTIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ACTIVE[$id]
+ ;
+
+agenda_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.AGENDA))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_AGENDA[$id]
+ ;
+
+all_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ALL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ALL[$id]
+ ;
+
+
+
+annotations_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ANNOTATIONS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ANNOTATIONS[$id]
+ ;
+
+
+another_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ANOTHER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ANOTHER[$id]
+ ;
+
+
+as_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.AS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_AS[$id]
+ ;
+
+
+
+
+
+avg_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.AVERAGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_AVERAGE[$id]
+ ;
+
+true_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.BOOL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_BOOL[$id]
+ ;
+
+
+
+branch_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.BRANCH))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_BRANCH[$id]
+ ;
+
+
+
+
+characteristics_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CHARACTERISTICS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CHARACTERISTICS[$id]
+ ;
+
+closure_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CLOSURE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CLOSURE[$id]
+ ;
+
+collect_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.COLLECT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_COLLECT[$id]
+ ;
+
+collectList_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.COLLECT_LIST))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_COLLECT_LIST[$id]
+ ;
+
+contains_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.CONTAINS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_CONTAINS[$id]
+ ;
+
+count_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.COUNT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_COUNT[$id]
+ ;
+
+datatype_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DATATYPE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DATATYPE[$id]
+ ;
+
+date_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DATE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DATE[$id]
+ ;
+
+
+
+ra_defeats_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DEFEATS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DEFEATS[$id]
+ ;
+
+
+differentIndividuals_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DIFFERENT_INDIVIDUALS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DIFFERENT_INDIVIDUALS[$id]
+ ;
+
+differentFrom_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DIFFERENTFROM))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DIFFERENTFROM[$id]
+ ;
+
+disjointWith_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISJOINT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISJOINT[$id]
+ ;
+
+disjointClasses_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISJOINT_CLASSES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISJOINT_CLASSES[$id]
+ ;
+
+disjointProperties_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISJOINT_PROPERTIES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISJOINT_PROPERTIES[$id]
+ ;
+
+disjointUnionOf_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISJOINT_UNION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISJOINT_UNION[$id]
+ ;
+
+distinct_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DISTINCT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DISTINCT[$id]
+ ;
+
+do_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DO))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DO[$id]
+ ;
+
+domain_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DOMAIN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DOMAIN[$id]
+ ;
+
+double_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.DOUBLE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_DOUBLE[$id]
+ ;
+
+
+
+
+
+entry_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ENTRY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ENTRY[$id]
+ ;
+
+
+
+equiv_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EQUIV))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EQUIV[$id]
+ ;
+
+equivalentClasses_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EQUIVALENT_CLASSES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EQUIVALENT_CLASSES[$id]
+ ;
+
+equivalentProperties_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EQUIVALENT_PROPERTIES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EQUIVALENT_PROPERTIES[$id]
+ ;
+
+equivalentTo_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EQUIVALENTTO))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EQUIVALENTTO[$id]
+ ;
+
+
+
+event_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EVENT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EVENT[$id]
+ ;
+
+exactly_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXACTLY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXACTLY[$id]
+ ;
+
+excludes_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXCLUDES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXCLUDES[$id]
+ ;
+
+
+
+expires_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.EXPIRES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_EXPIRES[$id]
+ ;
+
+
+
+
+
+facts_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FACTS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FACTS[$id]
+ ;
+
+falling_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FALLING))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FALLING[$id]
+ ;
+
+filter_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FILTER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FILTER[$id]
+ ;
+
+
+
+
+
+
+
+from_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.FROM))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_FROM[$id]
+ ;
+
+global_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.GLOBAL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_GLOBAL[$id]
+ ;
+
+group_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.GROUP))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_GROUP[$id]
+ ;
+
+hasKey_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.HASKEY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_HASKEY[$id]
+ ;
+
+implies_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.IMPLIES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_IMPLIES[$id]
+ ;
+
+
+
+
+individual_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INDIVIDUAL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INDIVIDUAL[$id]
+ ;
+
+
+
+insert_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INSERT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INSERT[$id]
+ ;
+
+insertLogical_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INSERT_LOG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INSERT_LOG[$id]
+ ;
+
+
+
+inverse_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INVERSE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INVERSE[$id]
+ ;
+
+inverseOf_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.INVERSEOF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_INVERSEOF[$id]
+ ;
+
+java_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.JAVA))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_JAVA[$id]
+ ;
+
+key_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.KEY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_KEY[$id]
+ ;
+
+facet_length_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LENGTH))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LENGTH[$id]
+ ;
+
+length_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LENGTH))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LENGTH[$id]
+ ;
+
+
+facet_maxLength_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LENGTH_MAX))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LENGTH_MAX[$id]
+ ;
+
+facet_minLength_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LENGTH_MIN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LENGTH_MIN[$id]
+ ;
+
+limit_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LIMIT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LIMIT[$id]
+ ;
+
+lock_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.LOCK))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_LOCK[$id]
+ ;
+
+
+matches_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MATCHES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MATCHES[$id]
+ ;
+
+max_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MAX))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MAX[$id]
+ ;
+
+mda_functional_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_FUNCTIONAL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_FUNCTIONAL[$id]
+ ;
+
+mda_inverseFunctional_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_FUNCTIONAL_INV))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_FUNCTIONAL_INV[$id]
+ ;
+
+mda_reflexive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_REFLEXIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_REFLEXIVE[$id]
+ ;
+
+mda_irreflexive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_REFLEXIVE_INV))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_REFLEXIVE_INV[$id]
+ ;
+
+mda_symmetric_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_SYMMETRIC))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_SYMMETRIC[$id]
+ ;
+
+mda_asymmetric_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_SYMMETRIC_INV))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_SYMMETRIC_INV[$id]
+ ;
+
+mda_transitive_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MDA_TRANSITIVE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MDA_TRANSITIVE[$id]
+ ;
+
+memberof_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MEMBEROF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MEMBEROF[$id]
+ ;
+
+min_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MIN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MIN[$id]
+ ;
+
+modify_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MODIFY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MODIFY[$id]
+ ;
+
+modifyLogical_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MODIFY_LOG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MODIFY_LOG[$id]
+ ;
+
+mol_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MOL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MOL[$id]
+ ;
+
+mvel_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.MVEL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_MVEL[$id]
+ ;
+
+namespace_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NAMESPACE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NAMESPACE[$id]
+ ;
+
+neg_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NEG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NEG[$id]
+ ;
+
+new_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NEW))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NEW[$id]
+ ;
+
+
+
+null_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.NULL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_NULL[$id]
+ ;
+
+oa_crisp_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_CRISP))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_CRISP[$id]
+ ;
+
+oa_default_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_DEFAULT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_DEFAULT[$id]
+ ;
+
+oa_defeat_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_DEFEAT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_DEFEAT[$id]
+ ;
+
+oa_degree_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_DEGREE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_DEGREE[$id]
+ ;
+
+oa_id_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_ID))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_ID[$id]
+ ;
+
+oa_kind_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_KIND))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_KIND[$id]
+ ;
+
+oa_merge_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_MERGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_MERGE[$id]
+ ;
+
+oa_missing_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_MISSING))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_MISSING[$id]
+ ;
+
+oa_otherwise_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_OTHERWISE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_OTHERWISE[$id]
+ ;
+
+oa_params_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OA_PARAMS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OA_PARAMS[$id]
+ ;
+
+on_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ON))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ON[$id]
+ ;
+
+onChange_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ONCHANGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ONCHANGE[$id]
+ ;
+
+only_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ONLY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ONLY[$id]
+ ;
+
+ontology_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ONTOLOGY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ONTOLOGY[$id]
+ ;
+
+orderby_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ORDERBY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ORDERBY[$id]
+ ;
+
+otherwise_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OTHERWISE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OTHERWISE[$id]
+ ;
+
+over_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.OVER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_OVER[$id]
+ ;
+
+facet_pattern_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PATTERN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PATTERN[$id]
+ ;
+
+facet_langPattern_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PATTERN_LANG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PATTERN_LANG[$id]
+ ;
+
+point_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.POINT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_POINT[$id]
+ ;
+
+prefix_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PREFIX))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PREFIX[$id]
+ ;
+
+property_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PROPERTY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PROPERTY[$id]
+ ;
+
+annotationProperty_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PROPERTY_ANNOTATION))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PROPERTY_ANNOTATION[$id]
+ ;
+
+dataProperty_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PROPERTY_DATA))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PROPERTY_DATA[$id]
+ ;
+
+objectProperty_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.PROPERTY_OBJECT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_PROPERTY_OBJECT[$id]
+ ;
+
+
+
+range_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RANGE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RANGE[$id]
+ ;
+
+
+retract_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RETRACT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RETRACT[$id]
+ ;
+
+retractLogical_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RETRACT_LOG))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RETRACT_LOG[$id]
+ ;
+
+
+
+rising_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RISING))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RISING[$id]
+ ;
+
+role_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.ROLE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_ROLE[$id]
+ ;
+
+
+
+ruleflow_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.RULEFLOW))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_RULEFLOW[$id]
+ ;
+
+
+sameIndividual_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SAME_INDIVIDUAL))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SAME_INDIVIDUAL[$id]
+ ;
+
+sameAs_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SAMEAS))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SAMEAS[$id]
+ ;
+
+self_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SELF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SELF[$id]
+ ;
+
+seq_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SEQ))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SEQ[$id]
+ ;
+
+some_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SOME))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SOME[$id]
+ ;
+
+soundslike_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SOUNDSLIKE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SOUNDSLIKE[$id]
+ ;
+
+start_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.START))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_START[$id]
+ ;
+
+subClassOf_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUBCLASSOF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUBCLASSOF[$id]
+ ;
+
+subPropertyChain_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUBPROPERTYCHAIN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUBPROPERTYCHAIN[$id]
+ ;
+
+subPropertyOf_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUBPROPERTYOF))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUBPROPERTYOF[$id]
+ ;
+
+sum_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.SUM))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_SUM[$id]
+ ;
+
+
+
+that_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.THAT))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_THAT[$id]
+ ;
+
+then_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.THEN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_THEN[$id]
+ ;
+
+
+
+throttle_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.THROTTLE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_THROTTLE[$id]
+ ;
+
+time_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TIME))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TIME[$id]
+ ;
+
+
+
+type_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TYPE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TYPE[$id]
+ ;
+
+
+
+
+integer_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TYPE_INTEGER))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TYPE_INTEGER[$id]
+ ;
+
+string_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TYPE_STRING))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TYPE_STRING[$id]
+ ;
+
+types_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.TYPES))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_TYPES[$id]
+ ;
+
+unique_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.UNIQUE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_UNIQUE[$id]
+ ;
+
+update_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.UPDATE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_UPDATE[$id]
+ ;
+
+value_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.VALUE))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_VALUE[$id]
+ ;
+
+very_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.VERY))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_VERY[$id]
+ ;
+
+
+
+when_key
+ :
+ {(helper.validateIdentifierKey(DroolsSoftKeywords.WHEN))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_WHEN[$id]
+ ;
+
+window_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.WINDOW))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_WINDOW[$id]
+ ;
+
+xor_key
+ : {(helper.validateIdentifierKey(DroolsSoftKeywords.XOR))}? id=ID
+ { helper.emit($id, DroolsEditorType.KEYWORD); }
+ -> VK_XOR[$id]
+ ;
\ No newline at end of file
Deleted: labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g 2010-09-01 21:27:01 UTC (rev 34967)
+++ labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g 2010-09-01 21:33:07 UTC (rev 34968)
@@ -1,1665 +0,0 @@
-lexer grammar DRLv6Lexer;
-
-options {
- language = Java;
-}
-
- at lexer::header {
- package org.drools.lang;
-
-}
-
-
-
-
-WS : ( ' '
- | '\t'
- | '\f'
- | EOL
- )+
- { $channel=HIDDEN; }
- ;
-
-fragment
-EOL :
- ( ( '\r\n' )=> '\r\n' // Evil DOS
- | '\r' // Macintosh
- | '\n' // Unix (the right way)
- )
- ;
-
-FLOAT
-options { k=*; }
- : ('-')?('0'..'9')+ '.' ('0'..'9')+
- ;
-
-INT
-options { k=*; }
- : ('-')?('0'..'9')+
- ;
-
-STRING
- : ('"' ( EscapeSequence | ~('\\'|'"') )+ '"')
- | ('\'' ( EscapeSequence | ~('\\'|'\'') )+ '\'')
- ;
-
-fragment
-HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
-
-fragment
-EscapeSequence
- : '\\' ('b'|'B'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\'|'.'|'o'|
- 'x'|'a'|'e'|'c'|'d'|'D'|'s'|'S'|'w'|'W'|'p'|'A'|
- 'G'|'Z'|'z'|'Q'|'E'|'*'|'['|']'|'('|')'|'$'|'^'|
- '{'|'}'|'?'|'+'|'-'|'&'|'|')
- | UnicodeEscape
- | OctalEscape
- ;
-
-fragment
-OctalEscape
- : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
- | '\\' ('0'..'7') ('0'..'7')
- | '\\' ('0'..'7')
- ;
-
-fragment
-UnicodeEscape
- : '\\' 'u' HexDigit HexDigit HexDigit HexDigit
- ;
-
-
-
-
-
-
-
-A_DATE_EFFECTIVE
- : 'effective'
- ;
-
-A_DATE_EXPIRES
- : 'expires'
- ;
-
-A_ENABLED
- : 'enabled'
- ;
-
-A_SALIENCE
- : 'salience'
- ;
-
-A_NOLOOP
- : 'no-loop'
- ;
-
-A_AUTOFOCUS
- : 'auto-focus'
- ;
-
-A_ACTGROUP
- : 'activation-group'
- ;
-
-A_RULEFLOWGROUP
- : 'ruleflow-group'
- ;
-
-A_AGENDAGROUP
- : 'agenda-group'
- ;
-
-A_DURATION
- : 'duration'
- ;
-
-A_TIMER
- : 'timer'
- ;
-
-A_CALENDAR
- : 'calendar'
- ;
-
-
-A_DIALECT
- : 'dialect'
- ;
-
-A_LOCKONACTIVE
- : 'lock-on-active'
- ;
-
-A_DEDUCTION
- : 'deduction'
- ;
-
-A_IMPLICATION
- : 'implication'
- ;
-
-A_DIRECTION
- : 'deductive'
- | 'abductive'
- | 'equivalence'
- ;
-
-
-
-
-MDA_FUNCTIONAL
- : 'functional' | 'Functional'
- ;
-
-MDA_FUNCTIONAL_INV
- : 'inverseFunctional' | 'InverseFunctional'
- ;
-
-MDA_REFLEXIVE
- : 'reflexive' | 'Reflexive'
- ;
-
-MDA_REFLEXIVE_INV
- : 'irreflexive' | 'Irreflexive'
- ;
-
-MDA_SYMMETRIC
- : 'symmetric' | 'Symmetric'
- ;
-
-MDA_SYMMETRIC_INV
- : 'asymmetric' | 'Asymmetric'
- ;
-
-MDA_TRANSITIVE
- : 'transitive' | 'Transitive'
- ;
-
-
-
-OA_KIND
- : 'kind'
- ;
-
-OA_ID
- : 'id'
- ;
-
-OA_PARAMS
- : 'params'
- ;
-
-OA_DEGREE
- : 'degree'
- ;
-
-OA_CRISP
- : 'crisp'
- ;
-
-OA_MERGE
- : 'merge'
- ;
-
-/*
-OA_FILTER
- : 'filter'
- ;
-*/
-
-OA_MISSING
- : 'missing'
- ;
-
-OA_DEFEAT
- : 'defeat'
- ;
-
-OA_DEFAULT
- : 'default'
- ;
-
-OA_OTHERWISE
- : 'otherwise'
- ;
-
-
-ACCUMULATE
- : ( 'acc' | 'accumulate' | 'accL')
- ;
-
-ACCUMULATE_RIGHT
- : 'accR'
- ;
-
-ACTION
- : 'action'
- ;
-
-AND
- : 'and'
- ;
-
-ANNOTATIONS
- : 'annotations' | 'Annotations'
- ;
-
-AS
- : 'as'
- ;
-
-ATTRIBUTES
- : 'attributes'
- ;
-
-AVERAGE
- : 'avg'
- ;
-
-BOOL
- : ('true'|'false')
- ;
-
-BRANCH
- : 'branch'
- ;
-
-CHARACTERISTICS
- : 'Characteristics'
- ;
-
-CLASS
- : 'Class' | 'class'
- ;
-
-CLOSURE
- : 'closure'
- ;
-
-COLLECT
- : 'collect'
- ;
-
-COLLECT_LIST
- : 'collectList'
- ;
-
-CONTAINS
- : 'contains'
- ;
-
-COUNT
- : 'count'
- ;
-
-DATATYPE
- : 'Datatype'
- ;
-
-DECLARE
- : 'declare'
- ;
-
-DEFEATS
- : 'defeats'
- ;
-
-DIFFERENTFROM
- : 'differentFrom' | 'DifferentFrom'
- ;
-
-DIFFERENT_INDIVIDUALS
- : 'differentIndividuals' | 'DifferentIndividuals'
- ;
-
-DISJOINT
- : 'disjointWith' | 'DisjointWith'
- ;
-
-DISJOINT_CLASSES
- : 'disjointClasses' | 'DisjointClasses'
- ;
-
-DISJOINT_PROPERTIES
- : 'disjointProperties' | 'DisjointProperties'
- ;
-
-DISJOINT_UNION
- : 'disjointUnionOf' | 'DisjointUnionOf'
- ;
-
-DISTINCT
- : 'distinct'
- ;
-
-
-DO
- : 'do'
- ;
-
-DOMAIN
- : 'domain' | 'Domain'
- ;
-
-END
- : 'end'
- ;
-
-
-ENTITY
- : 'Entity' | 'entity'
- ;
-
-ENTRYPOINT
- : 'entry-point'
- ;
-
-EQUIV
- : 'equiv'
- ;
-
-EQUIVALENT_CLASSES
- : 'equivalentClasses' | 'EquivalentClasses'
- ;
-
-EQUIVALENT_PROPERTIES
- : 'equivalentProperties' | 'EquivalentProperties'
- ;
-
-EQUIVALENTTO
- : 'equivalentTo' | 'EquivalentTo'
- ;
-
-EVENT
- : 'Event' | 'event'
- ;
-
-EXACTLY
- : 'exactly'
- ;
-
-EXISTS
- : 'exists'
- ;
-
-EXTEND
- : 'extends'
- ;
-
-FACTS
- : 'facts' | 'Facts'
- ;
-
-FALLING
- : 'falling'
- ;
-
-FILTER
- : 'filter'
- ;
-
-FORALL
- : 'forall'
- ;
-
-FROM
- : 'from'
- ;
-
-FUNCTION
- : 'function'
- ;
-
-GLOBAL
- : 'global'
- ;
-
-HASKEY
- : 'HasKey'
- ;
-
-IMPLIES
- : 'implies'
- ;
-
-IMPORT
- : 'import' | 'Import'
- ;
-
-IN
- : 'in'
- ;
-
-INDIVIDUAL
- : 'individual' | 'Individual'
- ;
-
-INIT
- : 'init'
- ;
-
-INSERT
- : 'insert'
- ;
-
-INSERT_LOG
- : 'insertLogical'
- ;
-
-INVERSE
- : 'inverse'
- ;
-
-INVERSEOF
- : 'inverseOf' | 'InverseOf'
- ;
-
-JAVA
- : 'java'
- ;
-
-KEY
- : 'key'
- ;
-
-LENGTH
- : 'length'
- ;
-
-LENGTH_MIN
- : 'minLength'
- ;
-
-LENGTH_MAX
- : 'maxLength'
- ;
-
-LIMIT
- : 'limit'
- ;
-
-MAX
- : 'max'
- ;
-
-MIN
- : 'min'
- ;
-
-MODIFY
- : 'modify'
- ;
-
-MODIFY_LOG
- : 'modifyLogical'
- ;
-
-MVEL
- : 'mvel'
- ;
-
-
-NEG
- : 'neg'
- ;
-
-
-NEW
- : 'new'
- ;
-
-NOT
- : 'not'
- ;
-
-MOL
- : 'mol'
- ;
-
-NAMESPACE
- : 'namespace' | 'Namespace'
- ;
-
-NULL
- : 'null'
- ;
-
-ONLY
- : 'only' | 'all'
- ;
-
-ONTOLOGY
- : 'ontology' | 'Ontology'
- ;
-
-OR
- : 'or'
- ;
-
-ORDERBY
- : 'orderby'
- ;
-
-OTHERWISE
- : 'OTHERWISE'
- ;
-
-OVER
- : 'over'
- ;
-
-PACKAGE
- : 'package'
- ;
-
-PATTERN
- : 'pattern'
- ;
-
-PATTERN_LANG
- : 'langPattern'
- ;
-
-PREFIX
- : 'Prefix'
- ;
-
-PROPERTY
- : 'property'
- ;
-
-PROPERTY_OBJECT
- : 'ObjectProperty'
- ;
-
-PROPERTY_DATA
- : 'DataProperty'
- ;
-
-PROPERTY_ANNOTATION
- : 'AnnotationProperty'
- ;
-
-ONCHANGE
- : 'onChange'
- ;
-
-QUERY
- : 'query'
- ;
-
-RANGE
- : 'range' | 'Range'
- ;
-
-RESULT
- : 'result'
- ;
-
-RETRACT
- : 'retract'
- ;
-
-RETRACT_LOG
- : 'retractLogical'
- ;
-
-REVERSE
- : 'reverse'
- ;
-
-RISING
- : 'rising'
- ;
-
-ROLE
- : 'role'
- ;
-
-RULE
- : 'rule'
- ;
-
-SAMEAS
- : 'sameAs' | 'SameAs'
- ;
-
-SAME_INDIVIDUAL
- : 'sameIndividual' | 'SameIndividual'
- ;
-
-SELF
- : 'Self'
- ;
-
-SEQ
- : 'seq'
- ;
-
-SOME
- : 'some'
- ;
-
-SUBCLASSOF
- : 'SubClassOf'
- ;
-
-SUBPROPERTYCHAIN
- : 'SubPropertyChain'
- ;
-
-SUBPROPERTYOF
- : 'SubPropertyOf'
- ;
-
-START
- : 'start'
- ;
-
-SUM
- : 'sum'
- ;
-
-TEMPLATE
- : 'template'
- ;
-
-THAT
- : 'that'
- ;
-
-THEN
- : 'then'
- ;
-
-THROTTLE
- : 'throttle'
- ;
-
-TIME
- : 'time'
- ;
-
-TYPE
- : 'type'
- ;
-
-TYPES
- : 'types' | 'Types'
- ;
-
-TYPE_STRING
- : 'string' | 'String'
- ;
-
-TYPE_INTEGER
- : 'integer' | 'Integer'
- ;
-
-TYPE_FLOAT
- : 'float' | 'Float'
- ;
-
-TYPE_DOUBLE
- : 'double' | 'Double'
- ;
-
-TYPE_BOOLEAN
- : 'boolean' | 'Boolean'
- ;
-
-UNIQUE
- : 'unique'
- ;
-
-UPDATE
- : 'update'
- ;
-
-VALUE
- : 'value'
- ;
-
-
-VERY
- : 'very'
- ;
-
-WHEN
- : 'when'
- ;
-
-WINDOW
- : 'window'
- ;
-
-XOR
- : 'xor'
- ;
-
-
-
-
-AT : '@'
- ;
-
-
-ARROW
- : '->'
- ;
-
-CHAIN_SEP
- : 'o'
- ;
-
-COLON
- : ':'
- ;
-
-COMMA : ','
- ;
-
-
-DOT : '.'
- ;
-
-DOT_STAR
- : '.*'
- ;
-
-DOUBLE_AMPER
- : '&&'
- ;
-
-DOUBLE_PLUS
- : '++'
- ;
-
-
-
-DOUBLE_ANG
- : '<>'
- ;
-
-DOUBLE_CAP
- : '^^'
- ;
-
-DOUBLE_COLON
- : '::'
- ;
-
-DOUBLE_HYPEN
- : '--'
- ;
-
-DOUBLE_DOT
- : '..'
- ;
-
-DOUBLE_GREATER
- : '>>'
- ;
-
-DOUBLE_LESS
- : '<<'
- ;
-
-DOUBLE_PIPE
- : '||'
- ;
-
-DOUBLE_SLASH
- : '//'
- ;
-
-DOUBLE_SQUARE_LEFT
- : '[['
- ;
-
-DOUBLE_SQUARE_RIGHT
- : ']]'
- ;
-
-EQUAL
- : '=='
- ;
-
-EQUALS
- : '='
- ;
-
-GATE
- : '#'
- ;
-
-GREATER
- : '>'
- ;
-
-GREATER_EQUAL
- : '>='
- ;
-
-LESS
- : '<'
- ;
-
-LESS_PERCENT
- : '<%'
- ;
-
-LESS_EQUAL
- : '<='
- ;
-
-MINUS
- : '-'
- ;
-
-NEG_MARK
- : '!'
- ;
-
-NOT_EQUAL
- : '!='
- ;
-
-PERCENT
- : '%'
- ;
-
-PERCENT_GREATER
- : '%>'
- ;
-
-PIPE
- : '|'
- ;
-
-PLUS
- : '+'
- ;
-
-QUESTION_MARK
- : '?'
- ;
-
-SEMICOLON
- : ';'
- ;
-
-SLASH
- : '/'
- ;
-
-TILDE
- : '~'
- ;
-
-TIMES
- : '*'
- ;
-
-
-
-
-LEFT_PAREN
- : '('
- ;
-
-RIGHT_PAREN
- : ')'
- ;
-
-LEFT_SQUARE
- : '['
- ;
-
-RIGHT_SQUARE
- : ']'
- ;
-
-LEFT_CURLY
- : '{'
- ;
-
-RIGHT_CURLY
- : '}'
- ;
-
-
-
-
-
-/* removed due to the use of '#'
-SH_STYLE_SINGLE_LINE_COMMENT
- : '#' (~('\r'|'\n'))* EOL?
- { $channel=HIDDEN; setText("//"+getText().substring(1));}
- ;
-*/
-
-C_STYLE_SINGLE_LINE_COMMENT
- : '/*' (~('\r'|'\n'))* EOL?
- { $channel=HIDDEN; }
- ;
-
-MULTI_LINE_COMMENT
- : '/*' (options{greedy=false;} : .)* '*/'
- { $channel=HIDDEN; }
- ;
-
-ID
- : IdentifierStart IdentifierPart*
- | '`' IdentifierStart IdentifierPart* '`'
- { state.text = $text.substring(1, $text.length() - 1); }
- ;
-
-PREFIXED_ID
- : ':' IdentifierStart IdentifierPart*
- { state.text = $text.substring(1, $text.length() ); }
- ;
-
-BLANK_ID
- : '_' IdentifierStart IdentifierPart*
- { state.text = $text.substring(1, $text.length() ); }
- ;
-
-MISC :
- //'!' | '%' | '^' | '*' | '-' | '+' | '?' | '/' | '\'' | '\\' | '|' | '&'
- '^' | '\'' | '\\' | '&'
- ;
-
-
-VAR
- : '$' IdentifierPart+
- ;
-
-fragment
-IdentifierStart
- : //'\u0024'
- '\u0041'..'\u005a'
- // | '\u005f'
- | '\u0061'..'\u007a'
- | '\u00a2'..'\u00a5'
- | '\u00aa'
- | '\u00b5'
- | '\u00ba'
- | '\u00c0'..'\u00d6'
- | '\u00d8'..'\u00f6'
- | '\u00f8'..'\u0236'
- | '\u0250'..'\u02c1'
- | '\u02c6'..'\u02d1'
- | '\u02e0'..'\u02e4'
- | '\u02ee'
- | '\u037a'
- | '\u0386'
- | '\u0388'..'\u038a'
- | '\u038c'
- | '\u038e'..'\u03a1'
- | '\u03a3'..'\u03ce'
- | '\u03d0'..'\u03f5'
- | '\u03f7'..'\u03fb'
- | '\u0400'..'\u0481'
- | '\u048a'..'\u04ce'
- | '\u04d0'..'\u04f5'
- | '\u04f8'..'\u04f9'
- | '\u0500'..'\u050f'
- | '\u0531'..'\u0556'
- | '\u0559'
- | '\u0561'..'\u0587'
- | '\u05d0'..'\u05ea'
- | '\u05f0'..'\u05f2'
- | '\u0621'..'\u063a'
- | '\u0640'..'\u064a'
- | '\u066e'..'\u066f'
- | '\u0671'..'\u06d3'
- | '\u06d5'
- | '\u06e5'..'\u06e6'
- | '\u06ee'..'\u06ef'
- | '\u06fa'..'\u06fc'
- | '\u06ff'
- | '\u0710'
- | '\u0712'..'\u072f'
- | '\u074d'..'\u074f'
- | '\u0780'..'\u07a5'
- | '\u07b1'
- | '\u0904'..'\u0939'
- | '\u093d'
- | '\u0950'
- | '\u0958'..'\u0961'
- | '\u0985'..'\u098c'
- | '\u098f'..'\u0990'
- | '\u0993'..'\u09a8'
- | '\u09aa'..'\u09b0'
- | '\u09b2'
- | '\u09b6'..'\u09b9'
- | '\u09bd'
- | '\u09dc'..'\u09dd'
- | '\u09df'..'\u09e1'
- | '\u09f0'..'\u09f3'
- | '\u0a05'..'\u0a0a'
- | '\u0a0f'..'\u0a10'
- | '\u0a13'..'\u0a28'
- | '\u0a2a'..'\u0a30'
- | '\u0a32'..'\u0a33'
- | '\u0a35'..'\u0a36'
- | '\u0a38'..'\u0a39'
- | '\u0a59'..'\u0a5c'
- | '\u0a5e'
- | '\u0a72'..'\u0a74'
- | '\u0a85'..'\u0a8d'
- | '\u0a8f'..'\u0a91'
- | '\u0a93'..'\u0aa8'
- | '\u0aaa'..'\u0ab0'
- | '\u0ab2'..'\u0ab3'
- | '\u0ab5'..'\u0ab9'
- | '\u0abd'
- | '\u0ad0'
- | '\u0ae0'..'\u0ae1'
- | '\u0af1'
- | '\u0b05'..'\u0b0c'
- | '\u0b0f'..'\u0b10'
- | '\u0b13'..'\u0b28'
- | '\u0b2a'..'\u0b30'
- | '\u0b32'..'\u0b33'
- | '\u0b35'..'\u0b39'
- | '\u0b3d'
- | '\u0b5c'..'\u0b5d'
- | '\u0b5f'..'\u0b61'
- | '\u0b71'
- | '\u0b83'
- | '\u0b85'..'\u0b8a'
- | '\u0b8e'..'\u0b90'
- | '\u0b92'..'\u0b95'
- | '\u0b99'..'\u0b9a'
- | '\u0b9c'
- | '\u0b9e'..'\u0b9f'
- | '\u0ba3'..'\u0ba4'
- | '\u0ba8'..'\u0baa'
- | '\u0bae'..'\u0bb5'
- | '\u0bb7'..'\u0bb9'
- | '\u0bf9'
- | '\u0c05'..'\u0c0c'
- | '\u0c0e'..'\u0c10'
- | '\u0c12'..'\u0c28'
- | '\u0c2a'..'\u0c33'
- | '\u0c35'..'\u0c39'
- | '\u0c60'..'\u0c61'
- | '\u0c85'..'\u0c8c'
- | '\u0c8e'..'\u0c90'
- | '\u0c92'..'\u0ca8'
- | '\u0caa'..'\u0cb3'
- | '\u0cb5'..'\u0cb9'
- | '\u0cbd'
- | '\u0cde'
- | '\u0ce0'..'\u0ce1'
- | '\u0d05'..'\u0d0c'
- | '\u0d0e'..'\u0d10'
- | '\u0d12'..'\u0d28'
- | '\u0d2a'..'\u0d39'
- | '\u0d60'..'\u0d61'
- | '\u0d85'..'\u0d96'
- | '\u0d9a'..'\u0db1'
- | '\u0db3'..'\u0dbb'
- | '\u0dbd'
- | '\u0dc0'..'\u0dc6'
- | '\u0e01'..'\u0e30'
- | '\u0e32'..'\u0e33'
- | '\u0e3f'..'\u0e46'
- | '\u0e81'..'\u0e82'
- | '\u0e84'
- | '\u0e87'..'\u0e88'
- | '\u0e8a'
- | '\u0e8d'
- | '\u0e94'..'\u0e97'
- | '\u0e99'..'\u0e9f'
- | '\u0ea1'..'\u0ea3'
- | '\u0ea5'
- | '\u0ea7'
- | '\u0eaa'..'\u0eab'
- | '\u0ead'..'\u0eb0'
- | '\u0eb2'..'\u0eb3'
- | '\u0ebd'
- | '\u0ec0'..'\u0ec4'
- | '\u0ec6'
- | '\u0edc'..'\u0edd'
- | '\u0f00'
- | '\u0f40'..'\u0f47'
- | '\u0f49'..'\u0f6a'
- | '\u0f88'..'\u0f8b'
- | '\u1000'..'\u1021'
- | '\u1023'..'\u1027'
- | '\u1029'..'\u102a'
- | '\u1050'..'\u1055'
- | '\u10a0'..'\u10c5'
- | '\u10d0'..'\u10f8'
- | '\u1100'..'\u1159'
- | '\u115f'..'\u11a2'
- | '\u11a8'..'\u11f9'
- | '\u1200'..'\u1206'
- | '\u1208'..'\u1246'
- | '\u1248'
- | '\u124a'..'\u124d'
- | '\u1250'..'\u1256'
- | '\u1258'
- | '\u125a'..'\u125d'
- | '\u1260'..'\u1286'
- | '\u1288'
- | '\u128a'..'\u128d'
- | '\u1290'..'\u12ae'
- | '\u12b0'
- | '\u12b2'..'\u12b5'
- | '\u12b8'..'\u12be'
- | '\u12c0'
- | '\u12c2'..'\u12c5'
- | '\u12c8'..'\u12ce'
- | '\u12d0'..'\u12d6'
- | '\u12d8'..'\u12ee'
- | '\u12f0'..'\u130e'
- | '\u1310'
- | '\u1312'..'\u1315'
- | '\u1318'..'\u131e'
- | '\u1320'..'\u1346'
- | '\u1348'..'\u135a'
- | '\u13a0'..'\u13f4'
- | '\u1401'..'\u166c'
- | '\u166f'..'\u1676'
- | '\u1681'..'\u169a'
- | '\u16a0'..'\u16ea'
- | '\u16ee'..'\u16f0'
- | '\u1700'..'\u170c'
- | '\u170e'..'\u1711'
- | '\u1720'..'\u1731'
- | '\u1740'..'\u1751'
- | '\u1760'..'\u176c'
- | '\u176e'..'\u1770'
- | '\u1780'..'\u17b3'
- | '\u17d7'
- | '\u17db'..'\u17dc'
- | '\u1820'..'\u1877'
- | '\u1880'..'\u18a8'
- | '\u1900'..'\u191c'
- | '\u1950'..'\u196d'
- | '\u1970'..'\u1974'
- | '\u1d00'..'\u1d6b'
- | '\u1e00'..'\u1e9b'
- | '\u1ea0'..'\u1ef9'
- | '\u1f00'..'\u1f15'
- | '\u1f18'..'\u1f1d'
- | '\u1f20'..'\u1f45'
- | '\u1f48'..'\u1f4d'
- | '\u1f50'..'\u1f57'
- | '\u1f59'
- | '\u1f5b'
- | '\u1f5d'
- | '\u1f5f'..'\u1f7d'
- | '\u1f80'..'\u1fb4'
- | '\u1fb6'..'\u1fbc'
- | '\u1fbe'
- | '\u1fc2'..'\u1fc4'
- | '\u1fc6'..'\u1fcc'
- | '\u1fd0'..'\u1fd3'
- | '\u1fd6'..'\u1fdb'
- | '\u1fe0'..'\u1fec'
- | '\u1ff2'..'\u1ff4'
- | '\u1ff6'..'\u1ffc'
- | '\u203f'..'\u2040'
- | '\u2054'
- | '\u2071'
- | '\u207f'
- | '\u20a0'..'\u20b1'
- | '\u2102'
- | '\u2107'
- | '\u210a'..'\u2113'
- | '\u2115'
- | '\u2119'..'\u211d'
- | '\u2124'
- | '\u2126'
- | '\u2128'
- | '\u212a'..'\u212d'
- | '\u212f'..'\u2131'
- | '\u2133'..'\u2139'
- | '\u213d'..'\u213f'
- | '\u2145'..'\u2149'
- | '\u2160'..'\u2183'
- | '\u3005'..'\u3007'
- | '\u3021'..'\u3029'
- | '\u3031'..'\u3035'
- | '\u3038'..'\u303c'
- | '\u3041'..'\u3096'
- | '\u309d'..'\u309f'
- | '\u30a1'..'\u30ff'
- | '\u3105'..'\u312c'
- | '\u3131'..'\u318e'
- | '\u31a0'..'\u31b7'
- | '\u31f0'..'\u31ff'
- | '\u3400'..'\u4db5'
- | '\u4e00'..'\u9fa5'
- | '\ua000'..'\ua48c'
- | '\uac00'..'\ud7a3'
- | '\uf900'..'\ufa2d'
- | '\ufa30'..'\ufa6a'
- | '\ufb00'..'\ufb06'
- | '\ufb13'..'\ufb17'
- | '\ufb1d'
- | '\ufb1f'..'\ufb28'
- | '\ufb2a'..'\ufb36'
- | '\ufb38'..'\ufb3c'
- | '\ufb3e'
- | '\ufb40'..'\ufb41'
- | '\ufb43'..'\ufb44'
- | '\ufb46'..'\ufbb1'
- | '\ufbd3'..'\ufd3d'
- | '\ufd50'..'\ufd8f'
- | '\ufd92'..'\ufdc7'
- | '\ufdf0'..'\ufdfc'
- | '\ufe33'..'\ufe34'
- | '\ufe4d'..'\ufe4f'
- | '\ufe69'
- | '\ufe70'..'\ufe74'
- | '\ufe76'..'\ufefc'
- | '\uff04'
- | '\uff21'..'\uff3a'
- | '\uff3f'
- | '\uff41'..'\uff5a'
- | '\uff65'..'\uffbe'
- | '\uffc2'..'\uffc7'
- | '\uffca'..'\uffcf'
- | '\uffd2'..'\uffd7'
- | '\uffda'..'\uffdc'
- | '\uffe0'..'\uffe1'
- | '\uffe5'..'\uffe6'
-// UTF-16: | ('\ud800'..'\udbff') ('\udc00'..'\udfff')
- ;
-
-fragment
-IdentifierPart
- : '\u0000'..'\u0008'
- | '\u000e'..'\u001b'
- | '\u0024'
- | '\u0030'..'\u0039'
- | '\u0041'..'\u005a'
- | '\u005f'
- | '\u0061'..'\u007a'
- | '\u007f'..'\u009f'
- | '\u00a2'..'\u00a5'
- | '\u00aa'
- | '\u00ad'
- | '\u00b5'
- | '\u00ba'
- | '\u00c0'..'\u00d6'
- | '\u00d8'..'\u00f6'
- | '\u00f8'..'\u0236'
- | '\u0250'..'\u02c1'
- | '\u02c6'..'\u02d1'
- | '\u02e0'..'\u02e4'
- | '\u02ee'
- | '\u0300'..'\u0357'
- | '\u035d'..'\u036f'
- | '\u037a'
- | '\u0386'
- | '\u0388'..'\u038a'
- | '\u038c'
- | '\u038e'..'\u03a1'
- | '\u03a3'..'\u03ce'
- | '\u03d0'..'\u03f5'
- | '\u03f7'..'\u03fb'
- | '\u0400'..'\u0481'
- | '\u0483'..'\u0486'
- | '\u048a'..'\u04ce'
- | '\u04d0'..'\u04f5'
- | '\u04f8'..'\u04f9'
- | '\u0500'..'\u050f'
- | '\u0531'..'\u0556'
- | '\u0559'
- | '\u0561'..'\u0587'
- | '\u0591'..'\u05a1'
- | '\u05a3'..'\u05b9'
- | '\u05bb'..'\u05bd'
- | '\u05bf'
- | '\u05c1'..'\u05c2'
- | '\u05c4'
- | '\u05d0'..'\u05ea'
- | '\u05f0'..'\u05f2'
- | '\u0600'..'\u0603'
- | '\u0610'..'\u0615'
- | '\u0621'..'\u063a'
- | '\u0640'..'\u0658'
- | '\u0660'..'\u0669'
- | '\u066e'..'\u06d3'
- | '\u06d5'..'\u06dd'
- | '\u06df'..'\u06e8'
- | '\u06ea'..'\u06fc'
- | '\u06ff'
- | '\u070f'..'\u074a'
- | '\u074d'..'\u074f'
- | '\u0780'..'\u07b1'
- | '\u0901'..'\u0939'
- | '\u093c'..'\u094d'
- | '\u0950'..'\u0954'
- | '\u0958'..'\u0963'
- | '\u0966'..'\u096f'
- | '\u0981'..'\u0983'
- | '\u0985'..'\u098c'
- | '\u098f'..'\u0990'
- | '\u0993'..'\u09a8'
- | '\u09aa'..'\u09b0'
- | '\u09b2'
- | '\u09b6'..'\u09b9'
- | '\u09bc'..'\u09c4'
- | '\u09c7'..'\u09c8'
- | '\u09cb'..'\u09cd'
- | '\u09d7'
- | '\u09dc'..'\u09dd'
- | '\u09df'..'\u09e3'
- | '\u09e6'..'\u09f3'
- | '\u0a01'..'\u0a03'
- | '\u0a05'..'\u0a0a'
- | '\u0a0f'..'\u0a10'
- | '\u0a13'..'\u0a28'
- | '\u0a2a'..'\u0a30'
- | '\u0a32'..'\u0a33'
- | '\u0a35'..'\u0a36'
- | '\u0a38'..'\u0a39'
- | '\u0a3c'
- | '\u0a3e'..'\u0a42'
- | '\u0a47'..'\u0a48'
- | '\u0a4b'..'\u0a4d'
- | '\u0a59'..'\u0a5c'
- | '\u0a5e'
- | '\u0a66'..'\u0a74'
- | '\u0a81'..'\u0a83'
- | '\u0a85'..'\u0a8d'
- | '\u0a8f'..'\u0a91'
- | '\u0a93'..'\u0aa8'
- | '\u0aaa'..'\u0ab0'
- | '\u0ab2'..'\u0ab3'
- | '\u0ab5'..'\u0ab9'
- | '\u0abc'..'\u0ac5'
- | '\u0ac7'..'\u0ac9'
- | '\u0acb'..'\u0acd'
- | '\u0ad0'
- | '\u0ae0'..'\u0ae3'
- | '\u0ae6'..'\u0aef'
- | '\u0af1'
- | '\u0b01'..'\u0b03'
- | '\u0b05'..'\u0b0c'
- | '\u0b0f'..'\u0b10'
- | '\u0b13'..'\u0b28'
- | '\u0b2a'..'\u0b30'
- | '\u0b32'..'\u0b33'
- | '\u0b35'..'\u0b39'
- | '\u0b3c'..'\u0b43'
- | '\u0b47'..'\u0b48'
- | '\u0b4b'..'\u0b4d'
- | '\u0b56'..'\u0b57'
- | '\u0b5c'..'\u0b5d'
- | '\u0b5f'..'\u0b61'
- | '\u0b66'..'\u0b6f'
- | '\u0b71'
- | '\u0b82'..'\u0b83'
- | '\u0b85'..'\u0b8a'
- | '\u0b8e'..'\u0b90'
- | '\u0b92'..'\u0b95'
- | '\u0b99'..'\u0b9a'
- | '\u0b9c'
- | '\u0b9e'..'\u0b9f'
- | '\u0ba3'..'\u0ba4'
- | '\u0ba8'..'\u0baa'
- | '\u0bae'..'\u0bb5'
- | '\u0bb7'..'\u0bb9'
- | '\u0bbe'..'\u0bc2'
- | '\u0bc6'..'\u0bc8'
- | '\u0bca'..'\u0bcd'
- | '\u0bd7'
- | '\u0be7'..'\u0bef'
- | '\u0bf9'
- | '\u0c01'..'\u0c03'
- | '\u0c05'..'\u0c0c'
- | '\u0c0e'..'\u0c10'
- | '\u0c12'..'\u0c28'
- | '\u0c2a'..'\u0c33'
- | '\u0c35'..'\u0c39'
- | '\u0c3e'..'\u0c44'
- | '\u0c46'..'\u0c48'
- | '\u0c4a'..'\u0c4d'
- | '\u0c55'..'\u0c56'
- | '\u0c60'..'\u0c61'
- | '\u0c66'..'\u0c6f'
- | '\u0c82'..'\u0c83'
- | '\u0c85'..'\u0c8c'
- | '\u0c8e'..'\u0c90'
- | '\u0c92'..'\u0ca8'
- | '\u0caa'..'\u0cb3'
- | '\u0cb5'..'\u0cb9'
- | '\u0cbc'..'\u0cc4'
- | '\u0cc6'..'\u0cc8'
- | '\u0cca'..'\u0ccd'
- | '\u0cd5'..'\u0cd6'
- | '\u0cde'
- | '\u0ce0'..'\u0ce1'
- | '\u0ce6'..'\u0cef'
- | '\u0d02'..'\u0d03'
- | '\u0d05'..'\u0d0c'
- | '\u0d0e'..'\u0d10'
- | '\u0d12'..'\u0d28'
- | '\u0d2a'..'\u0d39'
- | '\u0d3e'..'\u0d43'
- | '\u0d46'..'\u0d48'
- | '\u0d4a'..'\u0d4d'
- | '\u0d57'
- | '\u0d60'..'\u0d61'
- | '\u0d66'..'\u0d6f'
- | '\u0d82'..'\u0d83'
- | '\u0d85'..'\u0d96'
- | '\u0d9a'..'\u0db1'
- | '\u0db3'..'\u0dbb'
- | '\u0dbd'
- | '\u0dc0'..'\u0dc6'
- | '\u0dca'
- | '\u0dcf'..'\u0dd4'
- | '\u0dd6'
- | '\u0dd8'..'\u0ddf'
- | '\u0df2'..'\u0df3'
- | '\u0e01'..'\u0e3a'
- | '\u0e3f'..'\u0e4e'
- | '\u0e50'..'\u0e59'
- | '\u0e81'..'\u0e82'
- | '\u0e84'
- | '\u0e87'..'\u0e88'
- | '\u0e8a'
- | '\u0e8d'
- | '\u0e94'..'\u0e97'
- | '\u0e99'..'\u0e9f'
- | '\u0ea1'..'\u0ea3'
- | '\u0ea5'
- | '\u0ea7'
- | '\u0eaa'..'\u0eab'
- | '\u0ead'..'\u0eb9'
- | '\u0ebb'..'\u0ebd'
- | '\u0ec0'..'\u0ec4'
- | '\u0ec6'
- | '\u0ec8'..'\u0ecd'
- | '\u0ed0'..'\u0ed9'
- | '\u0edc'..'\u0edd'
- | '\u0f00'
- | '\u0f18'..'\u0f19'
- | '\u0f20'..'\u0f29'
- | '\u0f35'
- | '\u0f37'
- | '\u0f39'
- | '\u0f3e'..'\u0f47'
- | '\u0f49'..'\u0f6a'
- | '\u0f71'..'\u0f84'
- | '\u0f86'..'\u0f8b'
- | '\u0f90'..'\u0f97'
- | '\u0f99'..'\u0fbc'
- | '\u0fc6'
- | '\u1000'..'\u1021'
- | '\u1023'..'\u1027'
- | '\u1029'..'\u102a'
- | '\u102c'..'\u1032'
- | '\u1036'..'\u1039'
- | '\u1040'..'\u1049'
- | '\u1050'..'\u1059'
- | '\u10a0'..'\u10c5'
- | '\u10d0'..'\u10f8'
- | '\u1100'..'\u1159'
- | '\u115f'..'\u11a2'
- | '\u11a8'..'\u11f9'
- | '\u1200'..'\u1206'
- | '\u1208'..'\u1246'
- | '\u1248'
- | '\u124a'..'\u124d'
- | '\u1250'..'\u1256'
- | '\u1258'
- | '\u125a'..'\u125d'
- | '\u1260'..'\u1286'
- | '\u1288'
- | '\u128a'..'\u128d'
- | '\u1290'..'\u12ae'
- | '\u12b0'
- | '\u12b2'..'\u12b5'
- | '\u12b8'..'\u12be'
- | '\u12c0'
- | '\u12c2'..'\u12c5'
- | '\u12c8'..'\u12ce'
- | '\u12d0'..'\u12d6'
- | '\u12d8'..'\u12ee'
- | '\u12f0'..'\u130e'
- | '\u1310'
- | '\u1312'..'\u1315'
- | '\u1318'..'\u131e'
- | '\u1320'..'\u1346'
- | '\u1348'..'\u135a'
- | '\u1369'..'\u1371'
- | '\u13a0'..'\u13f4'
- | '\u1401'..'\u166c'
- | '\u166f'..'\u1676'
- | '\u1681'..'\u169a'
- | '\u16a0'..'\u16ea'
- | '\u16ee'..'\u16f0'
- | '\u1700'..'\u170c'
- | '\u170e'..'\u1714'
- | '\u1720'..'\u1734'
- | '\u1740'..'\u1753'
- | '\u1760'..'\u176c'
- | '\u176e'..'\u1770'
- | '\u1772'..'\u1773'
- | '\u1780'..'\u17d3'
- | '\u17d7'
- | '\u17db'..'\u17dd'
- | '\u17e0'..'\u17e9'
- | '\u180b'..'\u180d'
- | '\u1810'..'\u1819'
- | '\u1820'..'\u1877'
- | '\u1880'..'\u18a9'
- | '\u1900'..'\u191c'
- | '\u1920'..'\u192b'
- | '\u1930'..'\u193b'
- | '\u1946'..'\u196d'
- | '\u1970'..'\u1974'
- | '\u1d00'..'\u1d6b'
- | '\u1e00'..'\u1e9b'
- | '\u1ea0'..'\u1ef9'
- | '\u1f00'..'\u1f15'
- | '\u1f18'..'\u1f1d'
- | '\u1f20'..'\u1f45'
- | '\u1f48'..'\u1f4d'
- | '\u1f50'..'\u1f57'
- | '\u1f59'
- | '\u1f5b'
- | '\u1f5d'
- | '\u1f5f'..'\u1f7d'
- | '\u1f80'..'\u1fb4'
- | '\u1fb6'..'\u1fbc'
- | '\u1fbe'
- | '\u1fc2'..'\u1fc4'
- | '\u1fc6'..'\u1fcc'
- | '\u1fd0'..'\u1fd3'
- | '\u1fd6'..'\u1fdb'
- | '\u1fe0'..'\u1fec'
- | '\u1ff2'..'\u1ff4'
- | '\u1ff6'..'\u1ffc'
- | '\u200c'..'\u200f'
- | '\u202a'..'\u202e'
- | '\u203f'..'\u2040'
- | '\u2054'
- | '\u2060'..'\u2063'
- | '\u206a'..'\u206f'
- | '\u2071'
- | '\u207f'
- | '\u20a0'..'\u20b1'
- | '\u20d0'..'\u20dc'
- | '\u20e1'
- | '\u20e5'..'\u20ea'
- | '\u2102'
- | '\u2107'
- | '\u210a'..'\u2113'
- | '\u2115'
- | '\u2119'..'\u211d'
- | '\u2124'
- | '\u2126'
- | '\u2128'
- | '\u212a'..'\u212d'
- | '\u212f'..'\u2131'
- | '\u2133'..'\u2139'
- | '\u213d'..'\u213f'
- | '\u2145'..'\u2149'
- | '\u2160'..'\u2183'
- | '\u3005'..'\u3007'
- | '\u3021'..'\u302f'
- | '\u3031'..'\u3035'
- | '\u3038'..'\u303c'
- | '\u3041'..'\u3096'
- | '\u3099'..'\u309a'
- | '\u309d'..'\u309f'
- | '\u30a1'..'\u30ff'
- | '\u3105'..'\u312c'
- | '\u3131'..'\u318e'
- | '\u31a0'..'\u31b7'
- | '\u31f0'..'\u31ff'
- | '\u3400'..'\u4db5'
- | '\u4e00'..'\u9fa5'
- | '\ua000'..'\ua48c'
- | '\uac00'..'\ud7a3'
- | '\uf900'..'\ufa2d'
- | '\ufa30'..'\ufa6a'
- | '\ufb00'..'\ufb06'
- | '\ufb13'..'\ufb17'
- | '\ufb1d'..'\ufb28'
- | '\ufb2a'..'\ufb36'
- | '\ufb38'..'\ufb3c'
- | '\ufb3e'
- | '\ufb40'..'\ufb41'
- | '\ufb43'..'\ufb44'
- | '\ufb46'..'\ufbb1'
- | '\ufbd3'..'\ufd3d'
- | '\ufd50'..'\ufd8f'
- | '\ufd92'..'\ufdc7'
- | '\ufdf0'..'\ufdfc'
- | '\ufe00'..'\ufe0f'
- | '\ufe20'..'\ufe23'
- | '\ufe33'..'\ufe34'
- | '\ufe4d'..'\ufe4f'
- | '\ufe69'
- | '\ufe70'..'\ufe74'
- | '\ufe76'..'\ufefc'
- | '\ufeff'
- | '\uff04'
- | '\uff10'..'\uff19'
- | '\uff21'..'\uff3a'
- | '\uff3f'
- | '\uff41'..'\uff5a'
- | '\uff65'..'\uffbe'
- | '\uffc2'..'\uffc7'
- | '\uffca'..'\uffcf'
- | '\uffd2'..'\uffd7'
- | '\uffda'..'\uffdc'
- | '\uffe0'..'\uffe1'
- | '\uffe5'..'\uffe6'
- | '\ufff9'..'\ufffb'
-// UTF-16 | ('\ud800'..'\udbff') ('\udc00'..'\udfff')
- ;
Copied: labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g (from rev 34910, labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g)
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Lexer.g 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,1501 @@
+lexer grammar DRLv6Lexer;
+
+options {
+ language = Java;
+}
+
+
+
+tokens {
+ UP;
+ DOWN;
+
+ VT_COMPILATION_UNIT;
+ VT_PACKAGE_ID;
+ VT_PACKAGE;
+ VT_IMPORT_SECTION;
+ VT_ONTOLOGY_SECTION;
+ VT_DECLARATION_SECTION;
+ VT_RULEBASE_SECTION;
+
+ VT_GLOBAL_ID;
+ VT_DATA_TYPE;
+ VT_DIM_SIZE;
+
+ VT_IMPORT;
+ VT_FUNCTION_IMPORT;
+ VT_STAR;
+ VT_FUNCTION;
+ VT_FUNCTION_ID;
+ VT_PARAM;
+ VT_PARAM_LIST;
+ VT_NAME;
+
+ VT_TEMPLATE;
+ VT_TEMPLATE_ID;
+ VT_SLOT;
+ VT_SLOT_ID;
+
+ VT_TYPE_DECLARE;
+ VT_TYPE_DECLARE_ID;
+ VT_EXTENDS;
+ VT_DL_DEFINITION;
+ VT_DL_TYPE;
+ VT_FIELD;
+
+ VT_ENTITY_TYPE;
+
+ VT_RULE_ID;
+ VT_ATTRIBUTES;
+ VT_DIALECT;
+
+ VT_LHS;
+ VT_ARROW;
+
+ VT_RHS;
+ VT_THEN;
+ VT_CLOSURE;
+
+ VT_BRANCH;
+ VT_BRANCH_DEFAULT;
+ VT_BRANCH_LABEL;
+ VT_NEG_BRANCH_LABEL;
+
+ VT_RISING_EDGE;
+ VT_FALLING_EDGE;
+
+ VT_RHS_CHUNK;
+ VT_CURLY_CHUNK;
+ VT_SQUARE_CHUNK;
+ VT_PAREN_CHUNK;
+
+ VT_NEW_OBJ;
+ VT_TYPE;
+ VT_ARGS;
+ VT_MSR;
+
+ VT_AND_IMPLICIT;
+ VT_IMPLIES;
+ VT_OR;
+ VT_NEG;
+ VT_XOR;
+ VT_EQUIV;
+ VT_AND;
+
+ VT_HEDGE_VERY;
+ VT_HEDGE_MOL;
+
+ VT_EXISTS;
+ VT_FORALL;
+ VT_NEXISTS;
+ VT_COUNT;
+ VT_MIN;
+ VT_MAX;
+ VT_VALUE;
+
+ VT_PATTERN;
+ VT_NESTED_PATTERN;
+ VT_ENABLED;
+ VT_QUERY_PATTERN;
+
+ VT_POSITIONAL_VAR;
+ VT_POSITIONAL_CONST;
+ VT_POSITIONAL_INDEX;
+ VT_POSITIONAL_SKIP;
+
+ VT_BINDING;
+ VT_ACCESSOR;
+ VT_VERSION;
+ VT_INDEXER;
+ VT_INDEX_ALL;
+ VT_METHOD;
+ VT_EXPR;
+ VT_DEBUG_LEFT_EXPR;
+ VT_DEBUG_RIGHT_EXPR;
+ VT_OTHERWISE;
+
+ VT_FILTER;
+ VT_SET;
+
+ VT_SEQUENCE;
+ VT_TRAIL;
+ VT_TRAIL_NODE;
+
+ VT_LIST;
+ VT_RANGE;
+
+ VT_BEHAVIOR;
+ VT_ENTRYPOINT;
+ VT_ENTRYPOINT_ID;
+ VT_FROM_SOURCE;
+ VT_EXPRESSION_CHAIN;
+
+ VT_ACCUMULATE_LEFT;
+ VT_ACCUMULATE_RIGHT;
+ VT_ACCUMULATE_ITERATION;
+ VT_ACCUMULATE_FUNCTION;
+ VT_ACC_ITER_INIT;
+ VT_ACC_ITER_ACT;
+ VT_ACC_ITER_REV;
+ VT_ACC_ITER_RES;
+
+ VT_COLLECT_LIST;
+
+
+ VT_ONTOLOGY;
+ VT_IRI;
+ VT_PREFIX;
+ VT_ANNOTATIONS;
+ VT_ANNOTATION;
+ VT_DL_DEFINITION;
+ VT_FIELD;
+ VT_KEYS;
+
+ VT_DL_TYPE;
+ VT_DL_PROP;
+ VT_DL_RESTRICTION;
+ VT_DL_RESTRICTED_TYPE;
+
+ VT_EQUIVALENTTO;
+ VT_SUBCLASSOF;
+ VT_DISJOINTWITH;
+ VT_DISJOINTUNIONOF;
+ VT_SUBPROPERTYOF;
+ VT_INVERSEOF;
+ VT_SUBPROPERTYCHAIN;
+ VT_DOMAIN;
+ VT_RANGE;
+
+ VT_FACTS;
+ VT_FACT;
+ VT_TYPES;
+ VT_SAMEAS;
+ VT_DIFFERENTFROM;
+
+ VT_EQV_CLASS;
+ VT_DIF_CLASS;
+ VT_EQV_PROP;
+ VT_DIF_PROP;
+ VT_EQV_INDV;
+ VT_DIF_INDV;
+
+
+
+
+
+
+
+
+
+ VK_A_ACTGROUP;
+ VK_A_AGENDAGROUP;
+ VK_A_AUTOFOCUS;
+ VK_A_CALENDAR;
+ VK_A_DATE_EFFECTIVE;
+ VK_A_DATE_EXPIRES;
+ VK_A_DEDUCTION;
+ VK_A_DIALECT;
+ VK_A_DIRECTION_ABDUCTIVE;
+ VK_A_DIRECTION_DEDUCTIVE;
+ VK_A_DIRECTION_EQUIVALENCE;
+ VK_A_DURATION;
+ VK_A_ENABLED;
+ VK_A_IMPLICATION;
+ VK_A_LOCKONACTIVE;
+ VK_A_NOLOOP;
+ VK_A_RULEFLOWGROUP;
+ VK_A_SALIENCE;
+ VK_A_TIMER;
+ VK_ACC;
+ VK_ACCL;
+ VK_ACCUMULATE;
+ VK_ACCUMULATE_RIGHT;
+ VK_ACTION;
+ VK_ACTIVATION;
+ VK_ACTIVE;
+ VK_AGENDA;
+ VK_ALL;
+ VK_AND;
+ VK_ANNOTATIONS;
+ VK_ANOTHER;
+ VK_AS;
+ VK_ATTRIBUTES;
+ VK_AUTO;
+ VK_AVERAGE;
+ VK_BOOL;
+ VK_BOOLEAN;
+ VK_BRANCH;
+ VK_BYTE;
+ VK_CALENDARS;
+ VK_CHAR;
+ VK_CHARACTERISTICS;
+ VK_CLASS;
+ VK_CLOSURE;
+ VK_COLLECT;
+ VK_COLLECT_LIST;
+ VK_CONTAINS;
+ VK_COUNT;
+ VK_DATATYPE;
+ VK_DATE;
+ VK_DECLARE;
+ VK_DEFEATS;
+ VK_DIALECT;
+ VK_DIFFERENT_INDIVIDUALS;
+ VK_DIFFERENTFROM;
+ VK_DISJOINT;
+ VK_DISJOINT_CLASSES;
+ VK_DISJOINT_PROPERTIES;
+ VK_DISJOINT_UNION;
+ VK_DISTINCT;
+ VK_DO;
+ VK_DOMAIN;
+ VK_DOUBLE;
+ VK_DURATION;
+ VK_EFFECTIVE;
+ VK_ENABLED;
+ VK_END;
+ VK_ENTITY;
+ VK_ENTRY;
+ VK_ENTRYPOINT;
+ VK_EQUIV;
+ VK_EQUIVALENT_CLASSES;
+ VK_EQUIVALENT_PROPERTIES;
+ VK_EQUIVALENTTO;
+ VK_EVAL;
+ VK_EVENT;
+ VK_EXACTLY;
+ VK_EXCLUDES;
+ VK_EXISTS;
+ VK_EXPIRES;
+ VK_EXTEND;
+ VK_EXTENDS;
+ VK_FACTS;
+ VK_FALLING;
+ VK_FILTER;
+ VK_FLOAT;
+ VK_FOCUS;
+ VK_FORALL;
+ VK_FROM;
+ VK_FUNCTION;
+ VK_GLOBAL;
+ VK_GROUP;
+ VK_HASKEY;
+ VK_IMPLIES;
+ VK_IMPORT;
+ VK_IN;
+ VK_INDIVIDUAL;
+ VK_INIT;
+ VK_INSERT;
+ VK_INSERT_LOG;
+ VK_INSTANCEOF;
+ VK_INT;
+ VK_INVERSE;
+ VK_INVERSEOF;
+ VK_JAVA;
+ VK_KEY;
+ VK_LENGTH;
+ VK_LENGTH_MAX;
+ VK_LENGTH_MIN;
+ VK_LIMIT;
+ VK_LOCK;
+ VK_LONG;
+ VK_LOOP;
+ VK_MATCHES;
+ VK_MAX;
+ VK_MDA_FUNCTIONAL;
+ VK_MDA_FUNCTIONAL_INV;
+ VK_MDA_REFLEXIVE;
+ VK_MDA_REFLEXIVE_INV;
+ VK_MDA_SYMMETRIC;
+ VK_MDA_SYMMETRIC_INV;
+ VK_MDA_TRANSITIVE;
+ VK_MEMBEROF;
+ VK_MIN;
+ VK_MODIFY;
+ VK_MODIFY_LOG;
+ VK_MOL;
+ VK_MVEL;
+ VK_NAMESPACE;
+ VK_NEG;
+ VK_NEW;
+ VK_NO;
+ VK_NOT;
+ VK_NULL;
+ VK_OA_CRISP;
+ VK_OA_DEFAULT;
+ VK_OA_DEFEAT;
+ VK_OA_DEGREE;
+ VK_OA_ID;
+ VK_OA_KIND;
+ VK_OA_MERGE;
+ VK_OA_MISSING;
+ VK_OA_OTHERWISE;
+ VK_OA_PARAMS;
+ VK_ON;
+ VK_ONCHANGE;
+ VK_ONLY;
+ VK_ONTOLOGY;
+ VK_OR;
+ VK_ORDERBY;
+ VK_OTHERWISE;
+ VK_OVER;
+ VK_PACKAGE;
+ VK_PATTERN;
+ VK_PATTERN_LANG;
+ VK_POINT;
+ VK_PREFIX;
+ VK_PROPERTY;
+ VK_PROPERTY_ANNOTATION;
+ VK_PROPERTY_DATA;
+ VK_PROPERTY_OBJECT;
+ VK_QUERY;
+ VK_RANGE;
+ VK_RESULT;
+ VK_RETRACT;
+ VK_RETRACT_LOG;
+ VK_REVERSE;
+ VK_RISING;
+ VK_ROLE;
+ VK_RULE;
+ VK_RULEFLOW;
+ VK_SALIENCE;
+ VK_SAME_INDIVIDUAL;
+ VK_SAMEAS;
+ VK_SELF;
+ VK_SEQ;
+ VK_SHORT;
+ VK_SOME;
+ VK_SOUNDSLIKE;
+ VK_START;
+ VK_SUBCLASSOF;
+ VK_SUBPROPERTYCHAIN;
+ VK_SUBPROPERTYOF;
+ VK_SUM;
+ VK_SUPER;
+ VK_TEMPLATE;
+ VK_THAT;
+ VK_THEN;
+ VK_THIS;
+ VK_THROTTLE;
+ VK_TIME;
+ VK_TIMER;
+ VK_TYPE;
+ VK_TYPE_BOOLEAN;
+ VK_TYPE_DOUBLE;
+ VK_TYPE_FLOAT;
+ VK_TYPE_INTEGER;
+ VK_TYPE_STRING;
+ VK_TYPES;
+ VK_UNIQUE;
+ VK_UPDATE;
+ VK_VALUE;
+ VK_VERY;
+ VK_VOID;
+ VK_WHEN;
+ VK_WINDOW;
+ VK_XOR;
+ VK_OPERATOR;
+ VK_LOCK_ON_ACTIVE;
+ VK_DATE_EFFECTIVE;
+ VK_DATE_EXPIRES;
+ VK_NO_LOOP;
+ VK_AUTO_FOCUS;
+ VK_ACTIVATION_GROUP;
+ VK_AGENDA_GROUP;
+ VK_RULEFLOW_GROUP;
+ VK_ENTRY_POINT;
+ VK_PRIMITIVE_TYPE;
+
+}
+
+
+ at lexer::header {
+ package org.drools.lang;
+
+}
+
+
+
+
+
+AMPER
+ : '&'
+ ;
+
+
+AT
+ : '@'
+ ;
+
+ARROW
+ : '->'
+ ;
+
+CHAIN_SEP
+ : 'o'
+ ;
+
+COLON
+ : ':'
+ ;
+
+COMMA
+ : ','
+ ;
+
+
+DOT : '.'
+ ;
+
+DOT_STAR
+ : '.*'
+ ;
+
+DOUBLE_AMPER
+ : '&&'
+ ;
+
+DOUBLE_PLUS
+ : '++'
+ ;
+
+
+
+DOUBLE_ANG
+ : '<>'
+ ;
+
+DOUBLE_CAP
+ : '^^'
+ ;
+
+DOUBLE_COLON
+ : '::'
+ ;
+
+DOUBLE_MINUS
+ : '--'
+ ;
+
+DOUBLE_DOT
+ : '..'
+ ;
+
+DOUBLE_GREATER
+ : '>>'
+ ;
+
+DOUBLE_LESS
+ : '<<'
+ ;
+
+DOUBLE_PIPE
+ : '||'
+ ;
+
+DOUBLE_SLASH
+ : '//'
+ ;
+
+DOUBLE_SQUARE_LEFT
+ : '[['
+ ;
+
+DOUBLE_SQUARE_RIGHT
+ : ']]'
+ ;
+
+EQUAL
+ : '=='
+ ;
+
+EQUALS
+ : '='
+ ;
+
+GATE
+ : '#'
+ ;
+
+GREATER
+ : '>'
+ ;
+
+GREATER_EQUAL
+ : '>='
+ ;
+
+LESS
+ : '<'
+ ;
+
+LESS_PERCENT
+ : '<%'
+ ;
+
+LESS_EQUAL
+ : '<='
+ ;
+
+MINUS
+ : '-'
+ ;
+
+MOD
+ : '%'
+ ;
+
+NEG_MARK
+ : '!'
+ ;
+
+NOT_EQUAL
+ : '!='
+ ;
+
+
+PERCENT_GREATER
+ : '%>'
+ ;
+
+PIPE
+ : '|'
+ ;
+
+PLUS
+ : '+'
+ ;
+
+QUESTION_MARK
+ : '?'
+ ;
+
+SEMICOLON
+ : ';'
+ ;
+
+SLASH
+ : '/'
+ ;
+
+TILDE
+ : '~'
+ ;
+
+TIMES
+ : '*'
+ ;
+
+TRIPLE_GREATER
+ : '>>>'
+ ;
+
+XOR
+ : '^'
+ ;
+
+
+
+PLUS_ASSIGN
+ : '+='
+ ;
+
+MINUS_ASSIGN
+ : '-='
+ ;
+
+
+MULT_ASSIGN
+ : '*='
+ ;
+
+DIV_ASSIGN
+ : '/='
+ ;
+
+AND_ASSIGN
+ : '&='
+ ;
+
+OR_ASSIGN
+ : '|='
+ ;
+
+XOR_ASSIGN
+ : '^='
+ ;
+
+MOD_ASSIGN
+ : '%='
+ ;
+
+
+
+LEFT_PAREN
+ : '('
+ ;
+
+RIGHT_PAREN
+ : ')'
+ ;
+
+LEFT_SQUARE
+ : '['
+ ;
+
+RIGHT_SQUARE
+ : ']'
+ ;
+
+LEFT_CURLY
+ : '{'
+ ;
+
+RIGHT_CURLY
+ : '}'
+ ;
+
+
+
+
+
+
+
+HEX : '0' ('x'|'X') HexDigit+ IntegerTypeSuffix? ;
+
+DECIMAL : MINUS? ('0' | '1'..'9' '0'..'9'*) IntegerTypeSuffix? ;
+
+OCTAL : '0' ('0'..'7')+ IntegerTypeSuffix? ;
+
+
+
+FLOAT
+ : MINUS? ('0'..'9')+ '.' ('0'..'9')* Exponent? FloatTypeSuffix?
+ | MINUS? '.' ('0'..'9')+ Exponent? FloatTypeSuffix?
+ | MINUS? ('0'..'9')+ Exponent FloatTypeSuffix?
+ | MINUS? ('0'..'9')+ FloatTypeSuffix
+ ;
+
+
+BOOL
+ : 'true'
+ | 'false'
+ ;
+
+
+
+
+
+
+
+STRING
+ : ('"' ( EscapeSequence | ~('\\'|'"') )+ '"')
+ | ('\'' ( EscapeSequence | ~('\\'|'\'') )+ '\'')
+ ;
+
+
+
+
+C_STYLE_SINGLE_LINE_COMMENT
+ : '/*' (~('\r'|'\n'))* EOL?
+ { $channel=HIDDEN; }
+ ;
+
+MULTI_LINE_COMMENT
+ : '/*' (options{greedy=false;} : .)* '*/'
+ { $channel=HIDDEN; }
+ ;
+
+ID
+ : IdentifierStart IdentifierPart*
+ | '`' IdentifierStart IdentifierPart* '`'
+ { state.text = $text.substring(1, $text.length() - 1); }
+ ;
+
+/*
+PREFIXED_ID
+ : ':' IdentifierStart IdentifierPart*
+ { state.text = $text.substring(1, $text.length() ); }
+ ;
+*/
+
+BLANK_ID
+ : '_' IdentifierStart IdentifierPart*
+ { state.text = $text.substring(1, $text.length() ); }
+ ;
+
+
+
+VAR
+ : '$' IdentifierPart+
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+MISC :
+ '\'' | '\\'
+ ;
+
+
+
+WS : ( ' '
+ | '\t'
+ | '\f'
+ | EOL
+ )+
+ { $channel=HIDDEN; }
+ ;
+
+fragment
+EOL :
+ ( ( '\r\n' )=> '\r\n' // Evil DOS
+ | '\r' // Macintosh
+ | '\n' // Unix (the right way)
+ )
+ ;
+
+
+fragment
+HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
+
+fragment
+EscapeSequence
+ : '\\' ('b'|'B'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\'|'.'|'o'|
+ 'x'|'a'|'e'|'c'|'d'|'D'|'s'|'S'|'w'|'W'|'p'|'A'|
+ 'G'|'Z'|'z'|'Q'|'E'|'*'|'['|']'|'('|')'|'$'|'^'|
+ '{'|'}'|'?'|'+'|'-'|'&'|'|')
+ | UnicodeEscape
+ | OctalEscape
+ ;
+
+fragment
+OctalEscape
+ : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7')
+ ;
+
+fragment
+UnicodeEscape
+ : '\\' 'u' HexDigit HexDigit HexDigit HexDigit
+ ;
+
+fragment
+IntegerTypeSuffix : ('l'|'L') ;
+
+fragment
+Exponent : ('e'|'E') ('+'|'-')? ('0'..'9')+ ;
+
+fragment
+FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
+
+
+
+
+
+
+
+
+fragment
+IdentifierStart
+ : //'\u0024' // $
+ '\u0041'..'\u005a'
+// | '\u005f' // _
+ | '\u0061'..'\u007a'
+ | '\u00a2'..'\u00a5'
+ | '\u00aa'
+ | '\u00b5'
+ | '\u00ba'
+ | '\u00c0'..'\u00d6'
+ | '\u00d8'..'\u00f6'
+ | '\u00f8'..'\u0236'
+ | '\u0250'..'\u02c1'
+ | '\u02c6'..'\u02d1'
+ | '\u02e0'..'\u02e4'
+ | '\u02ee'
+ | '\u037a'
+ | '\u0386'
+ | '\u0388'..'\u038a'
+ | '\u038c'
+ | '\u038e'..'\u03a1'
+ | '\u03a3'..'\u03ce'
+ | '\u03d0'..'\u03f5'
+ | '\u03f7'..'\u03fb'
+ | '\u0400'..'\u0481'
+ | '\u048a'..'\u04ce'
+ | '\u04d0'..'\u04f5'
+ | '\u04f8'..'\u04f9'
+ | '\u0500'..'\u050f'
+ | '\u0531'..'\u0556'
+ | '\u0559'
+ | '\u0561'..'\u0587'
+ | '\u05d0'..'\u05ea'
+ | '\u05f0'..'\u05f2'
+ | '\u0621'..'\u063a'
+ | '\u0640'..'\u064a'
+ | '\u066e'..'\u066f'
+ | '\u0671'..'\u06d3'
+ | '\u06d5'
+ | '\u06e5'..'\u06e6'
+ | '\u06ee'..'\u06ef'
+ | '\u06fa'..'\u06fc'
+ | '\u06ff'
+ | '\u0710'
+ | '\u0712'..'\u072f'
+ | '\u074d'..'\u074f'
+ | '\u0780'..'\u07a5'
+ | '\u07b1'
+ | '\u0904'..'\u0939'
+ | '\u093d'
+ | '\u0950'
+ | '\u0958'..'\u0961'
+ | '\u0985'..'\u098c'
+ | '\u098f'..'\u0990'
+ | '\u0993'..'\u09a8'
+ | '\u09aa'..'\u09b0'
+ | '\u09b2'
+ | '\u09b6'..'\u09b9'
+ | '\u09bd'
+ | '\u09dc'..'\u09dd'
+ | '\u09df'..'\u09e1'
+ | '\u09f0'..'\u09f3'
+ | '\u0a05'..'\u0a0a'
+ | '\u0a0f'..'\u0a10'
+ | '\u0a13'..'\u0a28'
+ | '\u0a2a'..'\u0a30'
+ | '\u0a32'..'\u0a33'
+ | '\u0a35'..'\u0a36'
+ | '\u0a38'..'\u0a39'
+ | '\u0a59'..'\u0a5c'
+ | '\u0a5e'
+ | '\u0a72'..'\u0a74'
+ | '\u0a85'..'\u0a8d'
+ | '\u0a8f'..'\u0a91'
+ | '\u0a93'..'\u0aa8'
+ | '\u0aaa'..'\u0ab0'
+ | '\u0ab2'..'\u0ab3'
+ | '\u0ab5'..'\u0ab9'
+ | '\u0abd'
+ | '\u0ad0'
+ | '\u0ae0'..'\u0ae1'
+ | '\u0af1'
+ | '\u0b05'..'\u0b0c'
+ | '\u0b0f'..'\u0b10'
+ | '\u0b13'..'\u0b28'
+ | '\u0b2a'..'\u0b30'
+ | '\u0b32'..'\u0b33'
+ | '\u0b35'..'\u0b39'
+ | '\u0b3d'
+ | '\u0b5c'..'\u0b5d'
+ | '\u0b5f'..'\u0b61'
+ | '\u0b71'
+ | '\u0b83'
+ | '\u0b85'..'\u0b8a'
+ | '\u0b8e'..'\u0b90'
+ | '\u0b92'..'\u0b95'
+ | '\u0b99'..'\u0b9a'
+ | '\u0b9c'
+ | '\u0b9e'..'\u0b9f'
+ | '\u0ba3'..'\u0ba4'
+ | '\u0ba8'..'\u0baa'
+ | '\u0bae'..'\u0bb5'
+ | '\u0bb7'..'\u0bb9'
+ | '\u0bf9'
+ | '\u0c05'..'\u0c0c'
+ | '\u0c0e'..'\u0c10'
+ | '\u0c12'..'\u0c28'
+ | '\u0c2a'..'\u0c33'
+ | '\u0c35'..'\u0c39'
+ | '\u0c60'..'\u0c61'
+ | '\u0c85'..'\u0c8c'
+ | '\u0c8e'..'\u0c90'
+ | '\u0c92'..'\u0ca8'
+ | '\u0caa'..'\u0cb3'
+ | '\u0cb5'..'\u0cb9'
+ | '\u0cbd'
+ | '\u0cde'
+ | '\u0ce0'..'\u0ce1'
+ | '\u0d05'..'\u0d0c'
+ | '\u0d0e'..'\u0d10'
+ | '\u0d12'..'\u0d28'
+ | '\u0d2a'..'\u0d39'
+ | '\u0d60'..'\u0d61'
+ | '\u0d85'..'\u0d96'
+ | '\u0d9a'..'\u0db1'
+ | '\u0db3'..'\u0dbb'
+ | '\u0dbd'
+ | '\u0dc0'..'\u0dc6'
+ | '\u0e01'..'\u0e30'
+ | '\u0e32'..'\u0e33'
+ | '\u0e3f'..'\u0e46'
+ | '\u0e81'..'\u0e82'
+ | '\u0e84'
+ | '\u0e87'..'\u0e88'
+ | '\u0e8a'
+ | '\u0e8d'
+ | '\u0e94'..'\u0e97'
+ | '\u0e99'..'\u0e9f'
+ | '\u0ea1'..'\u0ea3'
+ | '\u0ea5'
+ | '\u0ea7'
+ | '\u0eaa'..'\u0eab'
+ | '\u0ead'..'\u0eb0'
+ | '\u0eb2'..'\u0eb3'
+ | '\u0ebd'
+ | '\u0ec0'..'\u0ec4'
+ | '\u0ec6'
+ | '\u0edc'..'\u0edd'
+ | '\u0f00'
+ | '\u0f40'..'\u0f47'
+ | '\u0f49'..'\u0f6a'
+ | '\u0f88'..'\u0f8b'
+ | '\u1000'..'\u1021'
+ | '\u1023'..'\u1027'
+ | '\u1029'..'\u102a'
+ | '\u1050'..'\u1055'
+ | '\u10a0'..'\u10c5'
+ | '\u10d0'..'\u10f8'
+ | '\u1100'..'\u1159'
+ | '\u115f'..'\u11a2'
+ | '\u11a8'..'\u11f9'
+ | '\u1200'..'\u1206'
+ | '\u1208'..'\u1246'
+ | '\u1248'
+ | '\u124a'..'\u124d'
+ | '\u1250'..'\u1256'
+ | '\u1258'
+ | '\u125a'..'\u125d'
+ | '\u1260'..'\u1286'
+ | '\u1288'
+ | '\u128a'..'\u128d'
+ | '\u1290'..'\u12ae'
+ | '\u12b0'
+ | '\u12b2'..'\u12b5'
+ | '\u12b8'..'\u12be'
+ | '\u12c0'
+ | '\u12c2'..'\u12c5'
+ | '\u12c8'..'\u12ce'
+ | '\u12d0'..'\u12d6'
+ | '\u12d8'..'\u12ee'
+ | '\u12f0'..'\u130e'
+ | '\u1310'
+ | '\u1312'..'\u1315'
+ | '\u1318'..'\u131e'
+ | '\u1320'..'\u1346'
+ | '\u1348'..'\u135a'
+ | '\u13a0'..'\u13f4'
+ | '\u1401'..'\u166c'
+ | '\u166f'..'\u1676'
+ | '\u1681'..'\u169a'
+ | '\u16a0'..'\u16ea'
+ | '\u16ee'..'\u16f0'
+ | '\u1700'..'\u170c'
+ | '\u170e'..'\u1711'
+ | '\u1720'..'\u1731'
+ | '\u1740'..'\u1751'
+ | '\u1760'..'\u176c'
+ | '\u176e'..'\u1770'
+ | '\u1780'..'\u17b3'
+ | '\u17d7'
+ | '\u17db'..'\u17dc'
+ | '\u1820'..'\u1877'
+ | '\u1880'..'\u18a8'
+ | '\u1900'..'\u191c'
+ | '\u1950'..'\u196d'
+ | '\u1970'..'\u1974'
+ | '\u1d00'..'\u1d6b'
+ | '\u1e00'..'\u1e9b'
+ | '\u1ea0'..'\u1ef9'
+ | '\u1f00'..'\u1f15'
+ | '\u1f18'..'\u1f1d'
+ | '\u1f20'..'\u1f45'
+ | '\u1f48'..'\u1f4d'
+ | '\u1f50'..'\u1f57'
+ | '\u1f59'
+ | '\u1f5b'
+ | '\u1f5d'
+ | '\u1f5f'..'\u1f7d'
+ | '\u1f80'..'\u1fb4'
+ | '\u1fb6'..'\u1fbc'
+ | '\u1fbe'
+ | '\u1fc2'..'\u1fc4'
+ | '\u1fc6'..'\u1fcc'
+ | '\u1fd0'..'\u1fd3'
+ | '\u1fd6'..'\u1fdb'
+ | '\u1fe0'..'\u1fec'
+ | '\u1ff2'..'\u1ff4'
+ | '\u1ff6'..'\u1ffc'
+ | '\u203f'..'\u2040'
+ | '\u2054'
+ | '\u2071'
+ | '\u207f'
+ | '\u20a0'..'\u20b1'
+ | '\u2102'
+ | '\u2107'
+ | '\u210a'..'\u2113'
+ | '\u2115'
+ | '\u2119'..'\u211d'
+ | '\u2124'
+ | '\u2126'
+ | '\u2128'
+ | '\u212a'..'\u212d'
+ | '\u212f'..'\u2131'
+ | '\u2133'..'\u2139'
+ | '\u213d'..'\u213f'
+ | '\u2145'..'\u2149'
+ | '\u2160'..'\u2183'
+ | '\u3005'..'\u3007'
+ | '\u3021'..'\u3029'
+ | '\u3031'..'\u3035'
+ | '\u3038'..'\u303c'
+ | '\u3041'..'\u3096'
+ | '\u309d'..'\u309f'
+ | '\u30a1'..'\u30ff'
+ | '\u3105'..'\u312c'
+ | '\u3131'..'\u318e'
+ | '\u31a0'..'\u31b7'
+ | '\u31f0'..'\u31ff'
+ | '\u3400'..'\u4db5'
+ | '\u4e00'..'\u9fa5'
+ | '\ua000'..'\ua48c'
+ | '\uac00'..'\ud7a3'
+ | '\uf900'..'\ufa2d'
+ | '\ufa30'..'\ufa6a'
+ | '\ufb00'..'\ufb06'
+ | '\ufb13'..'\ufb17'
+ | '\ufb1d'
+ | '\ufb1f'..'\ufb28'
+ | '\ufb2a'..'\ufb36'
+ | '\ufb38'..'\ufb3c'
+ | '\ufb3e'
+ | '\ufb40'..'\ufb41'
+ | '\ufb43'..'\ufb44'
+ | '\ufb46'..'\ufbb1'
+ | '\ufbd3'..'\ufd3d'
+ | '\ufd50'..'\ufd8f'
+ | '\ufd92'..'\ufdc7'
+ | '\ufdf0'..'\ufdfc'
+ | '\ufe33'..'\ufe34'
+ | '\ufe4d'..'\ufe4f'
+ | '\ufe69'
+ | '\ufe70'..'\ufe74'
+ | '\ufe76'..'\ufefc'
+ | '\uff04'
+ | '\uff21'..'\uff3a'
+ | '\uff3f'
+ | '\uff41'..'\uff5a'
+ | '\uff65'..'\uffbe'
+ | '\uffc2'..'\uffc7'
+ | '\uffca'..'\uffcf'
+ | '\uffd2'..'\uffd7'
+ | '\uffda'..'\uffdc'
+ | '\uffe0'..'\uffe1'
+ | '\uffe5'..'\uffe6'
+// UTF-16: | ('\ud800'..'\udbff') ('\udc00'..'\udfff')
+ ;
+
+fragment
+IdentifierPart
+ : '\u0000'..'\u0008'
+ | '\u000e'..'\u001b'
+ | '\u0024'
+ | '\u0030'..'\u0039'
+ | '\u0041'..'\u005a'
+ | '\u005f'
+ | '\u0061'..'\u007a'
+ | '\u007f'..'\u009f'
+ | '\u00a2'..'\u00a5'
+ | '\u00aa'
+ | '\u00ad'
+ | '\u00b5'
+ | '\u00ba'
+ | '\u00c0'..'\u00d6'
+ | '\u00d8'..'\u00f6'
+ | '\u00f8'..'\u0236'
+ | '\u0250'..'\u02c1'
+ | '\u02c6'..'\u02d1'
+ | '\u02e0'..'\u02e4'
+ | '\u02ee'
+ | '\u0300'..'\u0357'
+ | '\u035d'..'\u036f'
+ | '\u037a'
+ | '\u0386'
+ | '\u0388'..'\u038a'
+ | '\u038c'
+ | '\u038e'..'\u03a1'
+ | '\u03a3'..'\u03ce'
+ | '\u03d0'..'\u03f5'
+ | '\u03f7'..'\u03fb'
+ | '\u0400'..'\u0481'
+ | '\u0483'..'\u0486'
+ | '\u048a'..'\u04ce'
+ | '\u04d0'..'\u04f5'
+ | '\u04f8'..'\u04f9'
+ | '\u0500'..'\u050f'
+ | '\u0531'..'\u0556'
+ | '\u0559'
+ | '\u0561'..'\u0587'
+ | '\u0591'..'\u05a1'
+ | '\u05a3'..'\u05b9'
+ | '\u05bb'..'\u05bd'
+ | '\u05bf'
+ | '\u05c1'..'\u05c2'
+ | '\u05c4'
+ | '\u05d0'..'\u05ea'
+ | '\u05f0'..'\u05f2'
+ | '\u0600'..'\u0603'
+ | '\u0610'..'\u0615'
+ | '\u0621'..'\u063a'
+ | '\u0640'..'\u0658'
+ | '\u0660'..'\u0669'
+ | '\u066e'..'\u06d3'
+ | '\u06d5'..'\u06dd'
+ | '\u06df'..'\u06e8'
+ | '\u06ea'..'\u06fc'
+ | '\u06ff'
+ | '\u070f'..'\u074a'
+ | '\u074d'..'\u074f'
+ | '\u0780'..'\u07b1'
+ | '\u0901'..'\u0939'
+ | '\u093c'..'\u094d'
+ | '\u0950'..'\u0954'
+ | '\u0958'..'\u0963'
+ | '\u0966'..'\u096f'
+ | '\u0981'..'\u0983'
+ | '\u0985'..'\u098c'
+ | '\u098f'..'\u0990'
+ | '\u0993'..'\u09a8'
+ | '\u09aa'..'\u09b0'
+ | '\u09b2'
+ | '\u09b6'..'\u09b9'
+ | '\u09bc'..'\u09c4'
+ | '\u09c7'..'\u09c8'
+ | '\u09cb'..'\u09cd'
+ | '\u09d7'
+ | '\u09dc'..'\u09dd'
+ | '\u09df'..'\u09e3'
+ | '\u09e6'..'\u09f3'
+ | '\u0a01'..'\u0a03'
+ | '\u0a05'..'\u0a0a'
+ | '\u0a0f'..'\u0a10'
+ | '\u0a13'..'\u0a28'
+ | '\u0a2a'..'\u0a30'
+ | '\u0a32'..'\u0a33'
+ | '\u0a35'..'\u0a36'
+ | '\u0a38'..'\u0a39'
+ | '\u0a3c'
+ | '\u0a3e'..'\u0a42'
+ | '\u0a47'..'\u0a48'
+ | '\u0a4b'..'\u0a4d'
+ | '\u0a59'..'\u0a5c'
+ | '\u0a5e'
+ | '\u0a66'..'\u0a74'
+ | '\u0a81'..'\u0a83'
+ | '\u0a85'..'\u0a8d'
+ | '\u0a8f'..'\u0a91'
+ | '\u0a93'..'\u0aa8'
+ | '\u0aaa'..'\u0ab0'
+ | '\u0ab2'..'\u0ab3'
+ | '\u0ab5'..'\u0ab9'
+ | '\u0abc'..'\u0ac5'
+ | '\u0ac7'..'\u0ac9'
+ | '\u0acb'..'\u0acd'
+ | '\u0ad0'
+ | '\u0ae0'..'\u0ae3'
+ | '\u0ae6'..'\u0aef'
+ | '\u0af1'
+ | '\u0b01'..'\u0b03'
+ | '\u0b05'..'\u0b0c'
+ | '\u0b0f'..'\u0b10'
+ | '\u0b13'..'\u0b28'
+ | '\u0b2a'..'\u0b30'
+ | '\u0b32'..'\u0b33'
+ | '\u0b35'..'\u0b39'
+ | '\u0b3c'..'\u0b43'
+ | '\u0b47'..'\u0b48'
+ | '\u0b4b'..'\u0b4d'
+ | '\u0b56'..'\u0b57'
+ | '\u0b5c'..'\u0b5d'
+ | '\u0b5f'..'\u0b61'
+ | '\u0b66'..'\u0b6f'
+ | '\u0b71'
+ | '\u0b82'..'\u0b83'
+ | '\u0b85'..'\u0b8a'
+ | '\u0b8e'..'\u0b90'
+ | '\u0b92'..'\u0b95'
+ | '\u0b99'..'\u0b9a'
+ | '\u0b9c'
+ | '\u0b9e'..'\u0b9f'
+ | '\u0ba3'..'\u0ba4'
+ | '\u0ba8'..'\u0baa'
+ | '\u0bae'..'\u0bb5'
+ | '\u0bb7'..'\u0bb9'
+ | '\u0bbe'..'\u0bc2'
+ | '\u0bc6'..'\u0bc8'
+ | '\u0bca'..'\u0bcd'
+ | '\u0bd7'
+ | '\u0be7'..'\u0bef'
+ | '\u0bf9'
+ | '\u0c01'..'\u0c03'
+ | '\u0c05'..'\u0c0c'
+ | '\u0c0e'..'\u0c10'
+ | '\u0c12'..'\u0c28'
+ | '\u0c2a'..'\u0c33'
+ | '\u0c35'..'\u0c39'
+ | '\u0c3e'..'\u0c44'
+ | '\u0c46'..'\u0c48'
+ | '\u0c4a'..'\u0c4d'
+ | '\u0c55'..'\u0c56'
+ | '\u0c60'..'\u0c61'
+ | '\u0c66'..'\u0c6f'
+ | '\u0c82'..'\u0c83'
+ | '\u0c85'..'\u0c8c'
+ | '\u0c8e'..'\u0c90'
+ | '\u0c92'..'\u0ca8'
+ | '\u0caa'..'\u0cb3'
+ | '\u0cb5'..'\u0cb9'
+ | '\u0cbc'..'\u0cc4'
+ | '\u0cc6'..'\u0cc8'
+ | '\u0cca'..'\u0ccd'
+ | '\u0cd5'..'\u0cd6'
+ | '\u0cde'
+ | '\u0ce0'..'\u0ce1'
+ | '\u0ce6'..'\u0cef'
+ | '\u0d02'..'\u0d03'
+ | '\u0d05'..'\u0d0c'
+ | '\u0d0e'..'\u0d10'
+ | '\u0d12'..'\u0d28'
+ | '\u0d2a'..'\u0d39'
+ | '\u0d3e'..'\u0d43'
+ | '\u0d46'..'\u0d48'
+ | '\u0d4a'..'\u0d4d'
+ | '\u0d57'
+ | '\u0d60'..'\u0d61'
+ | '\u0d66'..'\u0d6f'
+ | '\u0d82'..'\u0d83'
+ | '\u0d85'..'\u0d96'
+ | '\u0d9a'..'\u0db1'
+ | '\u0db3'..'\u0dbb'
+ | '\u0dbd'
+ | '\u0dc0'..'\u0dc6'
+ | '\u0dca'
+ | '\u0dcf'..'\u0dd4'
+ | '\u0dd6'
+ | '\u0dd8'..'\u0ddf'
+ | '\u0df2'..'\u0df3'
+ | '\u0e01'..'\u0e3a'
+ | '\u0e3f'..'\u0e4e'
+ | '\u0e50'..'\u0e59'
+ | '\u0e81'..'\u0e82'
+ | '\u0e84'
+ | '\u0e87'..'\u0e88'
+ | '\u0e8a'
+ | '\u0e8d'
+ | '\u0e94'..'\u0e97'
+ | '\u0e99'..'\u0e9f'
+ | '\u0ea1'..'\u0ea3'
+ | '\u0ea5'
+ | '\u0ea7'
+ | '\u0eaa'..'\u0eab'
+ | '\u0ead'..'\u0eb9'
+ | '\u0ebb'..'\u0ebd'
+ | '\u0ec0'..'\u0ec4'
+ | '\u0ec6'
+ | '\u0ec8'..'\u0ecd'
+ | '\u0ed0'..'\u0ed9'
+ | '\u0edc'..'\u0edd'
+ | '\u0f00'
+ | '\u0f18'..'\u0f19'
+ | '\u0f20'..'\u0f29'
+ | '\u0f35'
+ | '\u0f37'
+ | '\u0f39'
+ | '\u0f3e'..'\u0f47'
+ | '\u0f49'..'\u0f6a'
+ | '\u0f71'..'\u0f84'
+ | '\u0f86'..'\u0f8b'
+ | '\u0f90'..'\u0f97'
+ | '\u0f99'..'\u0fbc'
+ | '\u0fc6'
+ | '\u1000'..'\u1021'
+ | '\u1023'..'\u1027'
+ | '\u1029'..'\u102a'
+ | '\u102c'..'\u1032'
+ | '\u1036'..'\u1039'
+ | '\u1040'..'\u1049'
+ | '\u1050'..'\u1059'
+ | '\u10a0'..'\u10c5'
+ | '\u10d0'..'\u10f8'
+ | '\u1100'..'\u1159'
+ | '\u115f'..'\u11a2'
+ | '\u11a8'..'\u11f9'
+ | '\u1200'..'\u1206'
+ | '\u1208'..'\u1246'
+ | '\u1248'
+ | '\u124a'..'\u124d'
+ | '\u1250'..'\u1256'
+ | '\u1258'
+ | '\u125a'..'\u125d'
+ | '\u1260'..'\u1286'
+ | '\u1288'
+ | '\u128a'..'\u128d'
+ | '\u1290'..'\u12ae'
+ | '\u12b0'
+ | '\u12b2'..'\u12b5'
+ | '\u12b8'..'\u12be'
+ | '\u12c0'
+ | '\u12c2'..'\u12c5'
+ | '\u12c8'..'\u12ce'
+ | '\u12d0'..'\u12d6'
+ | '\u12d8'..'\u12ee'
+ | '\u12f0'..'\u130e'
+ | '\u1310'
+ | '\u1312'..'\u1315'
+ | '\u1318'..'\u131e'
+ | '\u1320'..'\u1346'
+ | '\u1348'..'\u135a'
+ | '\u1369'..'\u1371'
+ | '\u13a0'..'\u13f4'
+ | '\u1401'..'\u166c'
+ | '\u166f'..'\u1676'
+ | '\u1681'..'\u169a'
+ | '\u16a0'..'\u16ea'
+ | '\u16ee'..'\u16f0'
+ | '\u1700'..'\u170c'
+ | '\u170e'..'\u1714'
+ | '\u1720'..'\u1734'
+ | '\u1740'..'\u1753'
+ | '\u1760'..'\u176c'
+ | '\u176e'..'\u1770'
+ | '\u1772'..'\u1773'
+ | '\u1780'..'\u17d3'
+ | '\u17d7'
+ | '\u17db'..'\u17dd'
+ | '\u17e0'..'\u17e9'
+ | '\u180b'..'\u180d'
+ | '\u1810'..'\u1819'
+ | '\u1820'..'\u1877'
+ | '\u1880'..'\u18a9'
+ | '\u1900'..'\u191c'
+ | '\u1920'..'\u192b'
+ | '\u1930'..'\u193b'
+ | '\u1946'..'\u196d'
+ | '\u1970'..'\u1974'
+ | '\u1d00'..'\u1d6b'
+ | '\u1e00'..'\u1e9b'
+ | '\u1ea0'..'\u1ef9'
+ | '\u1f00'..'\u1f15'
+ | '\u1f18'..'\u1f1d'
+ | '\u1f20'..'\u1f45'
+ | '\u1f48'..'\u1f4d'
+ | '\u1f50'..'\u1f57'
+ | '\u1f59'
+ | '\u1f5b'
+ | '\u1f5d'
+ | '\u1f5f'..'\u1f7d'
+ | '\u1f80'..'\u1fb4'
+ | '\u1fb6'..'\u1fbc'
+ | '\u1fbe'
+ | '\u1fc2'..'\u1fc4'
+ | '\u1fc6'..'\u1fcc'
+ | '\u1fd0'..'\u1fd3'
+ | '\u1fd6'..'\u1fdb'
+ | '\u1fe0'..'\u1fec'
+ | '\u1ff2'..'\u1ff4'
+ | '\u1ff6'..'\u1ffc'
+ | '\u200c'..'\u200f'
+ | '\u202a'..'\u202e'
+ | '\u203f'..'\u2040'
+ | '\u2054'
+ | '\u2060'..'\u2063'
+ | '\u206a'..'\u206f'
+ | '\u2071'
+ | '\u207f'
+ | '\u20a0'..'\u20b1'
+ | '\u20d0'..'\u20dc'
+ | '\u20e1'
+ | '\u20e5'..'\u20ea'
+ | '\u2102'
+ | '\u2107'
+ | '\u210a'..'\u2113'
+ | '\u2115'
+ | '\u2119'..'\u211d'
+ | '\u2124'
+ | '\u2126'
+ | '\u2128'
+ | '\u212a'..'\u212d'
+ | '\u212f'..'\u2131'
+ | '\u2133'..'\u2139'
+ | '\u213d'..'\u213f'
+ | '\u2145'..'\u2149'
+ | '\u2160'..'\u2183'
+ | '\u3005'..'\u3007'
+ | '\u3021'..'\u302f'
+ | '\u3031'..'\u3035'
+ | '\u3038'..'\u303c'
+ | '\u3041'..'\u3096'
+ | '\u3099'..'\u309a'
+ | '\u309d'..'\u309f'
+ | '\u30a1'..'\u30ff'
+ | '\u3105'..'\u312c'
+ | '\u3131'..'\u318e'
+ | '\u31a0'..'\u31b7'
+ | '\u31f0'..'\u31ff'
+ | '\u3400'..'\u4db5'
+ | '\u4e00'..'\u9fa5'
+ | '\ua000'..'\ua48c'
+ | '\uac00'..'\ud7a3'
+ | '\uf900'..'\ufa2d'
+ | '\ufa30'..'\ufa6a'
+ | '\ufb00'..'\ufb06'
+ | '\ufb13'..'\ufb17'
+ | '\ufb1d'..'\ufb28'
+ | '\ufb2a'..'\ufb36'
+ | '\ufb38'..'\ufb3c'
+ | '\ufb3e'
+ | '\ufb40'..'\ufb41'
+ | '\ufb43'..'\ufb44'
+ | '\ufb46'..'\ufbb1'
+ | '\ufbd3'..'\ufd3d'
+ | '\ufd50'..'\ufd8f'
+ | '\ufd92'..'\ufdc7'
+ | '\ufdf0'..'\ufdfc'
+ | '\ufe00'..'\ufe0f'
+ | '\ufe20'..'\ufe23'
+ | '\ufe33'..'\ufe34'
+ | '\ufe4d'..'\ufe4f'
+ | '\ufe69'
+ | '\ufe70'..'\ufe74'
+ | '\ufe76'..'\ufefc'
+ | '\ufeff'
+ | '\uff04'
+ | '\uff10'..'\uff19'
+ | '\uff21'..'\uff3a'
+ | '\uff3f'
+ | '\uff41'..'\uff5a'
+ | '\uff65'..'\uffbe'
+ | '\uffc2'..'\uffc7'
+ | '\uffca'..'\uffcf'
+ | '\uffd2'..'\uffd7'
+ | '\uffda'..'\uffdc'
+ | '\uffe0'..'\uffe1'
+ | '\uffe5'..'\uffe6'
+ | '\ufff9'..'\ufffb'
+// UTF-16 | ('\ud800'..'\udbff') ('\udc00'..'\udfff')
+ ;
Modified: labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Parser.g
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Parser.g 2010-09-01 21:27:01 UTC (rev 34967)
+++ labs/jbossrules/branches/DRLv6/src/main/resources/DRLv6Parser.g 2010-09-01 21:33:07 UTC (rev 34968)
@@ -1,236 +1,122 @@
parser grammar DRLv6Parser;
-
-options {
+
+
+options {
language = Java;
output = AST;
- tokenVocab = DRLv6Lexer;
ASTLabelType=CommonTree;
- backtrack=true;
- memoize=true;
+ tokenVocab=DRLv6Lexer;
+ k=2;
}
-
-
-tokens {
- VT_COMPILATION_UNIT;
- VT_PACKAGE_ID;
- VT_PACKAGE;
- VT_IMPORT_SECTION;
- VT_ONTOLOGY_SECTION;
- VT_DECLARATION_SECTION;
- VT_RULEBASE_SECTION;
-
- VT_GLOBAL_ID;
- VT_DATA_TYPE;
- VT_DIM_SIZE;
-
- VT_IMPORT;
- VT_FUNCTION_IMPORT;
- VT_STAR;
- VT_FUNCTION;
- VT_FUNCTION_ID;
- VT_PARAM;
- VT_PARAM_LIST;
- VT_NAME;
-
- VT_TEMPLATE;
- VT_TEMPLATE_ID;
- VT_SLOT;
- VT_SLOT_ID;
-
- VT_TYPE_DECLARE;
- VT_TYPE_DECLARE_ID;
- VT_EXTENDS;
- VT_DL_DEFINITION;
- VT_DL_TYPE;
- VT_FIELD;
+
- VT_ENTITY_TYPE;
- VT_RULE_ID;
- VT_ATTRIBUTES;
- VT_DIALECT;
-
- VT_LHS;
- VT_ARROW;
-
- VT_RHS;
- VT_THEN;
- VT_CLOSURE;
-
- VT_BRANCH;
- VT_BRANCH_DEFAULT;
- VT_BRANCH_LABEL;
- VT_NEG_BRANCH_LABEL;
-
- VT_RISING_EDGE;
- VT_FALLING_EDGE;
-
- VT_RHS_CHUNK;
- VT_CURLY_CHUNK;
- VT_SQUARE_CHUNK;
- VT_PAREN_CHUNK;
-
- VT_NEW_OBJ;
- VT_TYPE;
- VT_ARGS;
- VT_MSR;
-
- VT_AND_IMPLICIT;
- VT_IMPLIES;
- VT_OR;
- VT_NEG;
- VT_XOR;
- VT_EQUIV;
- VT_AND;
-
- VT_HEDGE_VERY;
- VT_HEDGE_MOL;
-
- VT_EXISTS;
- VT_FORALL;
- VT_NEXISTS;
- VT_COUNT;
- VT_MIN;
- VT_MAX;
- VT_VALUE;
-
- VT_PATTERN;
- VT_NESTED_PATTERN;
- VT_ENABLED;
- VT_QUERY_PATTERN;
-
- VT_POSITIONAL_VAR;
- VT_POSITIONAL_CONST;
- VT_POSITIONAL_INDEX;
- VT_POSITIONAL_SKIP;
-
- VT_BINDING;
- VT_ACCESSOR;
- VT_VERSION;
- VT_INDEXER;
- VT_INDEX_ALL;
- VT_METHOD;
- VT_EXPR;
- VT_OTHERWISE;
-
- VT_FILTER;
- VT_SET;
-
- VT_SEQUENCE;
- VT_TRAIL;
- VT_TRAIL_NODE;
-
- VT_LIST;
- VT_RANGE;
-
- VT_BEHAVIOR;
- VT_ENTRYPOINT;
- VT_ENTRYPOINT_ID;
- VT_FROM_SOURCE;
- VT_EXPRESSION_CHAIN;
-
- VT_ACCUMULATE_LEFT;
- VT_ACCUMULATE_RIGHT;
- VT_ACCUMULATE_ITERATION;
- VT_ACCUMULATE_FUNCTION;
- VT_ACC_ITER_INIT;
- VT_ACC_ITER_ACT;
- VT_ACC_ITER_REV;
- VT_ACC_ITER_RES;
-
- VT_COLLECT_LIST;
-
-
- VT_ONTOLOGY;
- VT_IRI;
- VT_PREFIX;
- VT_ANNOTATIONS;
- VT_ANNOTATION;
- VT_DL_DEFINITION;
- VT_FIELD;
-
- VT_DL_TYPE;
- VT_DL_PROP;
- VT_DL_RESTRICTION;
- VT_DL_RESTRICTED_TYPE;
-
- VT_EQUIVALENTTO;
- VT_SUBCLASSOF;
- VT_DISJOINTWITH;
- VT_DISJOINTUNIONOF;
- VT_SUBPROPERTYOF;
- VT_INVERSEOF;
- VT_SUBPROPERTYCHAIN;
- VT_DOMAIN;
- VT_RANGE;
-
- VT_FACTS;
- VT_FACT;
- VT_TYPES;
- VT_SAMEAS;
- VT_DIFFERENTFROM;
-
- VT_EQV_CLASS;
- VT_DIF_CLASS;
- VT_EQV_PROP;
- VT_DIF_PROP;
- VT_EQV_INDV;
- VT_DIF_INDV;
-}
-
- at parser::header {
+//import General, Expression;
+import DRLv6Keywords, Manchester;
+
+
+
+
+ at header {
package org.drools.lang;
import java.util.List;
import java.util.LinkedList;
+ import java.util.Set;
+ import java.util.HashSet;
+ import org.drools.compiler.DroolsParserException;
}
+
+ at members {
-
+ private Tree curField;
+ private Set prefixes = new HashSet();
+ private ParserHelper helper = new ParserHelper( this,
+ tokenNames,
+ input,
+ state );
+
+ /**
+ * The dummy parameter bellow is just to enable constructor overloading
+ * so that we can initialise the parser helper on delegate grammars
+ */
+ public DRLv6Parser(TokenStream input, boolean dummy ) {
+ this(input);
+ gDRLv6Keywords.setParserHelper( helper );
+// gExpression.setParserHelper( helper );
+// gGeneral.setParserHelper( helper );
+// gAttributes.setParserHelper( helper );
+ gManchester.setParserHelper( helper );
+ gManchester.setPrefixSet( prefixes );
+ }
+
+ public ParserHelper getHelper() { return helper; }
+ public boolean hasErrors() { return helper.hasErrors(); }
+ public List<DroolsParserException> getErrors() { return helper.getErrors(); }
+ public List<String> getErrorMessages() { return helper.getErrorMessages(); }
+ public void enableEditorInterface() { helper.enableEditorInterface(); }
+ public void disableEditorInterface() { helper.disableEditorInterface(); }
+ public LinkedList<DroolsSentence> getEditorInterface() { return helper.getEditorInterface(); }
+ public void reportError(RecognitionException ex) { helper.reportError( ex ); }
-/**************************** SCOPE *******************************************/
+
+
+
+}
+
+
+
compilation_unit
- : package_statement?
- general_import_statement*
- declaration_statement*
+ : package_statement?
+ import_section
+ declaration_section
ontology_section?
- rulebase_statement*
+ rulebase_section?
EOF
- -> ^(VT_COMPILATION_UNIT
- package_statement?
- ^(VT_IMPORT_SECTION general_import_statement*)
- ^(VT_DECLARATION_SECTION declaration_statement*)
- ^(VT_ONTOLOGY_SECTION ontology_section?)
- ^(VT_RULEBASE_SECTION rulebase_statement*)
- )
+ -> ^(VT_COMPILATION_UNIT package_statement?
+ ^(VT_IMPORT_SECTION import_section?)
+ ^(VT_DECLARATION_SECTION declaration_section?)
+ ^(VT_ONTOLOGY_SECTION ontology_section?)
+ ^(VT_RULEBASE_SECTION rulebase_section?)
+ )
;
-/**************************** PACKAGE *******************************************/
+
-package_statement
- : PACKAGE
- package_id SEMICOLON?
+package_statement
+ : package_key package_id SEMICOLON?
-> ^(VT_PACKAGE package_id)
;
package_id
- : fully_qualified_name
+ : procedural_name
;
+import_section
+ : general_import_statement*
+ ;
-/**************************** STATEMENTS *******************************************/
-
general_import_statement
+options{
+ k=3;
+}
: function_import_statement
| import_statement
;
+
+
+declaration_section
+ : declaration_statement*
+ ;
+
declaration_statement
: global
| function
@@ -238,19 +124,25 @@
ontology_section
: manDL_ontology
-// | type_declaration*
;
+rulebase_section
+ : rulebase_statement+
+ ;
+
rulebase_statement
: rule
| query
;
-/**************************** GLOBAL + DATATYPE *******************************************/
+
+
+
+
global
- : GLOBAL data_type global_id SEMICOLON?
- -> ^(GLOBAL data_type global_id)
+ : global_key data_type global_id SEMICOLON?
+ -> ^(global_key data_type global_id)
;
global_id
@@ -261,47 +153,30 @@
-primitive_type
- : TYPE_STRING
- | TYPE_INTEGER
- | TYPE_FLOAT
- | TYPE_DOUBLE
- | TYPE_BOOLEAN
- ;
-
-data_type returns [int dim]
- at init{
- $dim=0;
-}
- : fully_qualified_name (dimension_definition {$dim++;})*
- -> ^(VT_DATA_TYPE VT_DIM_SIZE[$start,""+$dim] fully_qualified_name )
- ;
-dimension_definition
- : LEFT_SQUARE RIGHT_SQUARE
- ;
-/**************************** IMPORT *******************************************/
+
import_statement
- : IMPORT import_name SEMICOLON?
+ : import_key import_name SEMICOLON?
-> ^(VT_IMPORT import_name)
;
function_import_statement
- : IMPORT FUNCTION import_name SEMICOLON?
+ : import_key function_key import_name SEMICOLON?
-> ^(VT_FUNCTION_IMPORT import_name)
;
import_name
- : fully_qualified_name star=DOT_STAR?
- -> {star==null}? fully_qualified_name
- -> ^(VT_STAR fully_qualified_name)
+ : procedural_name star=DOT_STAR?
+ -> {star==null}? procedural_name
+ -> ^(VT_STAR procedural_name)
;
-/**************************** FUNCTION *******************************************/
+
+
function
- : FUNCTION data_type? function_id parameters curly_chunk
+ : function_key data_type? function_id parameters curly_chunk
-> ^(VT_FUNCTION data_type? function_id parameters curly_chunk)
;
@@ -310,748 +185,25 @@
-> VT_FUNCTION_ID[$id]
;
-parameters
- : LEFT_PAREN
- ( param_definition (COMMA param_definition)* )?
- RIGHT_PAREN
- -> ^(VT_PARAM_LIST param_definition*)
- ;
-param_definition
- : data_type argument
- -> ^(VT_PARAM data_type argument)
- ;
-
-argument
- : ID //dimension_definition*
- ;
-
-
-
-/******************************************
-* TYPE DECLARATION
-
-
-
-type_declaration
- : DECLARE type_declare_id extend?
- type_declare_attributes?
- dl_class_descr?
- decl_field*
- END SEMICOLON?
- -> ^(VT_TYPE_DECLARE type_declare_id extend? type_declare_attributes? dl_class_descr? decl_field*)
- ;
-type_declare_id
- : fully_qualified_name
- -> ^(VT_TYPE_DECLARE_ID fully_qualified_name)
- ;
-type_declare_attributes
- :
- (AT type_declare_attribute)+
- -> ^(VT_ATTRIBUTES type_declare_attribute+)
- | AT LEFT_SQUARE type_declare_attribute (COMMA type_declare_attribute)* RIGHT_SQUARE
- -> ^(VT_ATTRIBUTES type_declare_attribute+)
- ;
-type_declare_attribute
- :
- tda_role
- | type_declare_att_semantic
- ;
-
-type_declare_att_semantic
- : tda_namespace
- | tda_disjoint
- | tda_symmetric
- | tda_transitive
- | tda_inverse
- ;
-
-tda_role
- : ROLE^ LEFT_PAREN! ( EVENT | ENTITY | PROPERTY | TYPE ) RIGHT_PAREN!
- ;
-
-tda_namespace
- : NAMESPACE^ LEFT_PAREN! ID EQUALS! STRING RIGHT_PAREN!
- ;
-
-tda_disjoint
- : DISJOINT^ LEFT_PAREN! ID RIGHT_PAREN!
- ;
-tda_inverse
- : INVERSEOF^ LEFT_PAREN! ID RIGHT_PAREN!
- ;
-
-tda_symmetric
- : MDA_SYMMETRIC^
- ;
-
- tda_transitive
- : MDA_TRANSITIVE^
- ;
-
-
-extend
- : EXTEND fully_qualified_name
- -> ^(VT_EXTENDS fully_qualified_name)
- ;
+
+
-
-
-
-
-dl_class_descr
- : AS dl_implies
- -> ^(VT_DL_DEFINITION dl_implies)
- ;
-
-dl_implies
- : dl_or (impl=IMPLIES dl_or)?
- -> {impl==null}? dl_or
- -> ^(VT_IMPLIES dl_or dl_or)
- ;
-
-dl_or
- : dl_and (or=OR dl_and)*
- -> {or==null}? dl_and
- -> ^(VT_OR dl_and+)
- ;
-
-dl_and
- : dl_atom (and=AND dl_atom)*
- -> {and==null}? dl_atom
- -> ^(VT_AND dl_atom+)
- ;
-
-dl_atom
- : NEG dl_atom
- -> ^(VT_NEG dl_atom)
- | dl_type
- | dl_prop
- ;
-
-
-dl_type
- : LEFT_PAREN! dl_implies RIGHT_PAREN!
- | dl_class
- ;
-
-dl_class
- : ID LEFT_PAREN RIGHT_PAREN
- -> ^(VT_DL_TYPE ID)
- ;
-
-dl_prop
- : ID (ONLY | SOME)^ dl_type
- ;
-
-*/
-
-decl_fields
- : decl_field more=decl_field*
- -> ^(VT_EQUIVALENTTO ^(VT_DL_DEFINITION ^(VT_AND decl_field+)))
- ;
-
-
-decl_field
- : ID
- COLON
- data_type
- decl_field_attributes?
- //-> ^(VT_FIELD decl_field_attributes? ID data_type )
- -> {$data_type.dim==0}?
- ^(VT_AND
- decl_field_attributes?
- ^(VT_COUNT ID ^(VT_MIN INT["1"]) data_type)
- ^(VT_COUNT ID ^(VT_MAX INT["1"]) data_type)
- ^(VT_FORALL ID data_type)
- )
- -> ^(VT_AND
- decl_field_attributes?
- ^(VT_EXISTS ID data_type)
- ^(VT_FORALL ID data_type)
- )
- ;
-
-
-decl_field_attributes
- :
- AT LEFT_SQUARE
- decl_field_attribute (COMMA decl_field_attribute)*
- RIGHT_SQUARE
- -> ^(VT_ATTRIBUTES decl_field_attribute+)
- ;
-
-decl_field_attribute
- :
- KEY
- ;
-
-
-/*******************************************************************
-* MANCHESTER SYNTAX
-*******************************************************************/
-
-manDL_ontology
- : manDL_prefix*
- ONTOLOGY COLON iri+
- manDL_inport*
- manDL_annotations?
- manDL_type_declaration*
- -> ^(VT_ONTOLOGY ^(VT_NAME iri+) manDL_prefix* manDL_inport* manDL_annotations? manDL_type_declaration*)
- ;
-
-manDL_prefix
- : (PREFIX | NAMESPACE) COLON ID COLON? full_iri
- -> ^(VT_PREFIX ID full_iri)
- ;
-
-
-manDL_inport // :)
- : IMPORT COLON iri
- -> ^(VT_IMPORT iri)
- ;
-
-
-manDL_type_declaration
- : manDL_datatype_def
- | manDL_class
- | manDL_event
- | manDL_objectProperty
- | manDL_dataProperty
- | manDL_annotationProperty
- | manDL_namedIndividual
- | manDL_misc
- ;
-
-
-
-manDL_datatype_def
- : (AT type=DATATYPE DECLARE
- | type=DATATYPE COLON )
- iri
- manDL_datatype_frame*
- END?
- -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$type]) ^(VT_TYPE_DECLARE_ID iri) manDL_datatype_frame*)
- ;
-
-manDL_class
- : ( (AT type=CLASS)? DECLARE
- | type=CLASS COLON )
-
- iri
- manDL_class_frame*
- decl_fields?
- END?
- -> {type!=null}? ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$type]) ^(VT_TYPE_DECLARE_ID iri) manDL_class_frame* decl_fields?)
- -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE["Class"]) ^(VT_TYPE_DECLARE_ID iri) manDL_class_frame* decl_fields?)
- ;
-
-
-manDL_event
- : ( AT type=EVENT DECLARE
- | type=EVENT COLON )
-
- iri
- manDL_class_frame*
- END?
- -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$type]) ^(VT_TYPE_DECLARE_ID iri) manDL_class_frame*)
- ;
-
-manDL_objectProperty
- : ( AT type=PROPERTY_OBJECT DECLARE
- | type=PROPERTY_OBJECT COLON)
- iri
- (AT manDL_attribute)*
- manDL_objProp_frame*
- END?
- -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$type]) ^(VT_TYPE_DECLARE_ID iri) ^(VT_ATTRIBUTES manDL_attribute*)? manDL_objProp_frame*)
- ;
-
-manDL_dataProperty
- : (AT type=PROPERTY_DATA DECLARE
- | type=PROPERTY_DATA COLON)
- iri
- (AT manDL_attribute)*
- manDL_dataProp_frame*
- END?
- -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$type]) ^(VT_TYPE_DECLARE_ID iri) manDL_dataProp_frame*)
- ;
-
-manDL_annotationProperty
- : ( AT type=PROPERTY_ANNOTATION DECLARE
- | type=PROPERTY_ANNOTATION COLON)
- iri
- manDL_annProp_frame*
- END?
- -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$type]) ^(VT_TYPE_DECLARE_ID iri) manDL_annProp_frame*)
- ;
-
-manDL_namedIndividual
- : (AT type=INDIVIDUAL DECLARE
- | type=INDIVIDUAL COLON)
- iri
- manDL_indiv_frame*
- END?
- -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$type]) ^(VT_NAME iri) manDL_indiv_frame*)
- ;
-
-
-
-
-manDL_datatype_frame
- : manDL_annotations
- | manDL_equivalentTo
- ;
-
-manDL_class_frame
- : manDL_annotations
- | manDL_disjointUnionOf
- | manDL_disjointWith
- | manDL_equivalentTo
- | manDL_subClassOf
- | manDL_hasKey
- ;
-
-manDL_dataProp_frame
- : manDL_annotations
- | manDL_domain
- | manDL_range
- | manDL_attributes
- | manDL_disjointWith
- | manDL_equivalentTo
- | manDL_subPropertyOf
- ;
-
-manDL_objProp_frame
- : manDL_annotations
- | manDL_attributes
- | manDL_disjointWith
- | manDL_equivalentTo
- | manDL_inverseOf
- | manDL_domain
- | manDL_range
- | manDL_subPropertyOf
- | manDL_subPropChain
- ;
-
-
-manDL_annProp_frame
- : manDL_annotations
- | manDL_domain
- | manDL_range
- | manDL_subPropertyOf
- ;
-
-manDL_indiv_frame
- : manDL_annotations
- | manDL_types
- | manDL_facts
- | manDL_sameAs
- | manDL_differentFrom
- ;
-
-
-manDL_misc
- : (eq=EQUIVALENT_CLASSES | df=DISJOINT_CLASSES) COLON
- manDL_annotations? manDL_description (COMMA manDL_description)+
- -> {eq!=null}? ^(VT_EQV_CLASS manDL_annotations? manDL_description+)
- -> ^(VT_DIF_CLASS manDL_annotations? manDL_description+)
-
- | (eq=EQUIVALENT_PROPERTIES | df=DISJOINT_PROPERTIES) COLON
- manDL_annotations? manDL_property_expression (COMMA manDL_property_expression)+
- -> {eq!=null}? ^(VT_EQV_PROP manDL_annotations? manDL_property_expression+)
- -> ^(VT_DIF_PROP manDL_annotations? manDL_property_expression+)
-
- | (eq=SAME_INDIVIDUAL | df=DIFFERENT_INDIVIDUALS) COLON
- manDL_annotations? manDL_individual (COMMA manDL_individual)+
- -> {eq!=null}? ^(VT_EQV_INDV manDL_annotations? manDL_individual+)
- -> ^(VT_DIF_INDV manDL_annotations? manDL_individual+)
- ;
-
-manDL_annotations
- : AT ANNOTATIONS LEFT_PAREN manDL_annotation_list RIGHT_PAREN
- -> ^(VT_ANNOTATIONS manDL_annotation_list)
- | ANNOTATIONS COLON manDL_annotation_list
- -> ^(VT_ANNOTATIONS manDL_annotation_list)
- ;
-
-manDL_disjointUnionOf
- : DISJOINT_UNION COLON manDL_disjointUnionOf_list
- -> ^(VT_DISJOINTUNIONOF manDL_disjointUnionOf_list)
- ;
-
-manDL_disjointUnionOf_list
- : manDL_annotated_description (COMMA! manDL_annotated_description)+
- ;
-
-
-manDL_disjointWith
- : DISJOINT COLON manDL_annotated_description_list
- -> ^(VT_DISJOINTWITH manDL_annotated_description_list)
- ;
-
-manDL_equivalentTo
- : ( AS | EQUIVALENTTO COLON) manDL_annotated_description_list
- -> ^(VT_EQUIVALENTTO manDL_annotated_description_list)
- ;
-
-manDL_subClassOf
- : SUBCLASSOF COLON manDL_annotated_description_list
- -> ^(VT_SUBCLASSOF manDL_annotated_description_list)
- ;
-
-manDL_subPropertyOf
- : SUBPROPERTYOF COLON manDL_property_list
- -> ^(VT_SUBPROPERTYOF manDL_property_list)
- ;
-
-manDL_hasKey
- : HASKEY^ COLON! manDL_annotations manDL_property_expression+
- ;
-
-manDL_domain
- : DOMAIN COLON manDL_annotated_description_list
- -> ^(VT_DOMAIN manDL_annotated_description_list)
- ;
-
-manDL_range
- : RANGE COLON manDL_annotated_description_list
- -> ^(VT_RANGE manDL_annotated_description_list)
- ;
-
-manDL_inverseOf
- : INVERSEOF COLON manDL_property_list
- -> ^(VT_INVERSEOF manDL_property_list)
- ;
-
-manDL_subPropChain
- : SUBPROPERTYCHAIN COLON manDL_annotations? manDL_property_expression ( CHAIN_SEP manDL_property_expression )*
- -> ^(VT_SUBPROPERTYCHAIN manDL_annotations? manDL_property_expression+)
- ;
-
-manDL_attributes
- : CHARACTERISTICS COLON (manDL_annotations? manDL_attribute) (COMMA manDL_annotations? manDL_attribute)*
- -> ^(VT_ATTRIBUTES ^(manDL_attribute manDL_annotations?)+)
- ;
-
-manDL_types
- : TYPES COLON manDL_annotated_description_list
- -> ^(VT_TYPES manDL_annotated_description_list)
- ;
-
-manDL_facts
- : FACTS COLON manDL_fact_annotated_list
- -> ^(VT_FACTS manDL_fact_annotated_list)
- ;
-
-manDL_sameAs
- : SAMEAS COLON manDL_individual_list
- -> ^(VT_SAMEAS manDL_individual_list)
- ;
-
-manDL_differentFrom
- : DIFFERENTFROM COLON manDL_individual_list
- -> ^(VT_DIFFERENTFROM manDL_individual_list)
- ;
-
-manDL_individual_list
- : manDL_annotated_individual (COMMA! manDL_annotated_individual)*
- ;
-
-manDL_annotated_individual
- : ^(manDL_individual manDL_annotations?)
- ;
-
-manDL_fact_annotated_list
- : manDL_annotated_fact (COMMA! manDL_annotated_fact)*
- ;
-
-manDL_annotated_fact
- : ^(manDL_fact manDL_annotations?)
- ;
-
-manDL_fact
- : neg=NOT? manDL_property_expression (manDL_individual | literal)
- -> {neg==null}? ^(VT_FACT manDL_property_expression manDL_individual? literal?)
- -> ^(VT_NEG ^(VT_FACT manDL_property_expression manDL_individual? literal?))
- ;
-
-manDL_attribute
- : manDL_att_functional
- | manDL_att_inverseFunctional
- | manDL_att_reflexive
- | manDL_att_irreflexive
- | manDL_att_symmetric
- | manDL_att_asymmetric
- | manDL_att_transitive
- ;
-
-
-
-manDL_att_functional
- : MDA_FUNCTIONAL
- ;
-
-manDL_att_inverseFunctional
- : MDA_FUNCTIONAL_INV
- ;
-
-manDL_att_reflexive
- : MDA_REFLEXIVE
- ;
-
-manDL_att_irreflexive
- : MDA_REFLEXIVE_INV
- ;
-
-manDL_att_symmetric
- : MDA_SYMMETRIC
- ;
-
-manDL_att_asymmetric
- : MDA_SYMMETRIC_INV
- ;
-
-manDL_att_transitive
- : MDA_TRANSITIVE
- ;
-
-
-
-manDL_annotated_description_list
- : manDL_annotated_description (COMMA! manDL_annotated_description)*
- ;
-
-
-manDL_annotated_description
- : manDL_annotations? manDL_description
- -> ^(VT_DL_DEFINITION manDL_annotations? manDL_description)
- ;
-
-
-
-manDL_description
- : manDL_conjunction (or=OR manDL_conjunction)*
- -> {or==null}? manDL_conjunction
- -> ^(VT_OR manDL_conjunction+)
- ;
-
-manDL_conjunction
- : manDL_primary (and=AND manDL_primary)*
- -> {and==null}? manDL_primary
- -> ^(VT_AND manDL_primary+)
- | manDL_classIRI THAT manDL_restriction (AND manDL_restriction)*
- -> ^(VT_AND ^(VT_DL_TYPE manDL_classIRI) manDL_restriction+)
- ;
-
-
-manDL_primary
- : manDL_restriction | manDL_atomic
- ;
-
-manDL_atomic
- : not=NOT? manDL_atomic_core
- -> {not!=null}? ^(VT_NEG manDL_atomic_core)
- -> manDL_atomic_core
- ;
-
-manDL_atomic_core
- : manDL_classIRI
- -> ^(VT_DL_TYPE manDL_classIRI)
- | manDL_datatype
- -> ^(VT_DL_TYPE manDL_datatype)
- | LEFT_CURLY! literal_list RIGHT_CURLY!
- | manDL_data_type_restriction
- -> manDL_data_type_restriction
- | LEFT_PAREN! manDL_description RIGHT_PAREN!
- ;
-
-manDL_restriction
- : not=NOT? manDL_quantified_restriction_core
- -> {not!=null}? ^(VT_NEG manDL_quantified_restriction_core)
- -> manDL_quantified_restriction_core
- ;
-
-
-manDL_quantified_restriction_core
- : manDL_property_expression SOME manDL_primary
- -> ^(VT_EXISTS manDL_property_expression manDL_primary)
- | manDL_property_expression ONLY manDL_primary
- -> ^(VT_FORALL manDL_property_expression manDL_primary)
- | manDL_property_expression manDL_primary
- -> ^(VT_AND ^(VT_EXISTS manDL_property_expression manDL_primary) ^(VT_FORALL manDL_property_expression manDL_primary))
- | manDL_property_expression VALUE (manDL_individual | literal)
- -> ^(VT_VALUE manDL_property_expression manDL_individual? literal?)
- | manDL_property_expression SELF
- -> ^(SELF manDL_property_expression)
- | manDL_property_expression MIN INT manDL_primary?
- -> ^(VT_COUNT manDL_property_expression ^(VT_MIN INT) manDL_primary?)
- | manDL_property_expression MAX INT (manDL_primary)?
- -> ^(VT_COUNT manDL_property_expression ^(VT_MAX INT) manDL_primary?)
- | manDL_property_expression EXACTLY INT (manDL_primary)?
- -> ^(VT_AND
- ^(VT_COUNT manDL_property_expression ^(VT_MIN INT) manDL_primary?)
- ^(VT_COUNT manDL_property_expression ^(VT_MAX INT) manDL_primary?)
- )
- ;
-
-
-manDL_property_expression
- : inv=INVERSE? manDL_propertyIRI
- -> ^(VT_DL_PROP manDL_propertyIRI $inv?)
- ;
-
-
-manDL_data_type_restriction
- : manDL_datatype LEFT_SQUARE manDL_facets RIGHT_SQUARE
- -> ^(VT_DL_RESTRICTED_TYPE manDL_datatype manDL_facets)
- ;
-
-manDL_facets
- : manDL_facet manDL_restriction_value more=(COMMA manDL_facet manDL_restriction_value)*
- -> {more==null}? ^(VT_DL_RESTRICTION manDL_facet manDL_restriction_value)
- -> ^(VT_AND ^(VT_DL_RESTRICTION manDL_facet manDL_restriction_value)+)
- ;
-
-manDL_restriction_value
- : literal
- ;
-
-manDL_facet
- : LENGTH
- | LENGTH_MIN
- | LENGTH_MAX
- | PATTERN
- | PATTERN_LANG
- | GREATER_EQUAL
- | GREATER
- | LESS_EQUAL
- | LESS
- ;
-
-
-
-manDL_annotation_list
- : manDL_annotation (COMMA! manDL_annotation)*
- ;
-
-manDL_annotation
- : manDL_annotations? manDL_annotationPropertyIRI manDL_annotation_target
- -> ^(VT_ANNOTATION manDL_annotations? manDL_annotationPropertyIRI manDL_annotation_target )
- ;
-
-manDL_annotation_target
- : manDL_individual | literal
- ;
-
-
-
-
-manDL_property_list
- : manDL_annotatedProperty (COMMA! manDL_annotatedProperty)?
- ;
-
-manDL_annotatedProperty
- : manDL_annotations? manDL_property_expression
- ;
-
-
-
-
-manDL_classIRI
- : iri
- ;
-
-manDL_datatype
- : manDL_datatypeIRI
- ;
-
-manDL_datatypeIRI
- : primitive_type
- ;
-
-manDL_objectPropertyIRI
- : iri
- ;
-
-manDL_dataPropertyIRI
- : iri
- ;
-
-manDL_annotationPropertyIRI
- : iri
- ;
-
-manDL_propertyIRI
- : iri
- ;
-
-manDL_individual
- : manDL_individualIRI
- | nodeID
- ;
-
-manDL_individualIRI
- : iri
- ;
-
-
-iri
- : full_iri
- -> ^(VT_IRI full_iri? )
- | ID (PREFIXED_ID)?
- -> ^(VT_IRI ID PREFIXED_ID? )
- ;
-
-
-nodeID
- : BLANK_ID
- ;
-
-full_iri
- : LESS!
- any_iri
- //scheme COLON ihier-part iquery ifragment
- // ?iquery, #ifragment
- GREATER!
- ;
-
-
-any_iri
- at init{
- String text = "";
-}
- : cc=any_iri_content {text = $cc.text;}
- -> ^(VT_PAREN_CHUNK[$cc.start,text])
- ;
-
-any_iri_content
- : (~ (GREATER | SLASH) | SLASH)*
- ;
-
-
-
-/******************************************************* RULES *******************************************/
-
-
-
-
-
rule
- : RULE rule_id parameters? (EXTEND rule_id)?
- rule_metadata*
- rule_attributes?
- rule_arrow?
- when_part?
- then_part
- -> ^(RULE rule_id
+ : rule_key {System.out.println("rule - check for rule key");}
+ rule_id parameters? {System.out.println("rule - check for rule params");}
+ (extends_key rule_id)? {System.out.println("rule - check for rule ext");}
+ rule_attributes? {System.out.println("rule - check for rule atts");}
+ rule_arrow? {System.out.println("rule - check for rule arrow");}
+ when_part {System.out.println("rule - check for rule when");}
+ then_part {System.out.println("rule - check for rule then");}
+ -> ^(rule_key rule_id
^(VT_EXTENDS rule_id)?
parameters?
- rule_metadata*
rule_attributes?
rule_arrow?
when_part?
@@ -1067,256 +219,42 @@
-> VT_RULE_ID[$id]
;
-rule_metadata
- : AT! ID^ paren_chunk?
- ;
rule_arrow
: (
- (implication deduction?)
- | (deduction implication?)
+ (implication) => implication deduction?
+ | (deduction) => deduction implication?
)
-> ^(VT_ARROW implication? deduction?)
;
-
+
deduction
- : A_DEDUCTION^ operator_attributes
+ : ra_deduction_key^ operator_attributes
;
implication
- : A_IMPLICATION^ operator_attributes
+ : ra_implication_key^ operator_attributes
;
-/**************************** RULE ATTRIBS *******************************************/
+
+
-rule_attributes
- : AT rule_attribute ( COMMA? AT rule_attribute)*
- -> ^(VT_ATTRIBUTES rule_attribute+)
- ;
-
-rule_attribute
- : ra_salience
- | ra_no_loop
- | ra_agenda_group
- | ra_timer
- | ra_activation_group
- | ra_auto_focus
- | ra_date_effective
- | ra_date_expires
- | ra_enabled
- | ra_ruleflow_group
- | ra_lock_on_active
- | ra_dialect
- | ra_calendars
- | ra_defeats
- | ra_direction
- ;
-
-ra_date_effective
- : A_DATE_EFFECTIVE^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-ra_date_expires
- : A_DATE_EXPIRES^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-ra_enabled
- : A_ENABLED^
- LEFT_PAREN! BOOL RIGHT_PAREN!
- ;
-
-ra_salience
- : A_SALIENCE^
- LEFT_PAREN! INT RIGHT_PAREN!
- ;
-
-ra_no_loop
- : A_NOLOOP^ (LEFT_PAREN! BOOL RIGHT_PAREN!)?
- ;
-
-ra_auto_focus
- : A_AUTOFOCUS^ (LEFT_PAREN! BOOL RIGHT_PAREN!)?
- ;
-
-ra_activation_group
- : A_ACTGROUP^ (LEFT_PAREN! STRING RIGHT_PAREN!)
- ;
-
-ra_ruleflow_group
- : A_RULEFLOWGROUP^ (LEFT_PAREN! STRING RIGHT_PAREN!)
- ;
-
-ra_agenda_group
- : A_AGENDAGROUP^ (LEFT_PAREN! STRING RIGHT_PAREN!)
- ;
-
-ra_timer
- : (A_DURATION^| A_TIMER^)
- LEFT_PAREN! INT RIGHT_PAREN!
- ;
-
-ra_calendars
- : A_CALENDAR^ LEFT_PAREN! literal_list RIGHT_PAREN!
- ;
-
-
-ra_dialect
- : A_DIALECT^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-ra_lock_on_active
- : A_LOCKONACTIVE^ (LEFT_PAREN! BOOL RIGHT_PAREN!)
- ;
-
-ra_direction
- : A_DIRECTION^
- ;
-
-ra_defeats
- : DEFEATS^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-
-
-
-operator_attributes
- : (AT single_operator_attribute)+
- -> ^(VT_ATTRIBUTES single_operator_attribute+)
- | AT LEFT_SQUARE single_operator_attribute (COMMA single_operator_attribute)* RIGHT_SQUARE
- -> ^(VT_ATTRIBUTES single_operator_attribute+)
- ;
-
-
-single_operator_attribute
- : oa_kind
- | oa_id
- | oa_params
- | oa_degree
- | oa_merge
- | oa_missing
- | oa_defeat
- | oa_default
- | oa_crisp
- | oa_otherwise
- ;
-
-oa_kind
- : OA_KIND^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-oa_id
- : OA_ID^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-oa_params
- : OA_PARAMS^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-oa_degree
- : OA_DEGREE^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-oa_crisp
- : OA_CRISP^
- ;
-
-oa_merge
- : OA_MERGE^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-oa_missing
- : OA_MISSING^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-oa_defeat
- : OA_DEFEAT^
- ;
-
-oa_default
- : OA_DEFAULT^
- ;
-
-oa_otherwise
- : OA_OTHERWISE^ LEFT_PAREN! STRING RIGHT_PAREN!
- ;
-
-
-
-
-
-pattern_attributes
- : (AT single_pattern_attribute)+
- -> ^(VT_ATTRIBUTES single_pattern_attribute+)
- | AT LEFT_SQUARE single_pattern_attribute (COMMA single_pattern_attribute)* RIGHT_SQUARE
- -> ^(VT_ATTRIBUTES single_pattern_attribute+)
- ;
-
-single_pattern_attribute
- : single_operator_attribute
- | pa_onChange
- ;
-
-pa_onChange
- : ONCHANGE^ LEFT_PAREN!
- (
- TIMES (COMMA! NEG_MARK! ID)*
- | ID (COMMA! ID)*
- )
- RIGHT_PAREN!
- ;
-
-
-
-query_attributes
- : (AT single_query_attribute)+
- -> ^(VT_ATTRIBUTES single_query_attribute+)
- | AT LEFT_SQUARE single_query_attribute (COMMA single_query_attribute)* RIGHT_SQUARE
- -> ^(VT_ATTRIBUTES single_query_attribute+)
- ;
-
-single_query_attribute
- :
- ;
-
-
-
-trail_attributes
- : (AT single_trail_attribute)+
- -> ^(VT_ATTRIBUTES single_trail_attribute+)
- | AT LEFT_SQUARE single_trail_attribute (COMMA single_trail_attribute)* RIGHT_SQUARE
- -> ^(VT_ATTRIBUTES single_trail_attribute+)
- ;
-
-single_trail_attribute
- : ta_trail_start
- | ta_trail_end
- ;
-
-ta_trail_start
- : START
- ;
-
-ta_trail_end
- : END
- ;
-
-/**************************** LHS *******************************************/
-
-
when_part
- : WHEN
+ : (
+ when_key
lhs_root?
+ )
-> ^(VT_LHS lhs_root?)
;
lhs_root
: lhs_implies more=lhs_implies*
-> {more==null}? lhs_implies
- -> ^(VT_AND_IMPLICIT lhs_implies+)
+ -> ^(VT_AND_IMPLICIT lhs_implies+)
;
lhs_base
@@ -1333,28 +271,14 @@
lhs_or
- at init{
- ParserRuleReturnScope seq = null;
-}
- : ld=lhs_diff {seq=ld;}
- ( lios=lhs_or_sequitur[(Tree) seq.getTree()] {seq=lios;} )*
- -> {lios==null}? ^($ld)
- -> ^($lios)
+ : (lhs_diff -> lhs_diff)
+ (
+ or_connective ops=operator_attributes? right=lhs_diff
+ -> ^(or_connective $ops? $lhs_or $right)
+ )*
;
-lhs_or_sequitur[Tree leftChild]
- : or=or_connective^ (atts=operator_attributes!)? rightChild=lhs_diff!
- {
- Tree t = $or.tree;
- if (atts != null)
- t.addChild($atts.tree);
-
- t.addChild(leftChild);
- t.addChild($rightChild.tree);
- }
- ;
-
@@ -1365,36 +289,32 @@
+
-
-lhs_and
- at init{
- ParserRuleReturnScope seq = null;
-}
- : ld=lhs_unary {seq=ld;}
- ( lias=lhs_and_sequitur[(Tree) seq.getTree()] {seq=lias;} )*
- -> {lias==null}? ^($ld)
- -> ^($lias)
+lhs_and
+ : (lhs_unary -> lhs_unary)
+ (
+ and_connective ops=operator_attributes? right=lhs_unary
+ -> ^(and_connective $ops? $lhs_and $right)
+ )*
;
+
-lhs_and_sequitur[Tree leftChild]
- : and=and_connective^ (atts=operator_attributes!)? rightChild=lhs_unary!
- {
- Tree t = $and.tree;
- if (atts != null)
- t.addChild($atts.tree);
-
- t.addChild(leftChild);
- t.addChild($rightChild.tree);
- }
- ;
lhs_unary
+options{
+ k=*;
+}
: lhs_modified_unary filter_chain^?
| lhs_query
;
lhs_modified_unary
+options{
+ k=*;
+ backtrack=true;
+ memoize=true;
+}
:
unary_operator^ operator_attributes? lhs_modified_unary
| LEFT_PAREN! lhs_root RIGHT_PAREN!
@@ -1402,12 +322,23 @@
| lhs_edge
| lhs_branch
| lhs_sequence
- | lhs_label_atom_pattern
+ | lhs_label_atom_pattern
+ | relation_join_pattern
+ ;
+
+
+
+//TODO
+relation_join_pattern
+ : empty_prefix_name^ another_modifier?
;
+
+another_modifier
+ : another_key
+ ;
-
lhs_quantifiexpr
: lhs_exists
| lhs_not
@@ -1416,7 +347,7 @@
lhs_exists
- : lab=label? EXISTS operator_attributes?
+ : lab=label? exists_key operator_attributes?
lhs_base
-> {lab==null}? ^(VT_EXISTS operator_attributes? lhs_base)
-> ^(VT_BINDING label ^(VT_EXISTS operator_attributes? lhs_base))
@@ -1425,7 +356,7 @@
lhs_forall
- : FORALL operator_attributes?
+ : forall_key operator_attributes?
(
pat=lhs_atom_pattern
| LEFT_PAREN lhs_unary lhs_unary RIGHT_PAREN
@@ -1435,7 +366,7 @@
;
lhs_not
- : NOT operator_attributes? lhs_base
+ : not_key operator_attributes? lhs_base
-> ^(VT_NEXISTS operator_attributes? lhs_base)
;
@@ -1447,30 +378,31 @@
;
-/* over_clause obsolete, replaced by filters (see far below in lhs_unary)*/
lhs_atom_pattern
- : fully_qualified_name LEFT_PAREN constraints? RIGHT_PAREN pattern_attributes? from?
+ : procedural_name LEFT_PAREN constraints? RIGHT_PAREN
+ pattern_attributes? from?
-> ^(VT_PATTERN
- ^(VT_AND pattern_attributes? VT_ENABLED ^(VT_TYPE fully_qualified_name) constraints? )
- from?
+ ^(VT_AND pattern_attributes?
+ VT_ENABLED ^(VT_TYPE procedural_name) constraints?
+ ) from?
)
;
-/************************************************ LHS CONSTRUCTS *************************/
+
lhs_edge
- : RISING lhs_base
+ : rising_key lhs_base
-> ^(VT_RISING_EDGE lhs_base)
- | FALLING lhs_base
+ | falling_key lhs_base
-> ^(VT_FALLING_EDGE lhs_base)
;
lhs_branch
- : BRANCH
+ : branch_key
LEFT_PAREN
lhs_base?
branch_alternative+
@@ -1483,7 +415,7 @@
;
branch_label
- : LEFT_SQUARE neg=NEG_MARK? ID RIGHT_SQUARE
+ : LESS neg=NEG_MARK? ID GREATER
-> {neg!=null}? ^(VT_NEG_BRANCH_LABEL ID)
-> ^(VT_BRANCH_LABEL ID)
;
@@ -1499,7 +431,7 @@
: over_filter
| unique_filter
| throttle_filter
- | FILTER ID
+ | filter_key ID
;
@@ -1507,7 +439,7 @@
lhs_sequence
:
- SEQ LEFT_PAREN
+ seq_key LEFT_PAREN
trail+
RIGHT_PAREN
-> ^(VT_SEQUENCE trail+)
@@ -1530,238 +462,88 @@
;
-/*********************************************** INSIDE PATTERN *****************************************/
-
constraints
- : slotted_constraints
- -> ^(VT_AND slotted_constraints)
- | positional_constraints
- -> ^(VT_AND positional_constraints)
+scope {
+ int j;
+}
+ :
+ general_constraint {$constraints::j++;}
+ (COMMA general_constraint {$constraints::j++;})*
+ -> ^(VT_AND general_constraint+)
;
-
+
positional_constraints
scope {
- int j;
+ int k;
}
- : positional_constraint {$positional_constraints::j++;}
- (COMMA! positional_constraint {$positional_constraints::j++;})*
- (COMMA! slotted_constraint)*
+ :
+ positional_constraint {$positional_constraints::k++;}
+ (COMMA positional_constraint {$positional_constraints::k++;})*
+ -> ^(VT_AND positional_constraint+)
;
-
-slotted_constraints
- : slotted_constraint (COMMA! slotted_constraint)*
- ;
+general_constraint
+ : (slotted_constraint) => slotted_constraint
+ | positional_constraint
+ ;
+
+
positional_constraint
@init{
- String idx = ""+$positional_constraints::j;
+
+ String idx;
+ if ( constraints_stack.isEmpty()) {
+ idx = ""+$positional_constraints::k;
+ } else {
+ idx = ""+$constraints::j;
+ }
+
}
- : literal
- -> ^(VT_POSITIONAL_CONST VT_POSITIONAL_INDEX[$start,idx] ^(EQUAL ^(VT_EXPR literal)))
- | var_literal
- -> ^(VT_POSITIONAL_VAR VT_POSITIONAL_INDEX[$start,idx] ^(EQUAL ^(VT_EXPR var_literal)))
- | QUESTION_MARK rest=restriction_root?
+ :
+ (
+ right_expression
+ -> ^(VT_POSITIONAL_CONST VT_POSITIONAL_INDEX[$start,idx] ^(EQUAL right_expression))
+
+ | QUESTION_MARK rest=restriction_root?
->{rest==null}? ^(VT_POSITIONAL_SKIP VT_POSITIONAL_INDEX[$start,idx])
- -> ^(VT_POSITIONAL_CONST VT_POSITIONAL_INDEX[$start,idx] restriction_root)
+ -> ^(VT_POSITIONAL_CONST VT_POSITIONAL_INDEX[$start,idx] restriction_root)
+ )
;
slotted_constraint
- : constr_implies
- ;
-
-
-/********************************************* ATOMIC DATA DEFINITIONS ************************************************/
-
-
-fully_qualified_name
- : ID ( DOT ID )*
- -> ^(VT_NAME ID+)
- | (ID DOT)* primitive_type
- -> ^(VT_NAME ID* primitive_type)
- ;
-
-
-gen_accessor_list
- : first=general_accessor_path (COMMA next=general_accessor_path)*
- -> ^(VT_LIST general_accessor_path+)
- ;
-
-literal_list
- : first=literal (COMMA next=literal)*
- -> ^(VT_LIST literal+)
- ;
-
-var_list
- : first=VAR (COMMA next=VAR)*
- -> ^(VT_LIST VAR+)
- ;
-
-members_list
- : (literal|var_literal) (COMMA! (literal|var_literal))*
- ;
-
-integer_range
- : INT DOUBLE_DOT INT
- -> ^(VT_RANGE INT INT)
- ;
-
-list_literal
- : LEFT_CURLY members_list? RIGHT_CURLY
- ->^(VT_LIST members_list?)
- ;
-
-
-literal
options{
-k=6;
+ backtrack=true;
+ memoize=true;
}
- : STRING m=msr_unit?
- -> {m==null}? STRING
- -> ^(VT_MSR STRING $m)
- | INT m=msr_unit?
- -> {m==null}? INT
- -> ^(VT_MSR INT $m)
- | FLOAT m=msr_unit?
- -> {m==null}? FLOAT
- -> ^(VT_MSR FLOAT $m)
- | BOOL
- | NULL
- | literal_object
- | list_literal
- ;
-
-
-var
- : VAR
- ;
-
-
-var_literal
- : VAR m=msr_unit?
- -> {m==null}? VAR
- -> ^(VT_MSR VAR $m)
- ;
-
-label
- : var COLON!
- ;
-
-msr_unit
- : (GATE! iri)+
- | (DOUBLE_CAP! iri)+
- ;
-
-
-
-
-
-
-
-
-literal_object
- : new_object
- | ordered_object_literal
- ;
-
-new_object
- : NEW data_type LEFT_PAREN literal_object_args? RIGHT_PAREN
- -> ^(VT_NEW_OBJ ^(VT_TYPE data_type) ^(VT_ARGS literal_object_args)?)
- ;
-
-literal_object_args
- : method_args
- ;
-
-
-time_string
- : STRING m=msr_unit?
- -> {m==null}? STRING
- -> ^(VT_MSR STRING $m)
- ;
-
-
-/**************************************************** METHODS AND EXPRESSIONS ***********************************************/
-
-method_args
- : method_arg (COMMA! method_arg)*
+ :
+ nested_accessor_path
+ |
+ constr_implies
;
-method_arg
- : expr_root
- ;
-
-method
- : core=method_core m=msr_unit?
- -> {m==null}? $core
- -> ^(VT_MSR $core $m)
- ;
-
-method_core
- : ID LEFT_PAREN args=method_args? RIGHT_PAREN
- -> {args==null}? ^(VT_METHOD ID )
- -> ^(VT_METHOD ID ^(VT_ARGS method_args?))
- ;
-expr_root
- : factor ( (PLUS | MINUS)^ factor )*
- ;
-
-factor
- : term ( (TIMES | SLASH)^ term )*
- ;
-
-term
- : (MINUS^)? expr_unary
- ;
-
-expr_unary
- : expr_atom
- | LEFT_PAREN! expr_root RIGHT_PAREN!
- ;
-
-expr_atom
- : accessor_path
- | var_literal
- | literal
- ;
-
-/************************************* SLOTTED CONSTRAINTS LOGIC HIERARCHY **********************************/
-
constr_implies
- : left=constr_or (imp=imply_symbol operator_attributes? right=constr_or)?
+ : left=constr_or
+ (imp=imply_symbol operator_attributes? right=constr_or)?
-> {imp != null}? ^($imp operator_attributes? $left $right)
-> ^($left)
;
-constr_or
- at init{
- ParserRuleReturnScope seq = null;
-}
- : ld=constr_diff {seq=ld;}
- ( lios=constr_or_sequitur[(Tree) seq.getTree()] {seq=lios;} )*
- -> {lios==null}? ^($ld)
- -> ^($lios)
- ;
-constr_or_sequitur[Tree leftChild]
- : or=or_symbol^ (atts=operator_attributes!)? rightChild=constr_diff!
- {
- Tree t = $or.tree;
- if (atts != null)
- t.addChild($atts.tree);
-
- t.addChild(leftChild);
- t.addChild($rightChild.tree);
- }
- ;
-
+constr_or
+ : (constr_diff -> constr_diff)
+ (
+ or_symbol ops=operator_attributes? right=constr_diff
+ -> ^(or_symbol $ops? $constr_or $right)
+ )*
+ ;
constr_diff
@@ -1771,155 +553,138 @@
-
constr_and
- at init{
- ParserRuleReturnScope seq = null;
-}
- : ld=constr_unary {seq=ld;}
- ( lias=constr_and_sequitur[(Tree) seq.getTree()] {seq=lias;} )*
- -> {lias==null}? ^($ld)
- -> ^($lias)
- ;
+ : (constr_unary -> constr_unary)
+ (
+ and_symbol ops=operator_attributes? right=constr_unary
+ -> ^(and_symbol $ops? $constr_and $right)
+ )*
+ ;
-constr_and_sequitur[Tree leftChild]
- : and=and_symbol^ (atts=operator_attributes!)? rightChild=constr_unary!
- {
- Tree t = $and.tree;
- if (atts != null)
- t.addChild($atts.tree);
-
- t.addChild(leftChild);
- t.addChild($rightChild.tree);
- }
- ;
-
-
+
constr_unary
- : {System.out.println(">>>>>>U1 " + input.LT(-1) + input.LT(0) + " " + input.LT(1) + " " + input.LT(2) );}
- unary_operator^ operator_attributes? constr_unary
- | {System.out.println(">>>>>>U2 " + input.LT(-1) + input.LT(0) + " " + input.LT(1) + " " + input.LT(2) );}
- constr_atom
- | {System.out.println(">>>>>>U3 " + input.LT(-1) + input.LT(0) + " " + input.LT(1) + " " + input.LT(2) );}
- LEFT_PAREN! constr_implies RIGHT_PAREN!
+options{
+ backtrack=true;
+ memoize=true;
+} // required!
+ : unary_operator^ operator_attributes? constr_unary
+ | constr_atom
+ | LEFT_PAREN! constr_implies RIGHT_PAREN!
;
-
-/*
-constr_atom
- : left=left_expression rest=restriction_root?
- -> {rest==null}? ^(left_expression)
- -> ^(VT_AND_IMPLICIT left_expression restriction_root)
- ;
-*/
+
constr_atom
- : {System.out.println(">>>>>>U11 " + input.LT(-1) + input.LT(0) + " " + input.LT(1) + " " + input.LT(2) );}
- label expr_root restr=restriction_root?
- -> {restr==null}? ^(VT_BINDING label ^(VT_EXPR expr_root))
+options{
+ backtrack=true;
+ memoize=true;
+}
+ : bound_constrained_expr
+ | constrained_expr
+ | bound_expr
+ ;
+
+bound_constrained_expr
+ :
+ bound_expr restr=restriction_root
-> ^(VT_AND_IMPLICIT
- ^(VT_BINDING label ^(VT_EXPR expr_root))
+ bound_expr
$restr
)
-
- | {System.out.println(">>>>>>U12 " + input.LT(-1) + input.LT(0) + " " + input.LT(1) + " " + input.LT(2) );}
- expr_root restr=restriction_root?
- -> {restr==null}? ^(VT_EXPR expr_root restriction_root?)
- -> ^(VT_AND_IMPLICIT
- ^(VT_EXPR expr_root restriction_root?)
+ ;
+
+constrained_expr
+ :
+ expr_root restr=restriction_root
+ -> ^(VT_AND_IMPLICIT
+ ^(VT_EXPR expr_root)
$restr
- )
-
- ;
+ )
+ ;
+
+bound_expr
+options{
+ backtrack=true;
+ memoize=true;
+}
+ : label general_accessor_path
+ -> ^(VT_BINDING label ^(VT_EXPR general_accessor_path))
+ | label LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_BINDING label ^(VT_EXPR expr_root))
+ ;
+
+
+
+ /*
+ left_expression
+ : (VAR COLON) => label
+ (
+ expr_root
+ -> ^(VT_BINDING label ^(VT_DEBUG_LEFT_EXPR expr_root))
+ )
+ | expr_root
+ -> ^(VT_DEBUG_LEFT_EXPR expr_root)
+ ;
+ */
+
+
restriction_root
: restr_implies
;
+
+
restr_implies
- : left=restr_or (imp=imply_symbol operator_attributes? right=restr_or)?
+ : left=restr_or
+ (
+ (imply_symbol operator_attributes? restr_unary) =>
+ imp=imply_symbol operator_attributes?
+ right=restr_or
+
+ )?
-> {imp != null}? ^($imp operator_attributes? $left $right)
-> ^($left)
;
-restr_or
-scope{
- Tree seqTree;
-}
- at init{
- ParserRuleReturnScope seq = null;
-}
- : ld=restr_diff {seq=ld;}
- (
- lios=restr_or_sequitur
- {
- seq=lios;
- $restr_or::seqTree = (Tree) seq.getTree();
- }
- )*
- -> {lios==null}? ^($ld)
- -> ^($lios)
- ;
-restr_or_sequitur
- : or=or_symbol^ (atts=operator_attributes!)? rightChild=restr_diff!
- {
- Tree t = $or.tree;
- if (atts != null)
- t.addChild($atts.tree);
-
- t.addChild($restr_or::seqTree);
- t.addChild($rightChild.tree);
- }
- ;
-
+restr_or
+ : (restr_diff -> restr_diff)
+ (
+ (or_symbol operator_attributes? restr_diff) =>
+ or_symbol ops=operator_attributes? right=restr_diff
+ -> ^(or_symbol $ops? $restr_or $right)
+ )*
+ ;
+
+
restr_diff
- : restr_and (( xor_symbol^ | eq_symbol^ ) operator_attributes? restr_and)?
+ : restr_and
+ (
+ (( xor_symbol^ | eq_symbol^ ) operator_attributes? restr_and) =>
+ ( xor_symbol^ | eq_symbol^ ) operator_attributes? restr_and
+ )?
;
-
-
restr_and
-scope{
- Tree seqTree;
-}
- at init{
- ParserRuleReturnScope seq = null;
-}
- : ld=restr_unary {seq=ld;}
+ : (restr_unary -> restr_unary)
(
- lias=restr_and_sequitur
- {
- seq=lias;
- $restr_and::seqTree = (Tree) seq.getTree();
- }
- )*
- -> {lias==null}? ^($ld)
- -> ^($lias)
- ;
-
-restr_and_sequitur
- : and=and_symbol^ (atts=operator_attributes!)? rightChild=restr_unary!
- {
- Tree t = $and.tree;
- if (atts != null)
- t.addChild($atts.tree);
-
- t.addChild($restr_and::seqTree);
- t.addChild($rightChild.tree);
- }
- ;
+ (and_symbol operator_attributes? restr_unary) =>
+ and_symbol ops=operator_attributes? right=restr_unary
+ -> ^(and_symbol $ops? $restr_and $right)
+ )*
+ ;
+
-
restr_unary
: unary_operator operator_attributes? restr_unary
| LEFT_PAREN! restr_implies RIGHT_PAREN!
@@ -1928,41 +693,42 @@
restr_atom
+options{
+ backtrack=true;
+ memoize=true;
+}
: qnt=inner_quantifier? eval=evaluator operator_attributes? right_expression
-> {qnt==null}? ^(evaluator operator_attributes? right_expression)
-> ^(inner_quantifier ^(evaluator operator_attributes? right_expression))
;
-left_expression
- : (VAR COLON) => label
- (
- //accessor_path
- //-> ^(VT_BINDING label accessor_path)
- expr_root
- -> ^(VT_BINDING label ^(VT_EXPR expr_root))
- )
- | expr_root
- -> ^(VT_EXPR expr_root)
- //| accessor_path
- // -> accessor_path
- ;
+
right_expression
: expr_root
- -> ^(VT_EXPR expr_root)
- | OTHERWISE
+ -> ^(VT_DEBUG_RIGHT_EXPR expr_root)
+ | otherwise_key
-> ^(VT_OTHERWISE)
;
-/***************************************** ACCESSOR PATHS *******************************/
+nested_accessor_path
+ : general_accessor_path^ DOT! nested_obj_pattern
+ | nested_obj_pattern
+ ;
+
general_accessor_path
- : var
- | accessor_path
+options{
+ backtrack=true;
+ memoize=true;
+}
+
+ : accessor_path
+ | var
;
accessor_path
@@ -1973,14 +739,21 @@
;
+
+
accessor
+options{
+ backtrack=true;
+ memoize=true;
+ k=*;
+}
:
- (ID LEFT_PAREN) => m=method ix=indexer?
+ m=method ix=indexer?
{
if (ix != null ) {
- Tree t = ((Tree) ix.getTree());
+ Tree t = ix.tree;
Tree temp = t.getChild(0);
- t.setChild(0,(Tree) m.getTree());
+ t.setChild(0,m.tree);
t.addChild(temp);
}
}
@@ -1989,15 +762,14 @@
| id=versioned_accessor ix=indexer?
{
if (ix != null ) {
- Tree t = ((Tree) ix.getTree());
+ Tree t = ix.tree;
Tree temp = t.getChild(0);
- t.setChild(0,(Tree) id.getTree());
+ t.setChild(0,id.tree);
t.addChild(temp);
}
}
-> {ix==null}? ^($id)
- -> ^($ix)
- | nested_obj_pattern
+ -> ^($ix)
;
@@ -2007,16 +779,22 @@
-> ID
;
+
version
- : DOUBLE_LESS! INT DOUBLE_GREATER!
+options{
+ k=3;
+}
+ : DOUBLE_LESS! DECIMAL DOUBLE_GREATER!
| DOUBLE_LESS! integer_range DOUBLE_GREATER!
- ;
+ ;
+
+
nested_obj_pattern
- : GATE fqn=fully_qualified_name? LEFT_PAREN constraints RIGHT_PAREN
- -> {fqn==null}? ^(VT_NESTED_PATTERN constraints)
+ : GATE fqn=procedural_name? LEFT_PAREN constraints RIGHT_PAREN
+ -> {fqn==null}? ^(VT_NESTED_PATTERN constraints )
-> ^(VT_NESTED_PATTERN
- ^(VT_AND ^(VT_TYPE fully_qualified_name) constraints)
+ ^(VT_AND ^(VT_TYPE procedural_name) constraints )
)
;
@@ -2024,8 +802,8 @@
indexer
: LEFT_SQUARE
(
- INT
- -> ^(VT_INDEXER INT)
+ DECIMAL
+ -> ^(VT_INDEXER DECIMAL)
| STRING
-> ^(VT_INDEXER STRING)
| method
@@ -2045,32 +823,33 @@
-/************************************************** FILTERS ******************************/
+
+
over_filter
- : id1=WINDOW DOUBLE_COLON
- ( id2=TIME paren_chunk
+ : id1=window_key DOUBLE_COLON
+ ( id2=time_key paren_chunk
-> ^(VT_BEHAVIOR $id1 $id2 paren_chunk)
- | id2=LENGTH LEFT_PAREN INT RIGHT_PAREN
- -> ^(VT_BEHAVIOR $id1 $id2 INT)
+ | id3=length_key LEFT_PAREN DECIMAL RIGHT_PAREN
+ -> ^(VT_BEHAVIOR $id1 $id3 DECIMAL)
)
;
unique_filter
- : UNIQUE
- -> ^(VT_BEHAVIOR UNIQUE)
+ : unique_key
+ -> ^(VT_BEHAVIOR unique_key)
;
throttle_filter
- : THROTTLE LEFT_PAREN INT RIGHT_PAREN
- -> ^(VT_BEHAVIOR THROTTLE INT)
+ : throttle_key LEFT_PAREN DECIMAL RIGHT_PAREN
+ -> ^(VT_BEHAVIOR throttle_key DECIMAL)
;
-/*************************************************** PATTERN SOURCES ******************************************/
+
from
- : FROM^
+ : from_key^
( accumulate_statement
| collect_statement
| entrypoint_statement
@@ -2082,27 +861,31 @@
collect_statement
- : COLLECT
+ : collect_key
LEFT_PAREN
lhs_label_atom_pattern
RIGHT_PAREN
- -> ^(COLLECT lhs_label_atom_pattern)
+ -> ^(collect_key lhs_label_atom_pattern)
;
entrypoint_statement
- : ENTRYPOINT
+ : entry_point_key
entrypoint_id
-> ^(VT_ENTRYPOINT entrypoint_id)
;
+
entrypoint_id
: value=ID
-> VT_ENTRYPOINT_ID[$value]
| value=STRING
-> VT_ENTRYPOINT_ID[$value]
;
-
+
from_source
+options{
+ k=*;
+}
: var
| accessor_path
| LEFT_SQUARE! literal_list RIGHT_SQUARE!
@@ -2120,31 +903,33 @@
acc_left
- : ACCUMULATE accumulate_body
+ : (accumulate_key | accL_key | acc_key ) accumulate_body
-> ^(VT_ACCUMULATE_LEFT accumulate_body)
;
acc_right
- : ACCUMULATE_RIGHT accumulate_body
+ : accR_key accumulate_body
-> ^(VT_ACCUMULATE_RIGHT accumulate_body)
;
accumulate_body
: LEFT_PAREN
lhs_root
- ( COMMA?
- ( accumulate_iteration
- | l=label? accumulate_functions )
+ ( COMMA
+ (
+ l=label? accumulate_functions
+ | accumulate_iteration
+ )
)?
RIGHT_PAREN
-> {l==null}? lhs_root accumulate_iteration? accumulate_functions?
-> lhs_root ^(VT_BINDING label accumulate_functions?)
;
-
+
accumulate_functions
: acc_collect_list
- | acc_avg
+ | acc_avg
| acc_min
| acc_max
| acc_sum
@@ -2152,65 +937,69 @@
| acc_distinct
| acc_orderby
| acc_limit
+
;
+
+
+
acc_collect_list
- : COLLECT_LIST
+ : collectList_key
LEFT_PAREN
- (constr_implies
- | var)
+ ( (constr_implies) => constr_implies
+ | expr_root )
RIGHT_PAREN
- -> ^(VT_COLLECT_LIST constr_implies? var?)
+ -> ^(VT_COLLECT_LIST constr_implies? expr_root? )
;
acc_avg
- : AVERAGE LEFT_PAREN expr_root RIGHT_PAREN
- -> ^(VT_ACCUMULATE_FUNCTION AVERAGE ^(VT_EXPR expr_root))
+ : avg_key LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION avg_key ^(VT_EXPR expr_root))
;
acc_min
- : MIN LEFT_PAREN expr_root RIGHT_PAREN
- -> ^(VT_ACCUMULATE_FUNCTION MIN ^(VT_EXPR expr_root))
+ : min_key LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION min_key ^(VT_EXPR expr_root))
;
acc_max
- : MAX LEFT_PAREN expr_root RIGHT_PAREN
- -> ^(VT_ACCUMULATE_FUNCTION MAX ^(VT_EXPR expr_root))
+ : max_key LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION max_key ^(VT_EXPR expr_root))
;
acc_sum
- : SUM LEFT_PAREN expr_root RIGHT_PAREN
- -> ^(VT_ACCUMULATE_FUNCTION SUM ^(VT_EXPR expr_root))
+ : sum_key LEFT_PAREN expr_root RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION sum_key ^(VT_EXPR expr_root))
;
acc_count
- : COUNT LEFT_PAREN RIGHT_PAREN
- -> ^(VT_ACCUMULATE_FUNCTION COUNT)
+ : count_key LEFT_PAREN RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION count_key)
;
acc_distinct
- : DISTINCT LEFT_PAREN gen_accessor_list RIGHT_PAREN
- -> ^(VT_ACCUMULATE_FUNCTION DISTINCT gen_accessor_list)
+ : distinct_key LEFT_PAREN gen_accessor_list RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION distinct_key gen_accessor_list)
;
acc_orderby
- : ORDERBY LEFT_PAREN gen_accessor_list RIGHT_PAREN
- -> ^(VT_ACCUMULATE_FUNCTION ORDERBY gen_accessor_list)
+ : orderby_key LEFT_PAREN gen_accessor_list RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION orderby_key gen_accessor_list)
;
acc_limit
- : LIMIT LEFT_PAREN INT RIGHT_PAREN
- -> ^(VT_ACCUMULATE_FUNCTION LIMIT INT)
+ : limit_key LEFT_PAREN DECIMAL RIGHT_PAREN
+ -> ^(VT_ACCUMULATE_FUNCTION limit_key DECIMAL)
;
accumulate_iteration
- : INIT pc1=accumulate_paren_chunk COMMA?
- ACTION pc2=accumulate_paren_chunk COMMA?
- REVERSE pc3=accumulate_paren_chunk COMMA?
- RESULT pc4=accumulate_paren_chunk COMMA?
+ : init_key pc1=accumulate_paren_chunk COMMA?
+ action_key pc2=accumulate_paren_chunk COMMA?
+ reverse_key pc3=accumulate_paren_chunk COMMA?
+ result_key pc4=accumulate_paren_chunk COMMA?
-> ^(VT_ACCUMULATE_ITERATION ^(VT_ACC_ITER_INIT $pc1) ^(VT_ACC_ITER_ACT $pc2) ^(VT_ACC_ITER_REV $pc3)? ^(VT_ACC_ITER_RES $pc4))
;
@@ -2231,31 +1020,15 @@
;
-/******************************************* QUICK OBJS **********************/
-ordered_object_literal
- : DOUBLE_SQUARE_LEFT
- method_args
- DOUBLE_SQUARE_RIGHT
- -> ^(VT_NEW_OBJ ^(VT_ARGS method_args))
- ;
-ordered_obj_pattern
- : DOUBLE_SQUARE_LEFT
- positional_constraints
- DOUBLE_SQUARE_RIGHT
- -> ^(VT_AND positional_constraints)
- ;
-/*************************************************** QUERIES ******************************************/
-
-
-query //TODO
- : QUERY ID parameters?
+query
+ : query_key ID parameters?
query_body+
- END
- -> ^(QUERY ID parameters? ^(VT_AND_IMPLICIT query_body+) )
+ end_key
+ -> ^(query_key ID parameters? ^(VT_AND_IMPLICIT query_body+) )
;
query_body
@@ -2265,8 +1038,14 @@
lhs_query
- : QUESTION_MARK ID LEFT_PAREN positional_constraints? RIGHT_PAREN query_attributes? from?
- -> ^(VT_QUERY_PATTERN ID query_attributes? positional_constraints? from?)
+ : QUESTION_MARK ID LEFT_PAREN
+ positional_constraints?
+ RIGHT_PAREN query_attributes? from?
+ -> ^(VT_QUERY_PATTERN ID
+ query_attributes?
+ positional_constraints?
+ from?
+ )
;
@@ -2274,15 +1053,17 @@
-/*************************************** QUANTIFIERS AND EVALUATORS ***********************************/
+
+
+
inner_quantifier
- : ONLY -> VT_FORALL
- | SOME -> VT_EXISTS
- | VALUE -> VT_VALUE
- | COUNT (AT LEFT_SQUARE
+ : (only_key | all_key) -> VT_FORALL
+ | some_key -> VT_EXISTS
+ | value_key -> VT_VALUE
+ | count_key (AT LEFT_SQUARE
(
- val=INT
+ val=DECIMAL
| inner_attrs
)
RIGHT_SQUARE)
@@ -2290,27 +1071,9 @@
-> ^(VT_COUNT inner_attrs )
;
-attr_min
- : (MIN EQUALS INT)
- -> ^(VT_MIN INT)
- ;
-attr_max
- : (MAX EQUALS INT)
- -> ^(VT_MAX INT)
- ;
-
-inner_attrs
- : inner_attr (COMMA! inner_attr)?
- ;
-inner_attr
- :
- attr_min
- | attr_max
- ;
-
evaluator
: (TILDE!)?
(
@@ -2318,8 +1081,7 @@
| complex_evaluator
| custom_evaluator
// TODO : | temporal_evaluator
- )
-
+ )
;
simple_evaluator
@@ -2332,42 +1094,42 @@
;
complex_evaluator
- : IN
- | CONTAINS
+ : in_key
+ | contains_key
;
custom_evaluator
- : ID square_chunk? //TODO: [] is for backward compat.
+ : ID
;
-/******************************** VARIOUS OPERATORS *************************************/
+
imply_connective
- : IMPLIES
+ : implies_key
-> ^(VT_IMPLIES)
;
or_connective
- : OR
+ : or_key
-> ^(VT_OR)
;
and_connective
- : AND
+ : and_key
-> ^(VT_AND)
;
xor_connective
- : XOR
+ : xor_key
-> ^(VT_XOR)
;
eq_connective
- : EQUIV
+ : equiv_key
-> ^(VT_EQUIV)
;
@@ -2388,7 +1150,7 @@
;
xor_symbol
- : DOUBLE_PLUS
+ : DOUBLE_ANG
-> ^(VT_XOR)
;
@@ -2399,37 +1161,40 @@
unary_operator
- : NEG
+ : neg_key
-> ^(VT_NEG)
| hedge^
;
hedge
- : VERY
+ : very_key
-> ^(VT_HEDGE_VERY)
- | MOL
+ | mol_key
-> ^(VT_HEDGE_VERY)
;
-/********************************************************* RHS STRUCTURE ****************************************************************/
+
+
then_part
:
- rhs_structured
- // | rhs_chunk
- // -> ^(VT_RHS rhs_chunk)
+ (then_key) => rhs_then
+ | (do_key) => rhs_do
;
-
-rhs_structured
- : THEN then? (CLOSURE closure)? END
+
+rhs_then
+ : then_key then? (closure_key closure)? end_key
-> ^(VT_RHS then? closure?)
-
- | DO! LEFT_CURLY! rhs_atom* RIGHT_CURLY!
;
+
+rhs_do
+ : do_key LEFT_CURLY rhs_atom* RIGHT_CURLY
+ -> ^(VT_RHS ^(VT_THEN rhs_atom+) )
+ ;
then
: rhs_atom+
@@ -2454,17 +1219,17 @@
;
rhs_insert
- : INSERT^ literal_object
+ : insert_key^ literal_object
SEMICOLON!
;
rhs_insert_logical
- : INSERT_LOG^ literal_object
+ : insertLogical_key^ literal_object
SEMICOLON!
;
rhs_retract
- : RETRACT^
+ : retract_key^
( literal_object
| var
)
@@ -2472,7 +1237,7 @@
;
rhs_retract_logical
- : RETRACT_LOG^
+ : retractLogical_key^
( literal_object
| var
)
@@ -2480,13 +1245,13 @@
;
rhs_update
- : UPDATE^
+ : update_key^
var
SEMICOLON!
;
rhs_modify
- : MODIFY^ LEFT_PAREN! var RIGHT_PAREN!
+ : modify_key^ LEFT_PAREN! var RIGHT_PAREN!
LEFT_CURLY!
set_action+
RIGHT_CURLY!
@@ -2494,7 +1259,7 @@
;
rhs_modify_logical
- : MODIFY_LOG^ LEFT_PAREN! var RIGHT_PAREN!
+ : modifyLogical_key^ LEFT_PAREN! var RIGHT_PAREN!
LEFT_CURLY!
set_action+
RIGHT_CURLY!
@@ -2502,8 +1267,12 @@
;
set_action
- : accessor_path EQUALS right_expression SEMICOLON
- -> ^(VT_SET accessor_path right_expression)
+ : accessor_path EQUALS
+ right_expression
+ SEMICOLON
+ -> ^(VT_SET accessor_path
+ right_expression
+ )
;
@@ -2514,19 +1283,19 @@
:
LESS_PERCENT rc=side_effect_chunk {text = $rc.text;} PERCENT_GREATER
-> VT_RHS_CHUNK[$rc.start,text]
- | LESS dialect PERCENT
+ | LESS dialect MOD
rc=side_effect_chunk {text = $rc.text;}
PERCENT_GREATER
-> ^(VT_DIALECT dialect VT_RHS_CHUNK[$rc.start,text])
;
dialect
- : JAVA
- | MVEL
+ : java_key
+ | mvel_key
;
side_effect_chunk
- : ~ ( END | (PERCENT_GREATER) )*
+ : ~ ( PERCENT_GREATER )*
;
@@ -2538,25 +1307,24 @@
-/***************************************************************** CHUNKS *********************************************************************/
-
+/*
rhs_chunk
@init{
String text = "";
-} : THEN
+} : then_key
rc=rhs_chunk_data {text = $rc.text;}
- END
+ end_key
SEMICOLON?
-> VT_RHS_CHUNK[$rc.start,text]
;
rhs_chunk_data
:
- ~END*
+ ~'end'*
;
+*/
-
@@ -2611,3 +1379,930 @@
rc1=RIGHT_PAREN
;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// --------------------------------------------------------
+// GENERAL RULES
+// --------------------------------------------------------
+
+
+
+literal
+ : STRING m=msr_unit?
+ -> {m==null}? STRING
+ -> ^(VT_MSR STRING $m)
+ | DECIMAL m=msr_unit?
+ -> {m==null}? DECIMAL
+ -> ^(VT_MSR DECIMAL $m)
+ | FLOAT m=msr_unit?
+ -> {m==null}? FLOAT
+ -> ^(VT_MSR FLOAT $m)
+ | HEX
+ | OCTAL
+ | BOOL
+ | null_key
+ | literal_object
+ | list_literal
+ ;
+
+
+typeList
+ : data_type (COMMA data_type)*
+ ;
+
+// // helper.validateLT(2, "-")
+//type
+//options { backtrack=true; memoize=true; k=*; }
+// : (primitiveType) => ( primitiveType (LEFT_SQUARE RIGHT_SQUARE)* )
+// | ( ID (typeArguments)? (DOT ID (typeArguments)? )* (LEFT_SQUARE RIGHT_SQUARE)* )
+// ;
+
+
+typeArguments
+ : LESS typeArgument (COMMA typeArgument)* GREATER
+ ;
+
+typeArgument
+ : data_type
+ | QUESTION_MARK ((extends_key | super_key) data_type)?
+ ;
+
+parameters
+ : LEFT_PAREN { helper.emit($LEFT_PAREN, DroolsEditorType.SYMBOL); }
+ ( param_definition (COMMA { helper.emit($COMMA, DroolsEditorType.SYMBOL); } param_definition)* )?
+ RIGHT_PAREN { helper.emit($RIGHT_PAREN, DroolsEditorType.SYMBOL); }
+ -> ^(VT_PARAM_LIST param_definition* )
+ ;
+
+param_definition
+ : data_type argument
+ -> ^(VT_PARAM data_type argument)
+ ;
+
+argument
+ : ID { helper.emit($ID, DroolsEditorType.IDENTIFIER); }
+ dimension_definition*
+ ;
+
+string_list
+ at init {
+ StringBuilder buf = new StringBuilder();
+}
+ : first=STRING { buf.append( "[ "+ $first.text ); }
+ (COMMA next=STRING { buf.append( ", " + $next.text ); } )*
+ -> STRING[$first,buf.toString()+" ]"]
+ ;
+
+
+
+
+primitiveType
+ : boolean_key
+ | char_key
+ | byte_key
+ | short_key
+ | int_key
+ | long_key
+ | float_key
+ | double_key
+ ;
+
+data_type returns [int dim]
+ at init{
+ $dim=0;
+}
+ : (procedural_name) (dimension_definition {$dim++;})*
+ -> ^(VT_DATA_TYPE VT_DIM_SIZE[$start,""+$dim] procedural_name? )
+ ;
+dimension_definition
+ : LEFT_SQUARE RIGHT_SQUARE
+ ;
+
+
+
+
+
+
+iri
+ : (semantic_name) => semantic_name -> ^(VT_IRI semantic_name)
+ | simple_name -> ^(VT_IRI simple_name)
+ ;
+
+
+nodeID
+ : BLANK_ID
+ ;
+
+full_iri
+ : LESS!
+ any_iri
+ //TODO : full iri syntax
+ GREATER!
+ ;
+
+
+any_iri
+ at init{
+ String text = "";
+} : cc=any_iri_content {text = $cc.text;}
+ -> ^(VT_PAREN_CHUNK[$cc.start,text])
+ ;
+
+any_iri_content
+ : (~ (GREATER | SLASH) | SLASH)*
+ ;
+
+
+/*********************************************
+* ATOMIC DATA DEFINITIONS
+************************************************/
+
+
+
+procedural_name
+ : fully_qualified_name
+ | simple_name
+ ;
+
+semantic_name
+ : prefixed_name
+ | empty_prefix_name
+ | full_iri
+ ;
+
+
+/*
+prefixed_name
+ : {prefixes.contains(input.LT(1))}?=> pref=ID COLON nam=ID
+ -> ^(VT_IRI $pref? $nam)
+ | COLON nam=ID
+ -> ^(VT_IRI STRING["EMPTY_NS"] $nam)
+ ;
+*/
+
+prefixed_name
+ : pref=ID COLON nam=ID
+ {$prefixed_name.text.equals($pref.text+":"+$nam.text)}?
+ -> ^(VT_IRI $pref? $nam)
+ ;
+
+empty_prefix_name
+ : COLON nam=ID
+ -> ^(VT_IRI $nam)
+ ;
+
+fully_qualified_name
+ : (ID DOT)+
+ ( (primitiveType) => primitiveType
+ | ID
+ )
+ ;
+
+simple_name
+ : primitiveType
+ | ID
+ ;
+
+
+
+gen_accessor_list
+ : first=general_accessor_path (COMMA next=general_accessor_path)*
+ -> ^(VT_LIST general_accessor_path+)
+ ;
+
+literal_list
+ : first=literal (COMMA next=literal)*
+ -> ^(VT_LIST literal+)
+ ;
+
+var_list
+ : first=VAR (COMMA next=VAR)*
+ -> ^(VT_LIST VAR+)
+ ;
+
+members_list
+ : (literal|var_literal) (COMMA! (literal|var_literal))*
+ ;
+
+integer_range
+ : DECIMAL DOUBLE_DOT DECIMAL
+ -> ^(VT_RANGE DECIMAL DECIMAL)
+ ;
+
+list_literal
+ : LEFT_CURLY members_list? RIGHT_CURLY
+ ->^(VT_LIST members_list?)
+ ;
+
+
+
+var
+ : VAR
+ ;
+
+
+var_literal
+ : VAR m=msr_unit?
+ -> {m==null}? VAR
+ -> ^(VT_MSR VAR $m)
+ ;
+
+label
+ : var COLON!
+ ;
+
+msr_unit
+ : (GATE! (simple_name))+
+ | (DOUBLE_CAP! (semantic_name))+
+ ;
+
+
+
+
+
+
+
+
+literal_object
+ : new_object
+ | ordered_object_literal
+ ;
+
+new_object
+ : (new_key) => new_key procedural_name LEFT_PAREN literal_object_args? RIGHT_PAREN
+ -> ^(VT_NEW_OBJ ^(VT_TYPE procedural_name) ^(VT_ARGS literal_object_args)?)
+ ;
+
+literal_object_args
+ : method_args
+ ;
+
+
+time_string
+ : STRING m=msr_unit?
+ -> {m==null}? STRING
+ -> ^(VT_MSR STRING $m)
+ ;
+
+/******************************************* QUICK OBJS **********************/
+
+
+ordered_object_literal
+ : DOUBLE_SQUARE_LEFT
+ method_args
+ DOUBLE_SQUARE_RIGHT
+ -> ^(VT_NEW_OBJ ^(VT_ARGS method_args))
+ ;
+
+ordered_obj_pattern
+ : DOUBLE_SQUARE_LEFT
+ positional_constraints
+ DOUBLE_SQUARE_RIGHT
+ -> ^(VT_PATTERN ^(VT_AND ^(VT_AND positional_constraints)))
+ ;
+
+method_args
+ : method_arg (COMMA! method_arg)*
+ ;
+
+
+method_arg
+ : expr_root
+ ;
+
+method
+ : core=method_core m=msr_unit?
+ -> {m==null}? $core
+ -> ^(VT_MSR $core $m)
+ ;
+
+method_core
+ : ID LEFT_PAREN args=method_args? RIGHT_PAREN
+ -> {args==null}? ^(VT_METHOD ID )
+ -> ^(VT_METHOD ID ^(VT_ARGS method_args?))
+ ;
+
+
+
+
+
+
+
+
+
+// --------------------------------------------------------
+// EXPRESSIONS
+// --------------------------------------------------------
+
+
+
+
+
+/*
+expr_root
+ : additiveExpression
+ ;
+*/
+
+
+expr_root
+ : factor ( (PLUS | MINUS)^ factor )*
+ ;
+
+
+
+
+factor
+ : term ( (TIMES | SLASH)^ term )*
+ ;
+
+term
+ : (MINUS^)? expr_unary
+ ;
+
+expr_unary
+ : expr_atom
+ | LEFT_PAREN! expr_root RIGHT_PAREN!
+ ;
+
+
+expr_atom
+ : var_literal
+ | literal
+ | accessor_path
+ ;
+
+
+
+
+
+
+
+
+
+
+/*
+
+expression
+ : conditionalExpression ((assignmentOperator) => assignmentOperator expression)?
+ ;
+
+conditionalExpression
+ : conditionalOrExpression ( QUESTION_MARK expression COLON expression )?
+ ;
+conditionalOrExpression
+ : conditionalAndExpression ( DOUBLE_PIPE conditionalAndExpression )*
+ ;
+
+conditionalAndExpression
+ : inclusiveOrExpression ( DOUBLE_AMPER inclusiveOrExpression )*
+ ;
+
+inclusiveOrExpression
+ : exclusiveOrExpression ( PIPE exclusiveOrExpression )*
+ ;
+
+exclusiveOrExpression
+ : andExpression ( XOR andExpression )*
+ ;
+
+andExpression
+ : equalityExpression ( AMPER equalityExpression )*
+ ;
+
+equalityExpression
+ : instanceOfExpression ( ( EQUALS | NOT_EQUAL ) instanceOfExpression )*
+ ;
+
+instanceOfExpression
+ : relationalExpression (instanceof_key data_type)?
+ ;
+
+relationalExpression
+ : shiftExpression ( relationalOp shiftExpression )*
+ ;
+
+relationalOp
+ : (LESS_EQUAL| GREATER_EQUAL | LESS | GREATER)
+ ;
+
+shiftExpression
+ : additiveExpression ( shiftOp additiveExpression )*
+ ;
+
+shiftOp
+ : (DOUBLE_LESS | TRIPLE_GREATER | DOUBLE_GREATER )
+ ;
+
+additiveExpression
+ : multiplicativeExpression ( (PLUS | MINUS) multiplicativeExpression )*
+ ;
+
+multiplicativeExpression
+ : unaryExpression ( ( TIMES | SLASH | MOD ) unaryExpression )*
+ ;
+
+unaryExpression
+ : PLUS unaryExpression
+ | MINUS unaryExpression
+ | DOUBLE_PLUS primary
+ | DOUBLE_MINUS primary
+ | unaryExpressionNotPlusMinus
+ ;
+
+unaryExpressionNotPlusMinus
+ : TILDE unaryExpression
+ | QUESTION_MARK unaryExpression
+ | castExpression
+ | primary selector* (DOUBLE_PLUS|DOUBLE_MINUS)?
+ ;
+
+castExpression
+ : (LEFT_PAREN primitiveType) => LEFT_PAREN primitiveType RIGHT_PAREN unaryExpression
+ | (LEFT_PAREN data_type) => LEFT_PAREN data_type RIGHT_PAREN unaryExpressionNotPlusMinus
+ | LEFT_PAREN expression RIGHT_PAREN unaryExpressionNotPlusMinus
+ ;
+
+
+
+primary
+ : // accessor_path
+ | parExpression
+ | nonWildcardTypeArguments (explicitGenericInvocationSuffix | this_key arguments)
+ | literal
+ | var_literal
+ | this_key ({!helper.validateSpecialID(2)}?=> DOT ID)* ({helper.validateIdentifierSufix()}?=> identifierSuffix)?
+ | super_key superSuffix
+ | new_key creator
+ | primitiveType (LEFT_SQUARE RIGHT_SQUARE)* DOT class_key
+ | void_key DOT class_key
+| ID ({!helper.validateSpecialID(2)}?=> DOT ID)* ({helper.validateIdentifierSufix()}?=> identifierSuffix)?
+ ;
+
+
+parExpression
+ : LEFT_PAREN expression RIGHT_PAREN
+ ;
+
+identifierSuffix
+options { backtrack=true; memoize=true; }
+ : (LEFT_SQUARE RIGHT_SQUARE)+ DOT class_key
+ | ((LEFT_SQUARE) => LEFT_SQUARE expression RIGHT_SQUARE)+ // can also be matched by selector, but do here
+ | arguments
+ | DOT class_key
+ | DOT explicitGenericInvocation
+ | DOT this_key
+ | DOT super_key arguments
+ | DOT new_key (nonWildcardTypeArguments)? innerCreator
+ ;
+
+creator
+ : nonWildcardTypeArguments? createdName
+ (arrayCreatorRest | classCreatorRest)
+ ;
+
+createdName
+ : ID typeArguments?
+ ( DOT ID typeArguments?)*
+ | primitiveType
+ ;
+
+innerCreator
+ : {!(helper.validateIdentifierKey(DroolsSoftKeywords.INSTANCEOF))}?=> ID classCreatorRest
+ ;
+
+arrayCreatorRest
+ : LEFT_SQUARE
+ ( RIGHT_SQUARE (LEFT_SQUARE RIGHT_SQUARE)* arrayInitializer
+ | expression RIGHT_SQUARE ({!helper.validateLT(2,"]")}?=>LEFT_SQUARE expression RIGHT_SQUARE)* ((LEFT_SQUARE RIGHT_SQUARE)=> LEFT_SQUARE RIGHT_SQUARE)*
+ )
+ ;
+
+variableInitializer
+options{ backtrack=true; memoize=true; }
+ : arrayInitializer
+ | expression
+ ;
+
+arrayInitializer
+ : LEFT_CURLY (variableInitializer (COMMA variableInitializer)* (COMMA)? )? RIGHT_CURLY
+ ;
+
+classCreatorRest
+ : arguments
+ ;
+
+explicitGenericInvocation
+ : nonWildcardTypeArguments arguments
+ ;
+
+nonWildcardTypeArguments
+ : LESS typeList GREATER
+ ;
+
+explicitGenericInvocationSuffix
+ : super_key superSuffix
+ | ID arguments
+ ;
+
+selector
+options { backtrack=true; memoize=true; }
+ : DOT ID ((LEFT_PAREN) => arguments)?
+ | DOT this_key
+ | DOT super_key superSuffix
+ | DOT new_key (nonWildcardTypeArguments)? innerCreator
+ | LEFT_SQUARE expression RIGHT_SQUARE
+ ;
+
+superSuffix
+ : arguments
+ | DOT ID ((LEFT_PAREN) => arguments)?
+ ;
+
+arguments
+ : LEFT_PAREN expressionList? RIGHT_PAREN
+ ;
+
+expressionList
+ : expression (COMMA expression)*
+ ;
+
+assignmentOperator
+options { k=1; }
+ : EQUAL
+ | PLUS_ASSIGN
+ | MINUS_ASSIGN
+ | MULT_ASSIGN
+ | DIV_ASSIGN
+ | AND_ASSIGN
+ | OR_ASSIGN
+ | XOR_ASSIGN
+ | MOD_ASSIGN
+ | DOUBLE_LESS EQUAL
+ | DOUBLE_GREATER EQUAL
+ | TRIPLE_GREATER EQUAL
+ ;
+
+*/
+
+
+
+
+
+//****************************************************+
+// rule attributes
+//******************************************************
+
+
+rule_attributes
+ : AT {System.out.println("Look for rule attr");}
+ rule_attribute ( COMMA? AT rule_attribute)*
+ -> ^(VT_ATTRIBUTES rule_attribute+)
+ ;
+
+rule_attribute
+ : ra_salience
+ | ra_agenda_group
+ | ra_timer
+ | ra_activation_group
+ | ra_auto_focus
+ | ra_date_effective
+ | ra_date_expires
+ | ra_enabled
+ | ra_ruleflow_group
+ | ra_lock_on_active
+ | ra_dialect
+ | ra_calendars
+ | ra_defeats
+ | ra_deductive
+ | ra_abductive
+ | ra_equivalence
+ | ra_no_loop
+ ;
+
+ra_date_effective
+ : ra_date_effective_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+ra_date_expires
+ : ra_date_expires_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+ra_enabled
+ : ra_enabled_key^
+ LEFT_PAREN! BOOL RIGHT_PAREN!
+ ;
+
+ra_salience
+ : ra_salience_key^
+ LEFT_PAREN! DECIMAL RIGHT_PAREN!
+ ;
+
+ra_no_loop
+ : ra_no_loop_key^ LEFT_PAREN! BOOL RIGHT_PAREN!
+ ;
+
+ra_auto_focus
+ : ra_auto_focus_key^ LEFT_PAREN! BOOL RIGHT_PAREN!
+ ;
+
+ra_activation_group
+ : ra_activation_group_key^ (LEFT_PAREN! STRING RIGHT_PAREN!)
+ ;
+
+ra_ruleflow_group
+ : ra_ruleflow_group_key^ (LEFT_PAREN! STRING RIGHT_PAREN!)
+ ;
+
+ra_agenda_group
+ : ra_agenda_group_key^ (LEFT_PAREN! STRING RIGHT_PAREN!)
+ ;
+
+ra_timer
+ : (ra_duration_key^| ra_timer_key^)
+ LEFT_PAREN! DECIMAL RIGHT_PAREN!
+ ;
+
+ra_calendars
+ : ra_calendar_key^ LEFT_PAREN! literal_list RIGHT_PAREN!
+ ;
+
+
+ra_dialect
+ : ra_dialect_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+ra_lock_on_active
+ : ra_lock_on_active_key^ LEFT_PAREN! BOOL RIGHT_PAREN!
+ ;
+
+ra_deductive
+ : ra_deductive_key
+ ;
+
+ra_abductive
+ : ra_abductive_key
+ ;
+
+ra_equivalence
+ : ra_equivalence_key
+ ;
+
+ra_defeats
+ : ra_defeats_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+
+
+
+//****************************************************+
+// operator attributes
+//******************************************************
+
+
+
+
+
+
+operator_attributes
+ : (AT single_operator_attribute)+
+ -> ^(VT_ATTRIBUTES single_operator_attribute+)
+ | AT LEFT_SQUARE single_operator_attribute (COMMA single_operator_attribute)* RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES single_operator_attribute+)
+ ;
+
+
+single_operator_attribute
+ : oa_kind
+ | oa_id
+ | oa_params
+ | oa_degree
+ | oa_merge
+ | oa_missing
+ | oa_defeat
+ | oa_default
+ | oa_crisp
+ | oa_otherwise
+ ;
+
+oa_kind
+ : oa_kind_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_id
+ : oa_id_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_params
+ : oa_params_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_degree
+ : oa_degree_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_crisp
+ : oa_crisp_key^
+ ;
+
+oa_merge
+ : oa_merge_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_missing
+ : oa_missing_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+oa_defeat
+ : oa_defeat_key^
+ ;
+
+oa_default
+ : oa_default_key^
+ ;
+
+oa_otherwise
+ : oa_otherwise_key^ LEFT_PAREN! STRING RIGHT_PAREN!
+ ;
+
+
+
+
+
+//****************************************************+
+// pattern attributes
+//******************************************************
+
+
+
+
+pattern_attributes
+ : (AT single_pattern_attribute)+
+ -> ^(VT_ATTRIBUTES single_pattern_attribute+)
+ | AT LEFT_SQUARE single_pattern_attribute (COMMA single_pattern_attribute)* RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES single_pattern_attribute+)
+ ;
+
+single_pattern_attribute
+ : single_operator_attribute
+ | pa_onChange
+ ;
+
+pa_onChange
+ : onChange_key^ LEFT_PAREN!
+ (
+ TIMES (COMMA! NEG_MARK! ID)*
+ | ID (COMMA! ID)*
+ )
+ RIGHT_PAREN!
+ ;
+
+
+
+
+//****************************************************+
+// query attributes
+//******************************************************
+
+
+
+
+query_attributes
+ : (AT single_query_attribute)+
+ -> ^(VT_ATTRIBUTES single_query_attribute+)
+ | AT LEFT_SQUARE single_query_attribute (COMMA single_query_attribute)* RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES single_query_attribute+)
+ ;
+
+single_query_attribute
+ :
+ ;
+
+
+
+
+//****************************************************+
+// event sequence attributes
+//******************************************************
+
+
+
+
+trail_attributes
+ : (AT single_trail_attribute)+
+ -> ^(VT_ATTRIBUTES single_trail_attribute+)
+ | AT LEFT_SQUARE single_trail_attribute (COMMA single_trail_attribute)* RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES single_trail_attribute+)
+ ;
+
+single_trail_attribute
+ : ta_trail_start
+ | ta_trail_end
+ ;
+
+ta_trail_start
+ : start_key
+ ;
+
+ta_trail_end
+ : end_key
+ ;
+
+
+
+
+
+//****************************************************+
+// inner quantifier attributes
+//******************************************************
+
+
+
+
+attr_min
+ : (min_key EQUALS DECIMAL)
+ -> ^(VT_MIN DECIMAL)
+ ;
+
+attr_max
+ : (max_key EQUALS DECIMAL)
+ -> ^(VT_MAX DECIMAL)
+ ;
+
+inner_attrs
+ : attr_min (COMMA! attr_max)?
+ | attr_max (COMMA! attr_min)?
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Added: labs/jbossrules/branches/DRLv6/src/main/resources/Manchester.g
===================================================================
--- labs/jbossrules/branches/DRLv6/src/main/resources/Manchester.g (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/main/resources/Manchester.g 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,735 @@
+parser grammar Manchester;
+
+
+
+ at members {
+
+ private Set prefixes = null;
+ public void setPrefixSet( Set ps ) { this.prefixes = ps; }
+
+ private ParserHelper helper = null;
+ public void setParserHelper( ParserHelper helper ) { this.helper = helper; }
+ public void reportError(RecognitionException ex) { helper.reportError( ex ); }
+
+ private Tree curField;
+}
+
+
+//******************************************************************
+// MANCHESTER SYNTAX
+//******************************************************************
+
+
+manDL_ontology
+options{
+ k=5;
+}
+ :
+ manDL_prefix*
+ ontology_key COLON (nam=iri ver=iri?)?
+ manDL_inport*
+ ((AT? annotations_key) => manDL_annotations)?
+ manDL_type_declaration*
+ -> ^(VT_ONTOLOGY ^(VT_NAME $nam? $ver?)
+ manDL_prefix*
+ manDL_inport*
+ manDL_annotations?
+ manDL_type_declaration*
+ )
+ ;
+
+
+manDL_inport // :)
+ : import_key COLON iri
+ -> ^(VT_IMPORT iri)
+ ;
+
+
+
+manDL_prefix
+ : (prefix_key | namespace_key) COLON pref=ID COLON? full_iri
+ { prefixes.add($pref.text); }
+ -> ^(VT_PREFIX ID full_iri)
+ ;
+
+
+
+manDL_annotations
+ : annotations_key COLON manDL_annotation_list
+ -> ^(VT_ANNOTATIONS manDL_annotation_list)
+ ;
+
+manDL_annotation_list
+ : manDL_annotation (COMMA! manDL_annotation)*
+ ;
+
+manDL_annotation
+ : manDL_annotations? manDL_annotationPropertyIRI manDL_annotation_target
+ -> ^(VT_ANNOTATION manDL_annotations? manDL_annotationPropertyIRI manDL_annotation_target )
+ ;
+
+manDL_annotation_target
+ : manDL_individual | literal
+ ;
+
+
+
+manDL_type_declaration
+options{
+ backtrack=true;
+}
+ : manDL_datatype_def
+ | manDL_class
+ | manDL_objectProperty
+ | manDL_dataProperty
+ | manDL_annotationProperty
+ | manDL_namedIndividual
+ | manDL_misc
+ ;
+
+
+
+
+
+
+
+
+manDL_class
+scope{
+ CommonTree keys;
+}
+ at init{
+ ((manDL_class_scope) manDL_class_stack.peek()).keys = new CommonTree(new CommonToken(DRLv6Lexer.VT_KEYS,"VT_KEYS"));
+}
+ at after{
+ retval.tree.addChild(((manDL_class_scope) manDL_class_stack.peek()).keys);
+}
+ :
+
+ ( (AT typ=classevent_key)? declare_key
+ | typ=classevent_key COLON )
+
+ iri
+ manDL_class_frame*
+ manDL_decl_fields?
+ end_key?
+ -> {typ!=null}? ^(VT_TYPE_DECLARE
+ ^(VT_ENTITY_TYPE[$typ.text])
+ ^(VT_TYPE_DECLARE_ID iri)
+ manDL_class_frame* manDL_decl_fields?)
+ -> ^(VT_TYPE_DECLARE
+ ^(VT_ENTITY_TYPE["Class"])
+ ^(VT_TYPE_DECLARE_ID iri)
+ manDL_class_frame*
+ manDL_decl_fields?)
+
+ ;
+
+classevent_key
+ : class_key
+ | event_key
+ ;
+
+
+manDL_decl_fields
+ : manDL_decl_field more=manDL_decl_field*
+ -> ^(VT_EQUIVALENTTO ^(VT_DL_DEFINITION ^(VT_AND manDL_decl_field+)))
+ ;
+
+
+manDL_decl_field
+ : manDL_field^ manDL_decl_field_attributes? SEMICOLON!
+ ;
+
+manDL_field
+ : (manDL_property_expression COLON) => manDL_property_expression COLON manDL_data_type_restriction
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MIN DECIMAL["1"]) ^(VT_MAX DECIMAL["1"]) manDL_data_type_restriction)
+ | manDL_quantified_restriction_core
+ -> manDL_quantified_restriction_core
+ ;
+
+
+manDL_decl_field_attributes
+ :
+ AT LEFT_SQUARE
+ manDL_decl_field_attribute (COMMA manDL_decl_field_attribute)*
+ RIGHT_SQUARE
+ -> ^(VT_ATTRIBUTES manDL_decl_field_attribute+)
+ | ( AT manDL_decl_field_attribute )+
+ -> ^(VT_ATTRIBUTES manDL_decl_field_attribute+)
+ ;
+
+manDL_decl_field_attribute
+ :
+ key_key
+ {
+ if ($manDL_class::keys != null)
+ $manDL_class::keys.addChild(curField);
+ }
+ ;
+
+
+
+
+
+
+
+
+
+manDL_class_frame
+ : (annotations_key) => manDL_annotations
+ | (disjointUnionOf_key) => manDL_disjointUnionOf
+ | (disjointWith_key) => manDL_disjointWith
+ | (as_key | equivalentTo_key) => manDL_equivalentTo
+ | (subClassOf_key) => manDL_subClassOf
+ | (hasKey_key) => manDL_hasKey ->
+ ;
+
+
+
+manDL_disjointUnionOf
+ : disjointUnionOf_key COLON manDL_disjointUnionOf_list
+ -> ^(VT_DISJOINTUNIONOF manDL_disjointUnionOf_list)
+ ;
+
+manDL_disjointUnionOf_list
+ : manDL_annotated_description (COMMA! manDL_annotated_description)+
+ ;
+
+manDL_disjointWith
+ : disjointWith_key COLON manDL_annotated_description_list
+ -> ^(VT_DISJOINTWITH manDL_annotated_description_list)
+ ;
+
+manDL_equivalentTo
+ : ( as_key | equivalentTo_key COLON) manDL_annotated_description_list
+ -> ^(VT_EQUIVALENTTO manDL_annotated_description_list)
+ ;
+
+manDL_subClassOf
+ : subClassOf_key COLON manDL_annotated_description_list
+ -> ^(VT_SUBCLASSOF manDL_annotated_description_list)
+ ;
+
+manDL_hasKey
+ at after{
+ ((manDL_class_scope) manDL_class_stack.peek()).keys.addChildren(retval.tree.getChildren());
+}
+ : hasKey_key^ COLON! manDL_annotations? manDL_property_expression (COMMA! manDL_property_expression)*
+
+ ;
+
+
+
+
+
+
+manDL_annotated_description_list
+ : manDL_annotated_description (COMMA! manDL_annotated_description)*
+ ;
+
+
+manDL_annotated_description
+ : manDL_annotations? manDL_description
+ -> ^(VT_DL_DEFINITION manDL_annotations? manDL_description)
+ ;
+
+
+
+manDL_description
+ : manDL_conjunction ( (or_key manDL_primary) => or=or_key manDL_conjunction)*
+ -> {or==null}? manDL_conjunction
+ -> ^(VT_OR manDL_conjunction+)
+ ;
+
+manDL_conjunction
+ : (manDL_classIRI that_key) => manDL_classIRI that_key manDL_restriction (and_key manDL_restriction)*
+ -> ^(VT_AND ^(VT_DL_TYPE manDL_classIRI) manDL_restriction+)
+
+ | manDL_primary ( (and_key manDL_primary) => and=and_key manDL_primary)*
+ -> {and==null}? manDL_primary
+ -> ^(VT_AND manDL_primary+)
+ ;
+
+
+manDL_primary
+options{
+ backtrack=true;
+}
+ : manDL_restriction
+ | manDL_atomic
+ ;
+
+manDL_atomic
+ : not=not_key? manDL_atomic_core
+ -> {not!=null}? ^(VT_NEG manDL_atomic_core)
+ -> manDL_atomic_core
+ ;
+
+manDL_atomic_core
+ : LEFT_CURLY! literal_list RIGHT_CURLY!
+ | manDL_data_type_restriction
+ -> manDL_data_type_restriction
+ | LEFT_PAREN! manDL_description RIGHT_PAREN!
+ ;
+
+manDL_restriction
+ : not=not_key? manDL_quantified_restriction_core
+ -> {not!=null}? ^(VT_NEG manDL_quantified_restriction_core)
+ -> manDL_quantified_restriction_core
+ ;
+
+
+manDL_quantified_restriction_core
+ : p=manDL_property_expression {curField = $p.tree;}
+ ( (some_key) => some_key manDL_primary
+ -> ^(VT_EXISTS manDL_property_expression manDL_primary)
+ | (only_key) => only_key manDL_primary
+ -> ^(VT_FORALL manDL_property_expression manDL_primary)
+ | (all_key) => all_key manDL_primary
+ -> ^(VT_FORALL manDL_property_expression manDL_primary)
+ | (value_key) => value_key (manDL_individual | literal)
+ -> ^(VT_VALUE manDL_property_expression manDL_individual? literal?)
+ | (self_key) => self_key
+ -> ^(self_key manDL_property_expression)
+ | (min_key) => min_key DECIMAL
+ ((and_key) =>
+ | (or_key) =>
+ | (manDL_primary) => manDL_primary)?
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MIN DECIMAL) manDL_primary?)
+ | (max_key) => max_key DECIMAL
+ ((and_key) =>
+ | (or_key) =>
+ | (manDL_primary) => manDL_primary)?
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MAX DECIMAL) manDL_primary?)
+
+ | (exactly_key) => exactly_key DECIMAL
+ ((and_key) =>
+ | (or_key) =>
+ | (manDL_primary) => manDL_primary)?
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MIN DECIMAL) ^(VT_MAX DECIMAL) manDL_primary?)
+
+
+ | (manDL_data_type_restriction) => manDL_data_type_restriction
+ -> ^(VT_COUNT manDL_property_expression ^(VT_MIN DECIMAL["1"]) ^(VT_MAX DECIMAL["1"]) manDL_data_type_restriction)
+ )
+ ;
+
+manDL_data_type_restriction
+ : manDL_data_type (LEFT_SQUARE fac=manDL_facets RIGHT_SQUARE)?
+ -> {fac!=null}? ^(VT_DL_RESTRICTED_TYPE manDL_data_type manDL_facets)
+ -> ^(VT_DL_TYPE manDL_data_type)
+ ;
+
+
+manDL_facets
+ : manDL_facet manDL_restriction_value more=(COMMA manDL_facet manDL_restriction_value)*
+ -> {more==null}? ^(VT_DL_RESTRICTION manDL_facet manDL_restriction_value*)
+ -> ^(VT_AND ^(VT_DL_RESTRICTION manDL_facet manDL_restriction_value)+)
+ ;
+
+manDL_restriction_value
+ : literal
+ ;
+
+manDL_facet
+ : facet_length_key
+ | facet_minLength_key
+ | facet_maxLength_key
+ | facet_pattern_key
+ | facet_langPattern_key
+ | GREATER_EQUAL
+ | GREATER
+ | LESS_EQUAL
+ | LESS
+ ;
+
+
+
+
+
+
+
+
+
+
+
+manDL_datatype_def
+ : (AT typ=datatype_key declare_key
+ | typ=datatype_key COLON )
+ iri
+ manDL_datatype_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_TYPE_DECLARE_ID iri) manDL_datatype_frame*)
+ ;
+
+manDL_datatype_frame
+ : manDL_annotations
+ | manDL_equivalentTo
+ ;
+
+
+
+
+
+manDL_objectProperty
+ : ( AT typ=objectProperty_key declare_key
+ | typ=objectProperty_key COLON)
+ iri
+ qa=(manDL_quick_attributes -> ^(VT_ATTRIBUTES manDL_quick_attributes?))
+ manDL_objProp_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_TYPE_DECLARE_ID iri) $qa? manDL_objProp_frame*)
+ ;
+
+manDL_objProp_frame
+ : manDL_annotations
+ | manDL_attributes
+ | manDL_disjointWith
+ | manDL_equivalentTo
+ | manDL_inverseOf
+ | manDL_domain
+ | manDL_range
+ | manDL_subPropertyOf
+ | manDL_subPropChain
+ ;
+
+
+
+manDL_dataProperty
+ :
+ (AT typ=dataProperty_key declare_key
+ | typ=dataProperty_key COLON)
+ iri
+ qa=(manDL_quick_attributes -> ^(VT_ATTRIBUTES manDL_quick_attributes?))
+ manDL_dataProp_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_TYPE_DECLARE_ID iri) $qa? manDL_dataProp_frame*)
+ ;
+
+
+manDL_dataProp_frame
+ : manDL_annotations
+ | manDL_domain
+ | manDL_range
+ | manDL_attributes
+ | manDL_disjointWith
+ | manDL_equivalentTo
+ | manDL_subPropertyOf
+ ;
+
+
+manDL_domain
+ : domain_key COLON manDL_annotated_description_list
+ -> ^(VT_DOMAIN manDL_annotated_description_list)
+ ;
+
+manDL_range
+ : range_key COLON manDL_annotated_description_list
+ -> ^(VT_RANGE manDL_annotated_description_list)
+ ;
+
+
+
+
+
+manDL_subPropertyOf
+ : subPropertyOf_key COLON manDL_property_list
+ -> ^(VT_SUBPROPERTYOF manDL_property_list)
+ ;
+
+manDL_inverseOf
+ : inverseOf_key COLON manDL_property_list
+ -> ^(VT_INVERSEOF manDL_property_list)
+ ;
+
+manDL_subPropChain
+ : subPropertyChain_key COLON manDL_annotations? manDL_property_expression ( CHAIN_SEP manDL_property_expression )*
+ -> ^(VT_SUBPROPERTYCHAIN manDL_annotations? manDL_property_expression+)
+ ;
+
+
+
+
+
+
+
+
+manDL_annotationProperty
+ : ( AT typ=annotationProperty_key declare_key
+ | typ=annotationProperty_key COLON)
+ iri
+ manDL_annProp_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_TYPE_DECLARE_ID iri) manDL_annProp_frame*)
+ ;
+
+
+manDL_annProp_frame
+ : manDL_annotations
+ | manDL_domain
+ | manDL_range
+ | manDL_subPropertyOf
+ ;
+
+
+
+
+
+
+
+manDL_namedIndividual
+ : (AT typ=individual_key declare_key
+ | typ=individual_key COLON)
+ iri
+ manDL_indiv_frame*
+ end_key?
+ -> ^(VT_TYPE_DECLARE ^(VT_ENTITY_TYPE[$typ.text]) ^(VT_NAME iri) manDL_indiv_frame*)
+ ;
+
+manDL_indiv_frame
+ : manDL_annotations
+ | manDL_types
+ | manDL_facts
+ | manDL_sameAs
+ | manDL_differentFrom
+ ;
+
+manDL_types
+ : types_key COLON manDL_annotated_description_list
+ -> ^(VT_TYPES manDL_annotated_description_list)
+ ;
+
+manDL_individual_list
+ : manDL_annotated_individual (COMMA! manDL_annotated_individual)*
+ ;
+
+manDL_annotated_individual
+ : ^(manDL_individual manDL_annotations?)
+ ;
+
+manDL_facts
+ : facts_key COLON manDL_fact_annotated_list
+ -> ^(VT_FACTS manDL_fact_annotated_list)
+ ;
+
+manDL_fact_annotated_list
+ : manDL_annotated_fact (COMMA! manDL_annotated_fact)*
+ ;
+
+manDL_annotated_fact
+ : ^(manDL_fact manDL_annotations?)
+ ;
+
+manDL_fact
+ : neg=not_key? manDL_property_expression (manDL_individual | literal)
+ -> {neg==null}? ^(VT_FACT manDL_property_expression manDL_individual? literal?)
+ -> ^(VT_NEG ^(VT_FACT manDL_property_expression manDL_individual? literal?))
+ ;
+
+
+
+manDL_sameAs
+ : sameAs_key COLON manDL_individual_list
+ -> ^(VT_SAMEAS manDL_individual_list)
+ ;
+
+manDL_differentFrom
+ : differentFrom_key COLON manDL_individual_list
+ -> ^(VT_DIFFERENTFROM manDL_individual_list)
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+manDL_misc
+ : (eq=equivalentClasses_key | df=disjointClasses_key) COLON
+ manDL_annotations? manDL_description (COMMA manDL_description)+
+ -> {eq!=null}? ^(VT_EQV_CLASS manDL_annotations? manDL_description+)
+ -> ^(VT_DIF_CLASS manDL_annotations? manDL_description+)
+
+ | (eq2=equivalentProperties_key | df2=disjointProperties_key) COLON
+ manDL_annotations? manDL_property_expression (COMMA manDL_property_expression)+
+ -> {eq2!=null}? ^(VT_EQV_PROP manDL_annotations? manDL_property_expression+)
+ -> ^(VT_DIF_PROP manDL_annotations? manDL_property_expression+)
+
+ | (eq3=sameIndividual_key | df3=differentIndividuals_key) COLON
+ manDL_annotations? manDL_individual (COMMA manDL_individual)+
+ -> {eq3!=null}? ^(VT_EQV_INDV manDL_annotations? manDL_individual+)
+ -> ^(VT_DIF_INDV manDL_annotations? manDL_individual+)
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+manDL_attributes
+ : characteristics_key COLON (manDL_annotations? manDL_attribute) (COMMA manDL_annotations? manDL_attribute)*
+ -> ^(VT_ATTRIBUTES ^(manDL_attribute manDL_annotations?)+)
+ ;
+
+
+manDL_quick_attributes
+ : (AT manDL_att_functional) => AT! manDL_att_functional manDL_quick_attributes
+ | (AT manDL_att_inverseFunctional) => AT! manDL_att_inverseFunctional manDL_quick_attributes
+ | (AT manDL_att_reflexive) => AT! manDL_att_reflexive manDL_quick_attributes
+ | (AT manDL_att_irreflexive) => AT! manDL_att_irreflexive manDL_quick_attributes
+ | (AT manDL_att_symmetric) => AT! manDL_att_symmetric manDL_quick_attributes
+ | (AT manDL_att_asymmetric) => AT! manDL_att_asymmetric manDL_quick_attributes
+ | (AT manDL_att_transitive) => AT! manDL_att_transitive manDL_quick_attributes
+ |
+ ;
+
+manDL_attribute
+ :
+ manDL_att_functional
+ | manDL_att_inverseFunctional
+ | manDL_att_reflexive
+ | manDL_att_irreflexive
+ | manDL_att_symmetric
+ | manDL_att_asymmetric
+ | manDL_att_transitive
+ ;
+
+
+
+manDL_att_functional
+ : mda_functional_key
+ ;
+
+manDL_att_inverseFunctional
+ : mda_inverseFunctional_key
+ ;
+
+manDL_att_reflexive
+ : mda_reflexive_key
+ ;
+
+manDL_att_irreflexive
+ : mda_irreflexive_key
+ ;
+
+manDL_att_symmetric
+ : mda_symmetric_key
+ ;
+
+manDL_att_asymmetric
+ : mda_asymmetric_key
+ ;
+
+manDL_att_transitive
+ : mda_transitive_key
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+manDL_property_list
+ : manDL_annotatedProperty (COMMA! manDL_annotatedProperty)?
+ ;
+
+manDL_annotatedProperty
+ : manDL_annotations? manDL_property_expression
+ ;
+
+manDL_property_expression
+ : inv=inverse_key? manDL_propertyIRI
+ -> ^(VT_DL_PROP manDL_propertyIRI $inv?)
+ ;
+
+
+
+manDL_classIRI
+ : iri
+ ;
+
+manDL_data_type returns [int dim]
+ at init{
+ $dim=0;
+}
+ : iri (dimension_definition {$dim++;})*
+ -> ^(VT_DATA_TYPE VT_DIM_SIZE[$start,""+$dim] iri)
+ ;
+
+manDL_objectPropertyIRI
+ : iri
+ ;
+
+manDL_dataPropertyIRI
+ : iri
+ ;
+
+manDL_annotationPropertyIRI
+ : iri
+ ;
+
+manDL_propertyIRI
+ : iri
+ ;
+
+manDL_individual
+ : manDL_individualIRI
+ | nodeID
+ ;
+
+manDL_individualIRI
+ : iri
+ ;
+
+
\ No newline at end of file
Modified: labs/jbossrules/branches/DRLv6/src/test/java/org/drools/lang/Rule_Test.java
===================================================================
--- labs/jbossrules/branches/DRLv6/src/test/java/org/drools/lang/Rule_Test.java 2010-09-01 21:27:01 UTC (rev 34967)
+++ labs/jbossrules/branches/DRLv6/src/test/java/org/drools/lang/Rule_Test.java 2010-09-01 21:33:07 UTC (rev 34968)
@@ -128,7 +128,19 @@
}
+
@Test
+ public void test_key() {
+ String rule = "rule_attributes";
+ String[] testDRL = new String[] {
+ "@no-loop (true)",
+
+ };
+ check(rule,testDRL);
+ }
+
+
+ @Test
public void test_compilation_unit() {
String rule = "compilation_unit";
String[] testDRL = new String[] {
@@ -137,15 +149,18 @@
" " + "\n" +
"global int N; \n" +
" " + "\n" +
- "Ontology : test" + "\n" +
+ "Ontology : " + "\n" +
" @Class declare Test end " + "\n" +
" " + "\n" +
"rule \"ruel\"\n" +
"when\n" +
"then\n" +
- "end\n"
+ "end\n",
+
+
};
- check(rule,testDRL);
+ check(rule,testDRL);
+
}
@@ -233,7 +248,7 @@
@Test
public void test_fqn() {
- String rule = "fully_qualified_name";
+ String rule = "procedural_name";
String[] testDRL = new String[] {
"Student",
"org.Student",
@@ -243,14 +258,6 @@
}
- @Test
- public void test_decl_field() {
- String rule = "decl_field";
- String[] testDRL = new String[] {
- "field : datatype[][] @[key]"
- };
- check(rule,testDRL);
- }
@@ -260,7 +267,7 @@
String[] testDRL = new String[] {
"rule \"ruleName\" extends \"anotherRule\" " + "\n" +
" @salience(100) " + "\n" +
- " @no-loop " + "\n" +
+// " @no-loop " + "\n" +
" @calendar( \"s1\" , \"s2\" )" + "\n" +
"deduction @crisp" + "\n" +
"implication @[crisp]" + "\n" +
@@ -295,17 +302,16 @@
"@agenda-group(\"test-group\")",
"@activation-group(\"act-group\")",
"@auto-focus(false)",
- "@effective(\"2010-04-12\")",
- "@expires(\"2010-04-12\")",
+ "@date-effective(\"2010-04-12\")",
+ "@date-expires(\"2010-04-12\")",
"@enabled(true)",
"@ruleflow-group(\"act-group\")",
"@agenda-group(\"act-group\")",
"@duration(100)",
"@timer(100)",
-//TODO: fails as stand-alone, but works in context..
-// "calendar \"s1\" , \"s2\" ",
+ "@calendar (\"s1\" , \"s2\" )",
"@dialect( \"java\" )",
- "@lock-on-active(true)",
+ "@lock-on-active (true)",
"@defeats(\"anotherRule\")",
"@deductive",
"@abductive",
@@ -505,7 +511,28 @@
+ @Test
+ public void test_lhs_semantic_joins() {
+ String rule = "rule";
+ String[] testDRL = new String[] {
+ "rule \"r\" when " +
+ " Person() :isFatherOf another $p : Person() :isFriendOf Person()" +
+ "then end",
+
+
+ "rule \"r\" when " +
+ " Person() " +
+ " :hasFriend " +
+ " :hasChild " +
+ " another Person( gender == \"male\") " +
+ "then end",
+
+ };
+ check(rule,testDRL);
+ }
+
+
@Test
public void test_lhs_label_atom_pattern() {
String rule = "rule";
@@ -526,26 +553,53 @@
}
+ @Test
+ public void test_lhs_label_atom_pattern_bare() {
+ String rule = "lhs_label_atom_pattern";
+ String[] testDRL = new String[] {
+ "$p : Person() ",
+ };
+ check(rule,testDRL);
+ }
+
+
@Test
public void test_constraints() {
String rule = "rule";
String[] testDRL = new String[] {
"rule \"r\" when " +
- "Person( \"john\" , 18, height > 150) " +
+ "Person( \"john\" , 18, age > 13) " +
"then end",
};
check(rule,testDRL);
}
+ @Test
+ public void test_constraints_alone() {
+ String rule = "constraints";
+ String[] testDRL = new String[] {
+
+ " \"john\" , 18, age > 13 ",
+
+ };
+ check(rule,testDRL);
+ }
+
+
+
@Test
public void test_positional_constraint() {
String rule = "rule";
String[] testDRL = new String[] {
"rule \"r\" when " +
- "Person( \"john\" , 18, 2.0, ?, ?, true, null, new Dog(), {12, $x, \"test\" }, $var, ? == 3) " +
+ "Person( \"john\" , 18, 2.0, ?, ?, true, null, new Dog(), {12, $x, \"test\" }, $var, ? == 3, 4*3+$var) " +
"then end",
+
+ "rule \"r\" when " +
+ "Person( \"john\") " +
+ "then end",
};
check(rule,testDRL);
}
@@ -609,21 +663,10 @@
- @Test
- public void test_decl_dl() {
- String rule = "manDL_type_declaration";
- String[] testDRL = new String[] {
- "declare Student " + "\n" +
- " as Male and Human and (Slave or worksAt some (School or Prison))" + "\n" +
- " age : int " + "\n" +
- " name : String " + "\n" +
- " end \n"
- };
- check(rule,testDRL);
- }
+
@Test
public void test_constr_implies() {
String rule = "rule";
@@ -644,7 +687,9 @@
" Person( name == \"john\" -> age < 18 || age > 25)" + "\n" +
"then end"
};
- check(rule,testDRL);
+ check(rule,testDRL);
+
+
}
@@ -654,7 +699,7 @@
String rule = "rule";
String[] testDRL = new String[] {
"rule test when " + "\n" +
- " Person( age < 18 ++ age > 25)" + "\n" +
+ " Person( age < 18 <> age > 25)" + "\n" +
"then end",
"rule test when " + "\n" +
@@ -741,7 +786,7 @@
String rule = "rule";
String[] testDRL = new String[] {
"rule test when " + "\n" +
- " Person( age < 18 ++ > 25)" + "\n" +
+ " Person( age < 18 <> > 25)" + "\n" +
"then end",
"rule test when " + "\n" +
@@ -841,8 +886,8 @@
" rule test when " + "\n" +
" branch (" + "\n" +
" Person( ) " + "\n" +
- " [b1] Person( ) " + "\n" +
- " [b2] ( neg @crisp exists Person( ) ) " + "\n" +
+ " <b1> Person( ) " + "\n" +
+ " <b2> ( neg @crisp exists Person( ) ) " + "\n" +
" ) " + "\n" +
" then end ",
};
@@ -853,10 +898,10 @@
public void test_branch_alternative() {
String rule = "branch_alternative";
String[] testDRL = new String[] {
- " [label] Person() ",
- " [! label] Person() ",
- " [label] ( rising Person() ) ",
- " [label] ( ( Person() or Person() ) | unique )",
+ " <label> Person() ",
+ " <! label> Person() ",
+ " <label> ( rising Person() ) ",
+ " <label> ( ( Person() or Person() ) | unique )",
};
check(rule,testDRL);
}
@@ -865,8 +910,8 @@
public void test_branch_label() {
String rule = "branch_label";
String[] testDRL = new String[] {
- " [label] ",
- " [! label] ",
+ " <label> ",
+ " <! label> ",
};
check(rule,testDRL);
}
@@ -880,8 +925,9 @@
String rule = "right_expression";
String[] testDRL = new String[] {
" 2*($x#km+1000) + 500*size.len ",
- //" 2 * $p "
- // as above
+
+ " (age / 2) * $x + 4 * weight.subField ",
+
};
check(rule,testDRL);
}
@@ -915,22 +961,22 @@
@Test
- public void test_left_expression() {
- String rule = "left_expression";
+ public void test_bound_expr() {
+ String rule = "bound_expr";
String[] testDRL = new String[] {
" $a : age " + "\n",
+
+ "$x : ($z + 4 * weight) ",
- " (age + 2) * $x + 4 * weight.subField ",
-
- "$x : $z + 4 * weight ",
-
"$a : (age * 2 + 4 * weight + height) ",
};
check(rule,testDRL);
}
+
+
@Test
public void test_left_expression_in_rule() {
String rule = "rule";
@@ -957,14 +1003,29 @@
" $var.field ",
"address.city.street(2).number",
-
- "$addr.city.#pack.Street( number == 2).subfield[4].subsubfield",
+
};
check(rule,testDRL);
}
+ @Test
+ public void test_nested_accessor_path() {
+ String rule = "nested_accessor_path";
+ String[] testDRL = new String[] {
+
+ " #nested( age == 18 ) ",
+
+ " #some.cast.Nested( age == 18 ) ",
+
+ " field.meth().#nested( age == 18 ) ",
+
+ " $addr.city.#pack.Street( number == 2, subfield[4].subsubfield > 10 )",
+ };
+ check(rule,testDRL);
+ }
+
@Test
public void test_accessor() {
String rule = "accessor";
@@ -973,7 +1034,7 @@
" someMethod(\"p1\",2) ",
- " #nested( age == 18 ) ",
+ " pets[ #nested( age == 18 ) ] ",
" pets[3] ",
@@ -985,7 +1046,9 @@
}
+
+
@Test
public void test_indexer() {
String rule = "indexer";
@@ -1102,12 +1165,12 @@
String rule = "rule";
String[] testDRL = new String[] {
"rule test when" + "\n" +
- " Person( $a : age ) " + "\n" +
+ " Person( $a: age ) " + "\n" +
"then end",
-// "rule test when" + "\n" +
-// " Person( $a : ( age + 4 ) ) " + "\n" +
-// "then end",
+ "rule test when" + "\n" +
+ " Person( $a : ( age + 4 ) ) " + "\n" +
+ "then end",
};
check(rule,testDRL);
}
@@ -1214,6 +1277,15 @@
@Test
+ public void test_empty_rhs() {
+ String rule = "then_part";
+ String[] testDRL = new String[] {
+ " then end",
+ };
+ check(rule,testDRL);
+ }
+
+ @Test
public void test_rhs() {
String rule = "then_part";
String[] testDRL = new String[] {
@@ -1267,7 +1339,7 @@
public void test_dle_nested_objects_cast() {
String rule = "lhs_atom_pattern";
String[] testDRL = {
- "Person( name== \"mark\", address.#org.dom.LongAddress( city == \"london\", country == \"uk\").subfield )"
+ "Person( name== \"mark\", address.#org.dom.LongAddress( city == \"london\", country == \"uk\") )"
};
check(rule,testDRL);
@@ -1343,7 +1415,7 @@
String[] testDRL = {
"rule test when " + "\n" +
" $p : Person() " + "\n" +
- " ?queryName( \"literal\", $p, $unificationVar ) " + "\n" +
+ " ?queryName( \"literal\", $p, $unificationVar, 3*4+2 ) " + "\n" +
" then end"
};
check(rule,testDRL);
@@ -1376,12 +1448,23 @@
}
+
@Test
+ public void test_versioned_accessor() {
+ String rule = "versioned_accessor";
+ String[] testDRL = {
+ "age<<-1>>",
+ };
+ check(rule,testDRL);
+ }
+
+
+ @Test
public void test_dle_version() {
String rule = "rule";
String[] testDRL = {
"rule test when " + "\n" +
- " Person( age<<-1>> == field.val<<-2>>.someother ) " + "\n" +
+ " Person( age<<-1>> == field.val<<2>>.someother ) " + "\n" +
" then end"
};
check(rule,testDRL);
@@ -1578,21 +1661,20 @@
check(rule,testDRL);
}
+
-
@Test
public void test_manDL_annotations() {
String rule = "manDL_annotations";
- String[] testDRL = {
- "@annotations( creator sotty, author davide )",
+ String[] testDRL = {
"Annotations : creator sotty",
"Annotations : creator sotty, " +
" Annotations: rdfsComment year creationYear 2008, " +
"mainClass Person," +
- " @annotations(meta target) annotationProp annotationTgt",
+ " Annotations: meta target annotationProp annotationTgt",
" Annotations:" + "\n" +
@@ -1612,9 +1694,9 @@
"@Class " + "\n" +
"declare Foo " + "\n" +
" Annotations: creatory sotty " + "\n" +
- " DisjointUnionOf: @annotations(guess what) Child, Adult" + "\n" +
+ " DisjointUnionOf: Annotations: guess what Child, Adult" + "\n" +
" SubClassOf: Person and Worker" + "\n" +
- " EquivalentTo: @annotations(guess again) Person" + "\n" +
+ " EquivalentTo: Annotations: guess again Person" + "\n" +
" DisjointWith: Person" + "\n" +
" HasKey: Annotations: annkey targt hasSSN" + "\n" +
"end",
@@ -1622,7 +1704,7 @@
"@Class " + "\n" +
"declare Foo2 " + "\n" +
- " as Person or Worker and hasAge Integer[ < 33 ]" + "\n" +
+ " as Person or Worker and hasAge : Integer[ < 33 ]" + "\n" +
"end",
};
@@ -1631,11 +1713,15 @@
}
+
+
+
+
@Test
public void test_manDL_datatype_declaration() {
String rule = "manDL_type_declaration";
String[] testDRL = {
- "Datatype: NegInt " + "\n" +
+ "Datatype: NegInt " + "\n" +
" EquivalentTo: Annotations: creator sotty Integer[ < 0 ], NegativeInteger" + "\n",
"@Datatype declare NegInt " + "\n" +
@@ -1652,18 +1738,21 @@
public void test_manDL_annotated_description() {
String rule = "manDL_annotated_description";
String[] testDRL = {
- "@annotations(tell me) Human or Animal or Robot and not Alien",
+ "hasAge exactly 1 and hasAge only not NegInt",
+
+ "Annotations: tell me Human or Animal or Robot and not Alien",
+
"Person and (" +
" hasChildren exactly 3 Male or hasChildren min 2 Female ) ",
- "hasChildren Male",
+ "hasChild Male",
"Person and hasChildren some Male ",
-
+
"Person and hasChildren only Male ",
- //TODO individual "Person and hasChildren value john ",
+ "Person and hasChildren value john ",
"Person and hasChildren min 3 ",
@@ -1673,22 +1762,57 @@
"Thing that hasFirstName exactly 1 and hasFirstName only String[minLength 1]",
- "hasAge exactly 1 and hasAge only not NegInt",
+
"hasGender exactly 1 and hasGender only {\"female\", \"male\"}",
"hasFirstName value \"John\" or hasFirstName value \"Joe\" ",
+ "Person or hasChildren only Male ",
+
};
check(rule,testDRL);
}
+ @Test
+ public void test_manDL_quantified_restriction_core() {
+ String rule = "manDL_quantified_restriction_core";
+ String[] testDRL = {
+
+
+
+ "hasChildren some Male ",
+
+ "hasChildren only Male ",
+
+ "hasChildren value john ",
+
+ "hasChildren min 3 ",
+
+ "hasChildren max 5 ",
+
+ "hasChildren exactly 10",
+
+ "hasChildren Male",
+
+
+
+ };
+
+ check(rule,testDRL);
+ }
+
+
+
+
+
+
@Test
public void test_manDL_objectprop() {
- String rule = "manDL_type_declaration";
+ String rule = "manDL_objectProperty";
String[] testDRL = {
"ObjectProperty: hasWife" + "\n" +
" Annotations: creator sotty " + "\n" +
@@ -1700,7 +1824,7 @@
" EquivalentTo: isMarriedTo " + "\n" +
" DisjointWith: hates " + "\n" +
" InverseOf: hasSpouse, inverse hasSpouse" + "\n" +
- " SubPropertyChain: hasChild o hasParent " + "\n",
+ " SubPropertyChain: hasChild o hasParent " + "\n",
"@ObjectProperty declare hasWife" + "\n" +
@@ -1710,9 +1834,9 @@
" @Irreflexive " +
" @Asymmetric " +
" @Transitive " + "\n" +
- " domain : Person" + "\n" +
+ " domain : Person " + "\n" +
" range : Woman " + "\n" +
- "end ",
+ "end ",
};
@@ -1723,7 +1847,7 @@
@Test
public void test_manDL_dataprop() {
- String rule = "manDL_type_declaration";
+ String rule = "manDL_dataProperty";
String[] testDRL = {
"DataProperty: hasAge" + "\n" +
" Annotations: creator sotty " + "\n" +
@@ -1785,11 +1909,16 @@
public void test_manDL_misc() {
String rule = "manDL_type_declaration";
String[] testDRL = {
- "EquivalentClasses: Annotations: creator sotty q:Rock, q:Scissors, q:Paper ",
- "DisjointClasses: Annotations: creator sotty Rock, Scissors, Paper ",
+ "EquivalentClasses: Annotations: creator sotty Rock, Scissors, Paper ",
+
+ "DisjointClasses: Annotations: creator sotty q:Rock, q:Scissors, Paper ",
+
"EquivalentProperties: Annotations: creator sotty h:loves, h:hates ",
+
"DisjointProperties: Annotations: creator sotty loves, hates ",
+
"SameIndividual: Annotations: creator sotty John, Joe, Jack ",
+
"DifferentIndividuals: Annotations: creator sotty John, Joe, Jack ",
};
@@ -1797,6 +1926,38 @@
}
+ @Test
+ public void test_manDL_decl_field() {
+ String rule = "manDL_decl_field";
+ String[] testDRL = new String[] {
+ "field : datatype ;",
+
+ "field : datatype[][] ;",
+
+ "field : datatype[][][ > 18 ] ;",
+ };
+ check(rule,testDRL);
+ }
+
+
+
+ @Test
+ public void test_manDL_data_type_restriction() {
+ String rule = "manDL_data_type_restriction";
+ String[] testDRL = new String[] {
+
+ "Integer",
+
+ "Custom",
+
+
+ "Integer[ length 3, > 342 ]",
+ };
+ check(rule,testDRL);
+ }
+
+
+
@Test
public void test_manDL_ontology() {
String rule = "manDL_ontology";
@@ -1805,7 +1966,7 @@
" Ontology : myOnto v1 " +"\n" +
" Import: anotherOnto " + "\n" +
" Annotations: creator sotty" + "\n" +
- " " +"\n" +
+ " " +"\n" +
" declare g:Test end " +"\n",
};
@@ -1828,6 +1989,50 @@
+
+ @Test
+ public void test_manDL_bean() {
+ String rule = "manDL_type_declaration";
+ String[] testDRL = {
+ "@Class " + "\n" +
+ "declare Person " + "\n" +
+ " DisjointUnionOf: Child, Adult" + "\n" +
+ " SubClassOf: Mammal" + "\n" +
+ " EquivalentTo: Mankind" + "\n" +
+ " DisjointWith: Vegetal" + "\n" +
+ " HasKey: hasage" + "\n" +
+ " " + "\n" +
+ " name : String @key ;" + "\n" +
+ " age : Integer ;" + "\n" +
+ " hasRelation String[ minLength 10 ] ;" + "\n" +
+ " hasAddress : Address[][] ;" + "\n" +
+ " hasAddress some Address ;" + "\n" +
+ " " + "\n" +
+ " " + "\n" +
+ "end",
+
+ };
+
+ check(rule,testDRL);
+ }
+
+
+
+ @Test
+ public void test_manDL_backwardtype_declaration() {
+ String rule = "manDL_type_declaration";
+ String[] testDRL = new String[] {
+ "declare Student " + "\n" +
+ " as Male and Human and (Slave or worksAt some (School or Prison))" + "\n" +
+ " age : int ;" + "\n" +
+ " name : String ;" + "\n" +
+ " end \n"
+ };
+ check(rule,testDRL);
+ }
+
+
+
@Test
public void test_foaf_ontology() {
String rule = "manDL_ontology";
@@ -1893,6 +2098,8 @@
for (int j = 0; j < res.length; j++) {
assertTrue(res[j].isSuccess());
}
+
+
}
@@ -1922,8 +2129,9 @@
try {
DRLv6Lexer lexer = new DRLv6Lexer( new ANTLRInputStream( new ByteArrayInputStream(drlString.getBytes()) ));
- DRLv6Parser parser = new DRLv6Parser(new CommonTokenStream( lexer ));
+ DRLv6Parser parser = new DRLv6Parser(new CommonTokenStream( lexer ),true);
+
long start = new Date().getTime();
ParserRuleReturnScope root;
@@ -1933,12 +2141,16 @@
final CommonTree resultTree = (CommonTree) root.getTree();
fakeRoot.addChild(resultTree);
- int errors = parser.getNumberOfSyntaxErrors();
+ int errors = parser.getHelper().errors.size();
+
+
final String tree = DRLTreeFormatter.toIndentedStringTree(resultTree);
log.log(Level.INFO, tree);
-
+ for (String emsg : parser.getErrorMessages())
+ log.log(Level.SEVERE,emsg);
+
res.setNumErrors(errors);
res.setTree(resultTree);
res.setParseTime(after-start);
Added: labs/jbossrules/branches/DRLv6/src/test/resources/foaf.manchester
===================================================================
--- labs/jbossrules/branches/DRLv6/src/test/resources/foaf.manchester (rev 0)
+++ labs/jbossrules/branches/DRLv6/src/test/resources/foaf.manchester 2010-09-01 21:33:07 UTC (rev 34968)
@@ -0,0 +1,1141 @@
+Namespace: dc <http://purl.org/dc/elements/1.1/>
+Namespace: ns <http://www.w3.org/2003/06/sw-vocab-status/ns#>
+Namespace: wgs84_pos <http://www.w3.org/2003/01/geo/wgs84_pos#>
+Namespace: foaf <http://xmlns.com/foaf/0.1/>
+Namespace: contact <http://www.w3.org/2000/10/swap/pim/contact#>
+Namespace: wot <http://xmlns.com/wot/0.1/>
+Namespace: rdfs <http://www.w3.org/2000/01/rdf-schema#>
+Namespace: owl2xml <http://www.w3.org/2006/12/owl2-xml#>
+Namespace: owl <http://www.w3.org/2002/07/owl#>
+Namespace: xsd <http://www.w3.org/2001/XMLSchema#>
+Namespace: rdf <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+Namespace: wordnet <http://xmlns.com/wordnet/1.6/>
+
+
+
+Ontology: <http://www.mindswap.org/2003/owl/foaf>
+
+Annotations:
+ rdfs:seeAlsso "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ dc:description "The Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language.",
+ dc:title "Friend of a Friend (FOAF) vocabulary",
+ dc:date "$Date: 2006/01/29 22:38:45 $"
+
+ObjectProperty: foaf:maker
+
+ Annotations:
+ rdfs:label "maker",
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "An agent that made this thing."
+
+ Range:
+ foaf:Agent
+
+ InverseOf:
+ foaf:made
+
+
+
+
+
+ObjectProperty: foaf:myersBriggs
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A Myers Briggs (MBTI) personality classification.",
+ rdfs:label "myersBriggs"
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+ObjectProperty: foaf:weblog
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "weblog",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A weblog of some thing (whether person, group, company etc.)."
+
+ Characteristics:
+ InverseFunctional
+
+ Domain:
+ foaf:Agent
+
+ Range:
+ foaf:Document
+
+ SubPropertyOf:
+ foaf:page
+
+
+
+
+
+ObjectProperty: foaf:topic_interest
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:comment "A thing of interest to this person.",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "interest_topic"
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+ObjectProperty: foaf:workInfoHomepage
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A work info homepage of some person; a page about their work for some organization.",
+ rdfs:label "work info homepage"
+
+ Domain:
+ foaf:Person
+
+ Range:
+ foaf:Document
+
+
+
+
+
+ObjectProperty: foaf:based_near
+
+ Annotations:
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "based near",
+ rdfs:comment "A location that something is based near, for some broadly human notion of near."
+
+ Domain:
+ wgs84_pos:SpatialThing
+
+ Range:
+ wgs84_pos:SpatialThing
+
+
+
+
+
+ObjectProperty: foaf:tipjar
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "tipjar",
+ rdfs:comment "A tipjar document for this agent, describing means for payment and reward."
+
+ Domain:
+ foaf:Agent
+
+ Range:
+ foaf:Document
+
+ SubPropertyOf:
+ foaf:page
+
+
+
+
+
+ObjectProperty: foaf:page
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "page",
+ rdfs:comment "A page or document about this thing."
+
+ Range:
+ foaf:Document
+
+ InverseOf:
+ foaf:topic
+
+
+
+
+
+ObjectProperty: foaf:mbox
+
+ Annotations:
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "personal mailbox",
+ rdfs:comment "A personal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that there is (across time and change) at most one individual that ever has any particular value for foaf:mbox.",
+ ns:term_status "stable"
+
+ Characteristics:
+ InverseFunctional
+
+ Domain:
+ foaf:Agent
+
+
+
+
+
+ObjectProperty: foaf:holdsAccount
+
+ Annotations:
+ rdfs:comment "Indicates an account held by this agent.",
+ rdfs:label "holds account",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Domain:
+ foaf:Agent
+
+ Range:
+ foaf:OnlineAccount
+
+
+
+
+
+ObjectProperty: foaf:currentProject
+
+ Annotations:
+ rdfs:comment "A current project this person works on.",
+ ns:term_status "testing",
+ rdfs:label "current project",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+ObjectProperty: foaf:made
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "made",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "Something that was made by this agent."
+
+ Domain:
+ foaf:Agent
+
+ InverseOf:
+ foaf:maker
+
+
+
+
+
+ObjectProperty: foaf:img
+
+ Annotations:
+ rdfs:label "image",
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage)."
+
+ Domain:
+ foaf:Person
+
+ Range:
+ foaf:Image
+
+ SubPropertyOf:
+ foaf:depiction
+
+
+
+
+
+ObjectProperty: foaf:workplaceHomepage
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A workplace homepage of some person; the homepage of an organization they work for.",
+ rdfs:label "workplace homepage"
+
+ Domain:
+ foaf:Person
+
+ Range:
+ foaf:Document
+
+
+
+
+
+ObjectProperty: foaf:publications
+
+ Annotations:
+ rdfs:comment "A link to the publications of this person.",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "publications"
+
+ Domain:
+ foaf:Person
+
+ Range:
+ foaf:Document
+
+
+
+
+
+ObjectProperty: foaf:member
+
+ Annotations:
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "Indicates a member of a Group",
+ rdfs:label "member"
+
+ Domain:
+ foaf:Group
+
+ Range:
+ foaf:Agent
+
+
+
+
+
+ObjectProperty: foaf:logo
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A logo representing some thing.",
+ rdfs:label "logo"
+
+
+
+
+
+ObjectProperty: foaf:pastProject
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "past project",
+ rdfs:comment "A project this person has previously worked on."
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+ObjectProperty: foaf:homepage
+
+ Annotations:
+ rdfs:label "homepage",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A homepage for some thing.",
+ ns:term_status "stable"
+
+ Characteristics:
+ InverseFunctional
+
+ Range:
+ foaf:Document
+
+ SubPropertyOf:
+ foaf:isPrimaryTopicOf,
+ foaf:page
+
+
+
+
+
+ObjectProperty: foaf:depicts
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A thing depicted in this representation.",
+ rdfs:label "depicts"
+
+ Domain:
+ foaf:Image
+
+ InverseOf:
+ foaf:depiction
+
+
+
+
+
+ObjectProperty: foaf:fundedBy
+
+ Annotations:
+ rdfs:label "funded by",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "An organization funding a project or person."
+
+
+
+
+
+ObjectProperty: foaf:knows
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "knows",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A person known by this person (indicating some level of reciprocated interaction between the parties)."
+
+ Domain:
+ foaf:Person
+
+ Range:
+ foaf:Person
+
+
+
+
+
+ObjectProperty: foaf:schoolHomepage
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:comment "A homepage of a school attended by the person.",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "schoolHomepage"
+
+ Domain:
+ foaf:Person
+
+ Range:
+ foaf:Document
+
+
+
+
+
+ObjectProperty: foaf:theme
+
+ Annotations:
+ rdfs:label "theme",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A theme."
+
+
+
+
+
+ObjectProperty: foaf:accountServiceHomepage
+
+ Annotations:
+ rdfs:label "account service homepage",
+ ns:term_status "unstable",
+ rdfs:comment "Indicates a homepage of the service provide for this online account.",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Domain:
+ foaf:OnlineAccount
+
+ Range:
+ foaf:Document
+
+
+
+
+
+ObjectProperty: foaf:phone
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:comment "A phone, specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel).",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "phone"
+
+
+
+
+
+ObjectProperty: foaf:depiction
+
+ Annotations:
+ rdfs:label "depiction",
+ ns:term_status "testing",
+ rdfs:comment "A depiction of some thing.",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Range:
+ foaf:Image
+
+ InverseOf:
+ foaf:depicts
+
+
+
+
+
+ObjectProperty: foaf:interest
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "interest",
+ rdfs:comment "A page about a topic of interest to this person.",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Domain:
+ foaf:Person
+
+ Range:
+ foaf:Document
+
+
+
+
+
+ObjectProperty: foaf:primaryTopic
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "The primary topic of some page or document.",
+ rdfs:label "primary topic"
+
+ Characteristics:
+ Functional
+
+ Domain:
+ foaf:Document
+
+ InverseOf:
+ foaf:isPrimaryTopicOf
+
+
+
+
+
+ObjectProperty: foaf:topic
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A topic of some page or document.",
+ rdfs:label "topic"
+
+ Domain:
+ foaf:Document
+
+ InverseOf:
+ foaf:page
+
+
+
+
+
+ObjectProperty: foaf:isPrimaryTopicOf
+
+ Annotations:
+ rdfs:comment "A document that this thing is the primary topic of.",
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "is primary topic of"
+
+ Characteristics:
+ InverseFunctional
+
+ Range:
+ foaf:Document
+
+ InverseOf:
+ foaf:primaryTopic
+
+ SubPropertyOf:
+ foaf:page
+
+
+
+
+
+ObjectProperty: foaf:thumbnail
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "thumbnail",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A derived thumbnail image."
+
+ Domain:
+ foaf:Image
+
+ Range:
+ foaf:Image
+
+
+
+
+
+DataProperty: foaf:msnChatID
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "MSN chat ID",
+ rdfs:comment "An MSN chat ID"
+
+ Domain:
+ foaf:Agent
+
+ SubPropertyOf:
+ foaf:nick
+
+
+
+
+
+DataProperty: foaf:accountName
+
+ Annotations:
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "account name",
+ rdfs:comment "Indicates the name (identifier) associated with this online account."
+
+ Domain:
+ foaf:OnlineAccount
+
+
+
+
+
+DataProperty: foaf:icqChatID
+
+ Annotations:
+ rdfs:label "ICQ chat ID",
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "An ICQ chat ID"
+
+ Domain:
+ foaf:Agent
+
+ SubPropertyOf:
+ foaf:nick
+
+
+
+
+
+DataProperty: foaf:firstName
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "firstName",
+ rdfs:comment "The first name of a person."
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+DataProperty: foaf:sha1
+
+ Annotations:
+ ns:term_status "unstable",
+ rdfs:comment "A sha1sum hash, in hex.",
+ rdfs:label "sha1sum (hex)",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Domain:
+ foaf:Document
+
+
+
+
+
+DataProperty: foaf:surname
+
+ Annotations:
+ rdfs:comment "The surname of some person.",
+ rdfs:label "Surname",
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+DataProperty: foaf:title
+
+ Annotations:
+ rdfs:label "title",
+ ns:term_status "testing",
+ rdfs:comment "Title (Mr, Mrs, Ms, Dr. etc)",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+
+
+
+
+DataProperty: foaf:yahooChatID
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "Yahoo chat ID",
+ rdfs:comment "A Yahoo chat ID",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Domain:
+ foaf:Agent
+
+ SubPropertyOf:
+ foaf:nick
+
+
+
+
+
+DataProperty: foaf:mbox_sha1sum
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "sha1sum of a personal mailbox URI name",
+ rdfs:comment "The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the first owner of the mailbox."
+
+ Domain:
+ foaf:Agent
+
+
+
+
+
+DataProperty: foaf:plan
+
+ Annotations:
+ rdfs:comment "A .plan comment, in the tradition of finger and '.plan' files.",
+ ns:term_status "testing",
+ rdfs:label "plan",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+DataProperty: foaf:family_name
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "family_name",
+ rdfs:comment "The family_name of some person."
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+DataProperty: foaf:givenname
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "Given name",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "The given name of some person."
+
+
+
+
+
+DataProperty: foaf:aimChatID
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "AIM chat ID",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "An AIM chat ID"
+
+ Domain:
+ foaf:Agent
+
+ SubPropertyOf:
+ foaf:nick
+
+
+
+
+
+DataProperty: foaf:geekcode
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "geekcode",
+ rdfs:comment "A textual geekcode for this person, see http://www.geekcode.com/geek.html"
+
+ Domain:
+ foaf:Person
+
+
+
+
+
+DataProperty: foaf:jabberID
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:comment "A jabber ID for something.",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "jabber ID"
+
+ Domain:
+ foaf:Agent
+
+
+
+
+
+DataProperty: foaf:nick
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames).",
+ rdfs:label "nickname"
+
+
+
+
+
+DataProperty: foaf:gender
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:label "gender",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "The gender of this Agent (typically but not necessarily 'male' or 'female')."
+
+ Characteristics:
+ Functional
+
+ Domain:
+ foaf:Agent
+
+
+
+
+
+DataProperty: foaf:birthday
+
+ Annotations:
+ rdfs:comment "The birthday of this Agent, represented in mm-dd string form, eg. '12-31'.",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "birthday"
+
+ Characteristics:
+ Functional
+
+ Domain:
+ foaf:Agent
+
+
+
+
+
+DataProperty: foaf:name
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:comment "A name for some thing.",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "name"
+
+
+
+
+
+DataProperty: foaf:dnaChecksum
+
+ Annotations:
+ rdfs:comment "A checksum for the DNA of some thing. Joke.",
+ rdfs:label "DNA checksum",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+
+
+
+
+Class: foaf:OnlineChatAccount
+
+ Annotations:
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "Online Chat Account",
+ rdfs:comment "An online chat account."
+
+ SubClassOf:
+ foaf:OnlineAccount
+
+
+
+
+
+Class: wordnet:Document
+
+
+
+
+
+Class: foaf:Group
+
+ Annotations:
+ rdfs:label "Group",
+ ns:term_status "unstable",
+ rdfs:comment "A class of Agents."
+
+ SubClassOf:
+ foaf:Agent
+
+
+
+
+
+Class: wordnet:Organization
+
+
+
+
+
+Class: foaf:Organization
+
+ Annotations:
+ rdfs:comment "An organization.",
+ rdfs:label "Organization",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ SubClassOf:
+ foaf:Agent,
+ wordnet:Organization
+
+ DisjointWith:
+ foaf:Document,
+ foaf:Person
+
+
+
+
+
+Class: foaf:OnlineAccount
+
+ Annotations:
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:comment "An online account.",
+ rdfs:label "Online Account"
+
+
+
+
+
+Class: foaf:PersonalProfileDocument
+
+ Annotations:
+ rdfs:comment "A personal profile RDF document.",
+ ns:term_status "testing",
+ rdfs:label "PersonalProfileDocument"
+
+ SubClassOf:
+ foaf:Document
+
+
+
+
+
+Class: foaf:OnlineEcommerceAccount
+
+ Annotations:
+ rdfs:comment "An online e-commerce account.",
+ rdfs:label "Online E-commerce Account",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
+
+ SubClassOf:
+ foaf:OnlineAccount
+
+
+
+
+
+Class: wordnet:Project
+
+
+
+
+
+Class: foaf:Person
+
+ Annotations:
+ rdfs:label "Person",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ ns:term_status "stable",
+ rdfs:comment "A person."
+
+ SubClassOf:
+ contact:Person,
+ wgs84_pos:SpatialThing,
+ foaf:Agent,
+ wordnet:Agent,
+ wordnet:Person
+
+ DisjointWith:
+ foaf:Organization,
+ foaf:Project,
+ foaf:Document
+
+
+
+
+
+Class: foaf:Agent
+
+ Annotations:
+ rdfs:label "Agent",
+ ns:term_status "unstable",
+ rdfs:comment "An agent (eg. person, group, software or physical artifact)."
+
+ SubClassOf:
+ wordnet:Agent3
+
+ DisjointWith:
+ foaf:Document
+
+
+
+
+
+Class: contact:Person
+
+
+
+
+
+Class: wordnet:Agent3
+
+
+
+
+
+Class: wordnet:Agent
+
+
+
+
+
+Class: wgs84_pos:SpatialThing
+
+
+
+
+
+Class: foaf:Project
+
+ Annotations:
+ rdfs:comment "A project (a collective endeavour of some kind).",
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "Project"
+
+ SubClassOf:
+ wordnet:Project
+
+ DisjointWith:
+ foaf:Document,
+ foaf:Person
+
+
+
+
+
+Class: foaf:Document
+
+ Annotations:
+ ns:term_status "testing",
+ rdfs:comment "A document.",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "Document"
+
+ SubClassOf:
+ wordnet:Document
+
+ DisjointWith:
+ foaf:Organization,
+ foaf:Project,
+ foaf:Person,
+ foaf:Agent
+
+
+
+
+
+Class: foaf:OnlineGamingAccount
+
+ Annotations:
+ ns:term_status "unstable",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "Online Gaming Account",
+ rdfs:comment "An online gaming account."
+
+ SubClassOf:
+ foaf:OnlineAccount
+
+
+
+
+
+Class: wordnet:Person
+
+
+
+
+
+Class: foaf:Image
+
+ Annotations:
+ rdfs:comment "An image.",
+ ns:term_status "testing",
+ rdfs:isDefinedBy "http://xmlns.com/foaf/0.1/"^^xsd:anyURI,
+ rdfs:label "Image"
+
+ SubClassOf:
+ wordnet:Document
+
+
+
+
+
+Individual: <http://xmlns.com/foaf/0.1/>
More information about the jboss-svn-commits
mailing list