nodeList = getChildren(root);
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
- switch (curNode.getType()) {
- case VelvetParser.CONCEPT:
- parseConcept(curNode);
- break;
- case VelvetParser.CINTERFACE:
- extFeatureModel.setInterface(true);
- parseConcept(curNode);
- break;
- case VelvetParser.EOF:
- if (curNode.getTokenStartIndex() > -1) {
- break;
- }
- default:
- reportSyntaxError(curNode);
- }
+ @Override
+ public boolean initExtension() {
+ if (super.initExtension()) {
+ FMFactoryManager.getInstance().getDefaultFactoryWorkspace().assignID(SimpleVelvetFeatureModelFormat.ID, MultiFeatureModelFactory.ID);
+ return true;
}
+ return false;
}
- private void parseUse(Tree root, IFeature parent) throws RecognitionException {
- reportWarning(root, "USE is not supported.");
+ @Override
+ public String getName() {
+ return "Simple Velvet";
}
- private void reportWarning(Tree curNode, String message) {
- Logger.logWarning(message + " (at line " + curNode.getLine() + ((featureModelFile != null) ? IN_FILE + featureModelFile.getFileName() : "") + ": \""
- + curNode.getText() + "\")");
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getExtFeatureModelName()
+ */
+ @Override
+ public String getExtFeatureModelName() {
+ return extFeatureModelName;
}
- private Tree checkTree(Tree root) throws RecognitionException {
- if (root instanceof CommonErrorNode) {
- throwException(((CommonErrorNode) root).trappedException, root);
- }
- return root;
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getExtFeatureModel()
+ */
+ @Override
+ public MultiFeatureModel getExtFeatureModel() {
+ return extFeatureModel;
}
- private void reportSyntaxError(Tree curNode) throws RecognitionException {
- checkTree(curNode);
- final RecognitionException ex = new RecognitionException();
- ex.line = 1;
- ex.charPositionInLine = 1;
- throwException(ex, curNode);
- }
+ @Override
+ public void setExtFeatureModelName(String name) {
+ extFeatureModelName = name;
- private void throwException(RecognitionException e, Tree curNode) throws RecognitionException {
- throw e;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getFeatureModelFile()
+ */
@Override
- public String getSuffix() {
- return "velvet";
+ public File getFeatureModelFile() {
+ // TODO Auto-generated method stub
+ return featureModelFile;
}
@Override
- public SimpleVelvetFeatureModelFormat getInstance() {
- return new SimpleVelvetFeatureModelFormat(this);
+ public boolean isVelvetImport() {
+ return velvetImport;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getLocalSearch()
+ */
@Override
- public String getId() {
- return ID;
+ public boolean getLocalSearch() {
+ return false;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getIsUsedAsAPI()
+ */
@Override
- public boolean initExtension() {
- if (super.initExtension()) {
- FMFactoryManager.getInstance().getDefaultFactoryWorkspace().assignID(SimpleVelvetFeatureModelFormat.ID, MultiFeatureModelFactory.ID);
- return true;
- }
+ public boolean getIsUsedAsAPI() {
+ // TODO Auto-generated method stub
return false;
}
@Override
- public String getName() {
- return "Simple Velevet";
+ public String[] getPaths() {
+
+ return paths;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getProject()
+ */
+ @Override
+ public IProject getProject() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/Velvet.interp b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/Velvet.interp
new file mode 100644
index 0000000000..f1cc3fee50
--- /dev/null
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/Velvet.interp
@@ -0,0 +1,156 @@
+token literal names:
+null
+'import'
+'mandatory'
+'abstract'
+'someOf'
+'oneOf'
+'concept'
+'cinterface'
+'constraint'
+'feature'
+'use'
+'instance'
+'interface'
+'description'
+'int'
+'float'
+'string'
+'bool'
+';'
+'{'
+'}'
+'('
+')'
+'='
+','
+':'
+'+'
+'-'
+'!'
+'&&'
+'||'
+'xor'
+'->'
+'<->'
+'=='
+'!='
+'>'
+'<'
+'>='
+'<='
+'EMPTY'
+'CONSTR'
+'ACONSTR'
+'BASEEXT'
+'DEF'
+'GROUP'
+'ATTR'
+'UNARYOP'
+'OPERAND'
+null
+null
+null
+null
+null
+null
+null
+null
+null
+
+token symbolic names:
+null
+IMPORT
+MANDATORY
+ABSTRACT
+SOMEOF
+ONEOF
+CONCEPT
+CINTERFACE
+CONSTRAINT
+FEATURE
+USE
+IMPORTINSTANCE
+IMPORTINTERFACE
+DESCRIPTION
+VAR_INT
+VAR_FLOAT
+VAR_STRING
+VAR_BOOL
+SEMI
+START_C
+END_C
+START_R
+END_R
+EQ
+COMMA
+COLON
+PLUS
+MINUS
+OP_NOT
+OP_AND
+OP_OR
+OP_XOR
+OP_IMPLIES
+OP_EQUIVALENT
+ATTR_OP_EQUALS
+ATTR_OP_NOT_EQUALS
+ATTR_OP_GREATER
+ATTR_OP_LESS
+ATTR_OP_GREATER_EQ
+ATTR_OP_LESS_EQ
+EMPTY
+CONSTR
+ACONSTR
+BASEEXT
+DEF
+GROUP
+ATTR
+UNARYOP
+OPERAND
+BOOLEAN
+ID
+IDPath
+INT
+FLOAT
+STRING
+WS
+SL_COMMENT
+ML_COMMENT
+
+rule names:
+velvetModel
+imp
+concept
+cinterface
+conceptBaseExt
+instanceImports
+interfaceImports
+name
+definitions
+definition
+nonFeatureDefinition
+use
+feature
+featureGroup
+groupType
+description
+constraint
+constraintDefinition
+constraintOperand
+attribute
+attributeConstraint
+attribNumExpr
+attribOperator
+attribNumInstance
+intAttribute
+floatAttribute
+stringAttribute
+boolAttribute
+unaryOp
+binaryOp
+attribRelation
+
+
+atn:
+[4, 1, 57, 294, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 1, 0, 3, 0, 64, 8, 0, 1, 0, 1, 0, 3, 0, 68, 8, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 76, 8, 1, 11, 1, 12, 1, 77, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 84, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 94, 8, 2, 1, 2, 3, 2, 97, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 103, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 5, 4, 110, 8, 4, 10, 4, 12, 4, 113, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 121, 8, 5, 10, 5, 12, 5, 124, 9, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 132, 8, 6, 10, 6, 12, 6, 135, 9, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 5, 9, 144, 8, 9, 10, 9, 12, 9, 147, 9, 9, 1, 9, 1, 9, 5, 9, 151, 8, 9, 10, 9, 12, 9, 154, 9, 9, 1, 9, 1, 9, 1, 9, 5, 9, 159, 8, 9, 10, 9, 12, 9, 162, 9, 9, 3, 9, 164, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 170, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 182, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 188, 8, 12, 1, 13, 1, 13, 1, 13, 4, 13, 193, 8, 13, 11, 13, 12, 13, 194, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 211, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 219, 8, 17, 10, 17, 12, 17, 222, 9, 17, 1, 18, 5, 18, 225, 8, 18, 10, 18, 12, 18, 228, 9, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 235, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 241, 8, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 253, 8, 21, 10, 21, 12, 21, 256, 9, 21, 1, 22, 1, 22, 1, 23, 1, 23, 3, 23, 262, 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 268, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 274, 8, 25, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 280, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 286, 8, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 0, 0, 31, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 0, 5, 1, 0, 50, 51, 1, 0, 4, 5, 1, 0, 26, 27, 1, 0, 29, 33, 2, 0, 34, 34, 38, 39, 303, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, 4, 79, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 106, 1, 0, 0, 0, 10, 114, 1, 0, 0, 0, 12, 125, 1, 0, 0, 0, 14, 136, 1, 0, 0, 0, 16, 138, 1, 0, 0, 0, 18, 145, 1, 0, 0, 0, 20, 169, 1, 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 181, 1, 0, 0, 0, 26, 189, 1, 0, 0, 0, 28, 198, 1, 0, 0, 0, 30, 200, 1, 0, 0, 0, 32, 204, 1, 0, 0, 0, 34, 214, 1, 0, 0, 0, 36, 226, 1, 0, 0, 0, 38, 240, 1, 0, 0, 0, 40, 244, 1, 0, 0, 0, 42, 248, 1, 0, 0, 0, 44, 257, 1, 0, 0, 0, 46, 261, 1, 0, 0, 0, 48, 263, 1, 0, 0, 0, 50, 269, 1, 0, 0, 0, 52, 275, 1, 0, 0, 0, 54, 281, 1, 0, 0, 0, 56, 287, 1, 0, 0, 0, 58, 289, 1, 0, 0, 0, 60, 291, 1, 0, 0, 0, 62, 64, 3, 2, 1, 0, 63, 62, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 67, 1, 0, 0, 0, 65, 68, 3, 4, 2, 0, 66, 68, 3, 6, 3, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 70, 5, 0, 0, 1, 70, 1, 1, 0, 0, 0, 71, 72, 5, 1, 0, 0, 72, 73, 3, 14, 7, 0, 73, 74, 5, 18, 0, 0, 74, 76, 1, 0, 0, 0, 75, 71, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 3, 1, 0, 0, 0, 79, 80, 5, 6, 0, 0, 80, 83, 5, 50, 0, 0, 81, 82, 5, 25, 0, 0, 82, 84, 3, 8, 4, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 93, 1, 0, 0, 0, 85, 86, 3, 10, 5, 0, 86, 87, 3, 12, 6, 0, 87, 94, 1, 0, 0, 0, 88, 89, 3, 12, 6, 0, 89, 90, 3, 10, 5, 0, 90, 94, 1, 0, 0, 0, 91, 94, 3, 12, 6, 0, 92, 94, 3, 10, 5, 0, 93, 85, 1, 0, 0, 0, 93, 88, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 92, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 97, 3, 16, 8, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 7, 0, 0, 99, 102, 5, 50, 0, 0, 100, 101, 5, 25, 0, 0, 101, 103, 3, 8, 4, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 105, 3, 16, 8, 0, 105, 7, 1, 0, 0, 0, 106, 111, 5, 50, 0, 0, 107, 108, 5, 24, 0, 0, 108, 110, 5, 50, 0, 0, 109, 107, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 9, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 11, 0, 0, 115, 116, 5, 50, 0, 0, 116, 122, 3, 14, 7, 0, 117, 118, 5, 24, 0, 0, 118, 119, 5, 50, 0, 0, 119, 121, 3, 14, 7, 0, 120, 117, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 11, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 12, 0, 0, 126, 127, 5, 50, 0, 0, 127, 133, 3, 14, 7, 0, 128, 129, 5, 24, 0, 0, 129, 130, 5, 50, 0, 0, 130, 132, 3, 14, 7, 0, 131, 128, 1, 0, 0, 0, 132, 135, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 13, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 136, 137, 7, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 139, 5, 19, 0, 0, 139, 140, 3, 18, 9, 0, 140, 141, 5, 20, 0, 0, 141, 17, 1, 0, 0, 0, 142, 144, 3, 20, 10, 0, 143, 142, 1, 0, 0, 0, 144, 147, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 163, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 148, 152, 3, 26, 13, 0, 149, 151, 3, 20, 10, 0, 150, 149, 1, 0, 0, 0, 151, 154, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 164, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 155, 160, 3, 24, 12, 0, 156, 159, 3, 24, 12, 0, 157, 159, 3, 20, 10, 0, 158, 156, 1, 0, 0, 0, 158, 157, 1, 0, 0, 0, 159, 162, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 148, 1, 0, 0, 0, 163, 155, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 19, 1, 0, 0, 0, 165, 170, 3, 32, 16, 0, 166, 170, 3, 22, 11, 0, 167, 170, 3, 38, 19, 0, 168, 170, 3, 30, 15, 0, 169, 165, 1, 0, 0, 0, 169, 166, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 168, 1, 0, 0, 0, 170, 21, 1, 0, 0, 0, 171, 172, 5, 10, 0, 0, 172, 173, 3, 14, 7, 0, 173, 174, 5, 18, 0, 0, 174, 23, 1, 0, 0, 0, 175, 176, 5, 2, 0, 0, 176, 182, 5, 3, 0, 0, 177, 178, 5, 3, 0, 0, 178, 182, 5, 2, 0, 0, 179, 182, 5, 2, 0, 0, 180, 182, 5, 3, 0, 0, 181, 175, 1, 0, 0, 0, 181, 177, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 180, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 5, 9, 0, 0, 184, 187, 3, 14, 7, 0, 185, 188, 3, 16, 8, 0, 186, 188, 5, 18, 0, 0, 187, 185, 1, 0, 0, 0, 187, 186, 1, 0, 0, 0, 188, 25, 1, 0, 0, 0, 189, 190, 3, 28, 14, 0, 190, 192, 5, 19, 0, 0, 191, 193, 3, 24, 12, 0, 192, 191, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 197, 5, 20, 0, 0, 197, 27, 1, 0, 0, 0, 198, 199, 7, 1, 0, 0, 199, 29, 1, 0, 0, 0, 200, 201, 5, 13, 0, 0, 201, 202, 5, 54, 0, 0, 202, 203, 5, 18, 0, 0, 203, 31, 1, 0, 0, 0, 204, 205, 5, 8, 0, 0, 205, 206, 5, 50, 0, 0, 206, 207, 5, 23, 0, 0, 207, 210, 1, 0, 0, 0, 208, 211, 3, 34, 17, 0, 209, 211, 3, 40, 20, 0, 210, 208, 1, 0, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 213, 5, 18, 0, 0, 213, 33, 1, 0, 0, 0, 214, 220, 3, 36, 18, 0, 215, 216, 3, 58, 29, 0, 216, 217, 3, 36, 18, 0, 217, 219, 1, 0, 0, 0, 218, 215, 1, 0, 0, 0, 219, 222, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 35, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 223, 225, 3, 56, 28, 0, 224, 223, 1, 0, 0, 0, 225, 228, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 234, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 229, 230, 5, 21, 0, 0, 230, 231, 3, 34, 17, 0, 231, 232, 5, 22, 0, 0, 232, 235, 1, 0, 0, 0, 233, 235, 3, 14, 7, 0, 234, 229, 1, 0, 0, 0, 234, 233, 1, 0, 0, 0, 235, 37, 1, 0, 0, 0, 236, 241, 3, 48, 24, 0, 237, 241, 3, 50, 25, 0, 238, 241, 3, 52, 26, 0, 239, 241, 3, 54, 27, 0, 240, 236, 1, 0, 0, 0, 240, 237, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 243, 5, 18, 0, 0, 243, 39, 1, 0, 0, 0, 244, 245, 3, 42, 21, 0, 245, 246, 3, 60, 30, 0, 246, 247, 3, 42, 21, 0, 247, 41, 1, 0, 0, 0, 248, 254, 3, 46, 23, 0, 249, 250, 3, 44, 22, 0, 250, 251, 3, 46, 23, 0, 251, 253, 1, 0, 0, 0, 252, 249, 1, 0, 0, 0, 253, 256, 1, 0, 0, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 43, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 257, 258, 7, 2, 0, 0, 258, 45, 1, 0, 0, 0, 259, 262, 5, 52, 0, 0, 260, 262, 3, 14, 7, 0, 261, 259, 1, 0, 0, 0, 261, 260, 1, 0, 0, 0, 262, 47, 1, 0, 0, 0, 263, 264, 5, 14, 0, 0, 264, 267, 3, 14, 7, 0, 265, 266, 5, 23, 0, 0, 266, 268, 5, 52, 0, 0, 267, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 49, 1, 0, 0, 0, 269, 270, 5, 15, 0, 0, 270, 273, 3, 14, 7, 0, 271, 272, 5, 23, 0, 0, 272, 274, 5, 53, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 51, 1, 0, 0, 0, 275, 276, 5, 16, 0, 0, 276, 279, 3, 14, 7, 0, 277, 278, 5, 23, 0, 0, 278, 280, 5, 54, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 53, 1, 0, 0, 0, 281, 282, 5, 17, 0, 0, 282, 285, 3, 14, 7, 0, 283, 284, 5, 23, 0, 0, 284, 286, 5, 49, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 55, 1, 0, 0, 0, 287, 288, 5, 28, 0, 0, 288, 57, 1, 0, 0, 0, 289, 290, 7, 3, 0, 0, 290, 59, 1, 0, 0, 0, 291, 292, 7, 4, 0, 0, 292, 61, 1, 0, 0, 0, 30, 63, 67, 77, 83, 93, 96, 102, 111, 122, 133, 145, 152, 158, 160, 163, 169, 181, 187, 194, 210, 220, 226, 234, 240, 254, 261, 267, 273, 279, 285]
\ No newline at end of file
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/Velvet.tokens b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/Velvet.tokens
index 1fd07086b4..3c8e8941ac 100644
--- a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/Velvet.tokens
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/Velvet.tokens
@@ -1,101 +1,105 @@
-ABSTRACT=4
-ACONSTR=5
-ATTR=6
-ATTR_OP_EQUALS=7
-ATTR_OP_GREATER=8
-ATTR_OP_GREATER_EQ=9
-ATTR_OP_LESS=10
-ATTR_OP_LESS_EQ=11
-ATTR_OP_NOT_EQUALS=12
-BASEEXT=13
-BOOLEAN=14
-CINTERFACE=15
-COLON=16
-COMMA=17
-CONCEPT=18
-CONSTR=19
-CONSTRAINT=20
-DEF=21
-DESCRIPTION=22
-EMPTY=23
-END_C=24
-END_R=25
-EQ=26
-ESC_SEQ=27
-EXPONENT=28
-FEATURE=29
-FLOAT=30
-GROUP=31
-HEX_DIGIT=32
-ID=33
-IDPath=34
-IMPORT=35
-IMPORTINSTANCE=36
-IMPORTINTERFACE=37
-INT=38
-MANDATORY=39
-MINUS=40
-ML_COMMENT=41
-OCTAL_ESC=42
-ONEOF=43
-OPERAND=44
-OP_AND=45
-OP_EQUIVALENT=46
-OP_IMPLIES=47
-OP_NOT=48
-OP_OR=49
-OP_XOR=50
-PLUS=51
-SEMI=52
-SL_COMMENT=53
-SOMEOF=54
-START_C=55
-START_R=56
-STRING=57
-UNARYOP=58
-UNICODE_ESC=59
-USE=60
-VAR_BOOL=61
-VAR_FLOAT=62
-VAR_INT=63
-VAR_STRING=64
-WS=65
-'!'=48
-'!='=12
-'&&'=45
-'('=56
-')'=25
-'+'=51
-','=17
-'-'=40
-'->'=47
-':'=16
-';'=52
-'<'=10
-'<->'=46
-'<='=11
-'='=26
-'=='=7
-'>'=8
-'>='=9
-'abstract'=4
-'bool'=61
-'cinterface'=15
-'concept'=18
-'constraint'=20
-'description'=22
-'feature'=29
-'float'=62
-'import'=35
-'instance'=36
-'int'=63
-'interface'=37
-'mandatory'=39
-'oneOf'=43
-'someOf'=54
-'string'=64
-'use'=60
-'xor'=50
-'{'=55
-'||'=49
-'}'=24
+IMPORT=1
+MANDATORY=2
+ABSTRACT=3
+SOMEOF=4
+ONEOF=5
+CONCEPT=6
+CINTERFACE=7
+CONSTRAINT=8
+FEATURE=9
+USE=10
+IMPORTINSTANCE=11
+IMPORTINTERFACE=12
+DESCRIPTION=13
+VAR_INT=14
+VAR_FLOAT=15
+VAR_STRING=16
+VAR_BOOL=17
+SEMI=18
+START_C=19
+END_C=20
+START_R=21
+END_R=22
+EQ=23
+COMMA=24
+COLON=25
+PLUS=26
+MINUS=27
+OP_NOT=28
+OP_AND=29
+OP_OR=30
+OP_XOR=31
+OP_IMPLIES=32
+OP_EQUIVALENT=33
+ATTR_OP_EQUALS=34
+ATTR_OP_NOT_EQUALS=35
+ATTR_OP_GREATER=36
+ATTR_OP_LESS=37
+ATTR_OP_GREATER_EQ=38
+ATTR_OP_LESS_EQ=39
+EMPTY=40
+CONSTR=41
+ACONSTR=42
+BASEEXT=43
+DEF=44
+GROUP=45
+ATTR=46
+UNARYOP=47
+OPERAND=48
+BOOLEAN=49
+ID=50
+IDPath=51
+INT=52
+FLOAT=53
+STRING=54
+WS=55
+SL_COMMENT=56
+ML_COMMENT=57
+'import'=1
+'mandatory'=2
+'abstract'=3
+'someOf'=4
+'oneOf'=5
+'concept'=6
+'cinterface'=7
+'constraint'=8
+'feature'=9
+'use'=10
+'instance'=11
+'interface'=12
+'description'=13
+'int'=14
+'float'=15
+'string'=16
+'bool'=17
+';'=18
+'{'=19
+'}'=20
+'('=21
+')'=22
+'='=23
+','=24
+':'=25
+'+'=26
+'-'=27
+'!'=28
+'&&'=29
+'||'=30
+'xor'=31
+'->'=32
+'<->'=33
+'=='=34
+'!='=35
+'>'=36
+'<'=37
+'>='=38
+'<='=39
+'EMPTY'=40
+'CONSTR'=41
+'ACONSTR'=42
+'BASEEXT'=43
+'DEF'=44
+'GROUP'=45
+'ATTR'=46
+'UNARYOP'=47
+'OPERAND'=48
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetBaseListener.java b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetBaseListener.java
new file mode 100644
index 0000000000..47c1411446
--- /dev/null
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetBaseListener.java
@@ -0,0 +1,415 @@
+// Generated from Velvet.g4 by ANTLR 4.13.2
+
+package de.ovgu.featureide.fm.core.io.velvet;
+
+import de.ovgu.featureide.fm.core.FMCorePlugin;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.antlr.v4.runtime.tree.ErrorNode;
+import org.antlr.v4.runtime.tree.TerminalNode;
+
+/**
+ * This class provides an empty implementation of {@link VelvetListener},
+ * which can be extended to create a listener which only needs to handle a subset
+ * of the available methods.
+ */
+@SuppressWarnings("CheckReturnValue")
+public class VelvetBaseListener implements VelvetListener {
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterVelvetModel(VelvetParser.VelvetModelContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitVelvetModel(VelvetParser.VelvetModelContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterImp(VelvetParser.ImpContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitImp(VelvetParser.ImpContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterConcept(VelvetParser.ConceptContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitConcept(VelvetParser.ConceptContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterCinterface(VelvetParser.CinterfaceContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitCinterface(VelvetParser.CinterfaceContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterConceptBaseExt(VelvetParser.ConceptBaseExtContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitConceptBaseExt(VelvetParser.ConceptBaseExtContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterInstanceImports(VelvetParser.InstanceImportsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitInstanceImports(VelvetParser.InstanceImportsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterInterfaceImports(VelvetParser.InterfaceImportsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitInterfaceImports(VelvetParser.InterfaceImportsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterName(VelvetParser.NameContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitName(VelvetParser.NameContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterDefinitions(VelvetParser.DefinitionsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitDefinitions(VelvetParser.DefinitionsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterDefinition(VelvetParser.DefinitionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitDefinition(VelvetParser.DefinitionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterNonFeatureDefinition(VelvetParser.NonFeatureDefinitionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitNonFeatureDefinition(VelvetParser.NonFeatureDefinitionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterUse(VelvetParser.UseContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitUse(VelvetParser.UseContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterFeature(VelvetParser.FeatureContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitFeature(VelvetParser.FeatureContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterFeatureGroup(VelvetParser.FeatureGroupContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitFeatureGroup(VelvetParser.FeatureGroupContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterGroupType(VelvetParser.GroupTypeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitGroupType(VelvetParser.GroupTypeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterDescription(VelvetParser.DescriptionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitDescription(VelvetParser.DescriptionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterConstraint(VelvetParser.ConstraintContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitConstraint(VelvetParser.ConstraintContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterConstraintDefinition(VelvetParser.ConstraintDefinitionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitConstraintDefinition(VelvetParser.ConstraintDefinitionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterConstraintOperand(VelvetParser.ConstraintOperandContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitConstraintOperand(VelvetParser.ConstraintOperandContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterAttribute(VelvetParser.AttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitAttribute(VelvetParser.AttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterAttributeConstraint(VelvetParser.AttributeConstraintContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitAttributeConstraint(VelvetParser.AttributeConstraintContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterAttribNumExpr(VelvetParser.AttribNumExprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitAttribNumExpr(VelvetParser.AttribNumExprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterAttribOperator(VelvetParser.AttribOperatorContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitAttribOperator(VelvetParser.AttribOperatorContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterAttribNumInstance(VelvetParser.AttribNumInstanceContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitAttribNumInstance(VelvetParser.AttribNumInstanceContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterIntAttribute(VelvetParser.IntAttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitIntAttribute(VelvetParser.IntAttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterFloatAttribute(VelvetParser.FloatAttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitFloatAttribute(VelvetParser.FloatAttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterStringAttribute(VelvetParser.StringAttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitStringAttribute(VelvetParser.StringAttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterBoolAttribute(VelvetParser.BoolAttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitBoolAttribute(VelvetParser.BoolAttributeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterUnaryOp(VelvetParser.UnaryOpContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitUnaryOp(VelvetParser.UnaryOpContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterBinaryOp(VelvetParser.BinaryOpContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitBinaryOp(VelvetParser.BinaryOpContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterAttribRelation(VelvetParser.AttribRelationContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitAttribRelation(VelvetParser.AttribRelationContext ctx) { }
+
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterEveryRule(ParserRuleContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitEveryRule(ParserRuleContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void visitTerminal(TerminalNode node) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void visitErrorNode(ErrorNode node) { }
+}
\ No newline at end of file
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetBaseVisitor.java b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetBaseVisitor.java
new file mode 100644
index 0000000000..fb0b640bb3
--- /dev/null
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetBaseVisitor.java
@@ -0,0 +1,235 @@
+// Generated from Velvet.g4 by ANTLR 4.13.2
+
+package de.ovgu.featureide.fm.core.io.velvet;
+
+import de.ovgu.featureide.fm.core.FMCorePlugin;
+import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
+
+/**
+ * This class provides an empty implementation of {@link VelvetVisitor},
+ * which can be extended to create a visitor which only needs to handle a subset
+ * of the available methods.
+ *
+ * @param The return type of the visit operation. Use {@link Void} for
+ * operations with no return type.
+ */
+@SuppressWarnings("CheckReturnValue")
+public class VelvetBaseVisitor extends AbstractParseTreeVisitor implements VelvetVisitor {
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitVelvetModel(VelvetParser.VelvetModelContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitImp(VelvetParser.ImpContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitConcept(VelvetParser.ConceptContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitCinterface(VelvetParser.CinterfaceContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitConceptBaseExt(VelvetParser.ConceptBaseExtContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitInstanceImports(VelvetParser.InstanceImportsContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitInterfaceImports(VelvetParser.InterfaceImportsContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitName(VelvetParser.NameContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitDefinitions(VelvetParser.DefinitionsContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitDefinition(VelvetParser.DefinitionContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitNonFeatureDefinition(VelvetParser.NonFeatureDefinitionContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitUse(VelvetParser.UseContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitFeature(VelvetParser.FeatureContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitFeatureGroup(VelvetParser.FeatureGroupContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitGroupType(VelvetParser.GroupTypeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitDescription(VelvetParser.DescriptionContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitConstraint(VelvetParser.ConstraintContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitConstraintDefinition(VelvetParser.ConstraintDefinitionContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitConstraintOperand(VelvetParser.ConstraintOperandContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitAttribute(VelvetParser.AttributeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitAttributeConstraint(VelvetParser.AttributeConstraintContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitAttribNumExpr(VelvetParser.AttribNumExprContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitAttribOperator(VelvetParser.AttribOperatorContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitAttribNumInstance(VelvetParser.AttribNumInstanceContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitIntAttribute(VelvetParser.IntAttributeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitFloatAttribute(VelvetParser.FloatAttributeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitStringAttribute(VelvetParser.StringAttributeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitBoolAttribute(VelvetParser.BoolAttributeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitUnaryOp(VelvetParser.UnaryOpContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitBinaryOp(VelvetParser.BinaryOpContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitAttribRelation(VelvetParser.AttribRelationContext ctx) { return visitChildren(ctx); }
+}
\ No newline at end of file
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetFeatureModelFormat.java b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetFeatureModelFormat.java
index 4728a9d56f..812842066c 100644
--- a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetFeatureModelFormat.java
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetFeatureModelFormat.java
@@ -1,5 +1,7 @@
/* FeatureIDE - A Framework for Feature-Oriented Software Development
* Copyright (C) 2005-2019 FeatureIDE team, University of Magdeburg, Germany
+ * 2025 Malte Grave, VaSiCS, LIT CPS Lab, Johannes Kepler University, Linz
+ * 2025 Oleksandr Kudriavchenko, VaSiCS, LIT CPS Lab, Johannes Kepler University, Linz
*
* This file is part of FeatureIDE.
*
@@ -20,33 +22,27 @@
*/
package de.ovgu.featureide.fm.core.io.velvet;
-import static de.ovgu.featureide.fm.core.localization.StringTable.ILLEGAL_SYNTAX_IN_LINE;
-import static de.ovgu.featureide.fm.core.localization.StringTable.IN_FILE;
-import static de.ovgu.featureide.fm.core.localization.StringTable.IS_ALREADY_IN_USE_;
-import static de.ovgu.featureide.fm.core.localization.StringTable.IS_ALREADY_USED_;
-import static de.ovgu.featureide.fm.core.localization.StringTable.NO_SUCH_ATTRIBUTE_DEFINED_;
-import static de.ovgu.featureide.fm.core.localization.StringTable.THE_PARENT_MODEL;
-import static de.ovgu.featureide.fm.core.localization.StringTable.THE_VARIABLE_NAME;
-import static de.ovgu.featureide.fm.core.localization.StringTable.USE;
-import static java.lang.String.format;
-
import java.io.ByteArrayInputStream;
import java.io.File;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
-import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.LinkedList;
-import java.util.ListIterator;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
-import org.antlr.runtime.ANTLRInputStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
-import org.antlr.runtime.tree.CommonErrorNode;
-import org.antlr.runtime.tree.Tree;
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.CharStreams;
+import org.antlr.v4.runtime.CommonTokenStream;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.antlr.v4.runtime.tree.Tree;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -54,14 +50,9 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.prop4j.And;
-import org.prop4j.Choose;
import org.prop4j.Equals;
import org.prop4j.Implies;
-import org.prop4j.Literal;
import org.prop4j.Node;
-import org.prop4j.Not;
-import org.prop4j.Or;
import de.ovgu.featureide.fm.core.Logger;
import de.ovgu.featureide.fm.core.ModelMarkerHandler;
@@ -69,11 +60,8 @@
import de.ovgu.featureide.fm.core.base.IConstraint;
import de.ovgu.featureide.fm.core.base.IFeature;
import de.ovgu.featureide.fm.core.base.IFeatureModel;
-import de.ovgu.featureide.fm.core.base.IFeatureModelFactory;
import de.ovgu.featureide.fm.core.base.IFeatureStructure;
-import de.ovgu.featureide.fm.core.base.impl.DefaultFeatureModelFactory;
import de.ovgu.featureide.fm.core.base.impl.FMFactoryManager;
-import de.ovgu.featureide.fm.core.base.impl.FMFormatManager;
import de.ovgu.featureide.fm.core.base.impl.MultiConstraint;
import de.ovgu.featureide.fm.core.base.impl.MultiFeature;
import de.ovgu.featureide.fm.core.base.impl.MultiFeatureModel;
@@ -81,16 +69,12 @@
import de.ovgu.featureide.fm.core.base.impl.MultiFeatureModelFactory;
import de.ovgu.featureide.fm.core.constraint.Equation;
import de.ovgu.featureide.fm.core.constraint.FeatureAttribute;
-import de.ovgu.featureide.fm.core.constraint.Reference;
-import de.ovgu.featureide.fm.core.constraint.ReferenceType;
-import de.ovgu.featureide.fm.core.constraint.RelationOperator;
+import de.ovgu.featureide.fm.core.constraint.FeatureAttributeMap;
import de.ovgu.featureide.fm.core.constraint.WeightedTerm;
import de.ovgu.featureide.fm.core.io.AFeatureModelFormat;
import de.ovgu.featureide.fm.core.io.Problem;
import de.ovgu.featureide.fm.core.io.ProblemList;
import de.ovgu.featureide.fm.core.io.UnsupportedModelException;
-import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager;
-import de.ovgu.featureide.fm.core.io.manager.SimpleFileHandler;
/**
* Reads / Writes feature models in the Velvet format.
@@ -98,15 +82,15 @@
* @author Sebastian Krieter
* @author Matthias Strauss
* @author Reimar Schroeter
+ * @author Malte Grave
+ * @author Oleksandr Kudriavchenko
*/
-public class VelvetFeatureModelFormat extends AFeatureModelFormat {
+public class VelvetFeatureModelFormat extends AFeatureModelFormat implements IVelvetFeatureModelFormat {
public static boolean IS_USED_AS_API = false;
public static final String ID = PluginID.PLUGIN_ID + ".format.fm." + VelvetFeatureModelFormat.class.getSimpleName();
public static final String FILE_EXTENSION = "velvet";
-
- protected File featureModelFile;
-
+ File featureModelFile;
private static final String[] SYMBOLS = { "!", "&&", "||", "->", "<->", ", ", "choose", "atleast", "atmost" };
private static final String NEWLINE = System.getProperty("line.separator", "\n");
private final StringBuilder sb = new StringBuilder();
@@ -119,8 +103,8 @@ public VelvetFeatureModelFormat(VelvetFeatureModelFormat oldFormat) {
/**
* If true an interface will be created. Otherwise it is named CONCEPT
*/
- private boolean isInterface = false;
+ private boolean isInterface = false;
private boolean useLongNames;
public VelvetFeatureModelFormat() {
@@ -137,12 +121,35 @@ public boolean supportsWrite() {
return true;
}
+ void collectAttributes(Map attributesMap, FeatureAttributeMap attributes, String type) {
+ for (final String key : attributes.getKeys()) {
+ for (final FeatureAttribute attribute : attributes.getAttributes(key)) {
+
+ attributesMap.put(String.format("%s %s = %s;", type, attribute.getAttributeName(), attribute.getValue()), attribute.getFeatureName());
+ }
+ }
+ }
+
@Override
public String write(IFeatureModel object) {
+ final int depth = 0;
+
if (object instanceof MultiFeatureModel) {
extFeatureModel = (MultiFeatureModel) object;
isInterface = isInterface || extFeatureModel.isInterface();
}
+ final Map attributes = new HashMap<>();
+ final FeatureAttributeMap intAttrs = extFeatureModel.getIntegerAttributes();
+ // final FeatureAttributeMap floatAttrs = extFeatureModel.getIntegerAttributes();
+ final FeatureAttributeMap boolAttrs = extFeatureModel.getBooleanAttributes();
+ final FeatureAttributeMap strAttrs = extFeatureModel.getStringAttributes();
+ List attributeConstraints = null;
+ collectAttributes(attributes, intAttrs, "int");
+ collectAttributes(attributes, boolAttrs, "bool");
+ collectAttributes(attributes, strAttrs, "string");
+
+ final List constraints = new ArrayList<>(extFeatureModel.getConstraints());
+
final IFeatureStructure root = object.getStructure().getRoot();
sb.delete(0, sb.length());
@@ -207,55 +214,52 @@ public String write(IFeatureModel object) {
sb.append(NEWLINE);
if ((extFeatureModel != null) && !isInterface) {
+
+ attributeConstraints = extFeatureModel.getAttributConstraints();
for (final IFeatureStructure child : root.getChildren()) {
- writeNewDefined(child, 1);
+ writeNewDefined(child, 1, constraints, attributes, attributeConstraints);
}
- for (final IConstraint constraint : object.getConstraints()) {
+ for (final IConstraint constraint : constraints) {
if (((MultiConstraint) constraint).getType() == MultiFeature.TYPE_INTERN) {
- sb.append("\tconstraint ");
- sb.append(constraint.getNode().toString(SYMBOLS));
- sb.append(";");
- sb.append(NEWLINE);
+ writeConstraint(constraint, depth);
}
}
} else {
- writeFeatureGroup(root, 1);
+ writeFeatureGroup(root, 1, constraints, attributes, attributeConstraints);
for (final IConstraint constraint : object.getConstraints()) {
- sb.append("\tconstraint ");
- sb.append(constraint.getNode().toString(SYMBOLS));
- sb.append(";");
- sb.append(NEWLINE);
+ writeConstraint(constraint, depth);
}
}
sb.append("}");
-
return sb.toString();
}
- private void writeFeatureGroup(IFeatureStructure root, int depth) {
+ private void writeFeatureGroup(IFeatureStructure root, int depth, List constraints, Map attributes,
+ List attributeConstraints) {
if (root.isAnd()) {
for (final IFeatureStructure feature : root.getChildren()) {
- writeNewDefined(feature, depth + 1);
+ writeNewDefined(feature, depth + 1, constraints, attributes, attributeConstraints);
}
} else if (root.isOr()) {
writeTab(depth + 1);
sb.append("someOf {");
sb.append(NEWLINE);
for (final IFeatureStructure feature : root.getChildren()) {
- writeFeature(feature, depth + 2);
+ writeFeature(feature, depth + 2, constraints, attributes, attributeConstraints);
}
writeTab(depth + 1);
sb.append("}");
+
sb.append(NEWLINE);
} else if (root.isAlternative()) {
writeTab(depth + 1);
sb.append("oneOf {");
sb.append(NEWLINE);
for (final IFeatureStructure f : root.getChildren()) {
- writeFeature(f, depth + 2);
+ writeFeature(f, depth + 2, constraints, attributes, attributeConstraints);
}
writeTab(depth + 1);
sb.append("}");
@@ -263,7 +267,12 @@ private void writeFeatureGroup(IFeatureStructure root, int depth) {
}
}
- private void writeFeature(IFeatureStructure feature, int depth) {
+ private void writeFeature(IFeatureStructure feature, int depth, List constraints, Map attributes,
+ List attributeConstraints) {
+ final String featureName = feature.getFeature().getName().toString();
+ if (!usedFeatures.add(featureName)) {
+ return;
+ }
writeTab(depth);
if (feature.isAbstract()) {
sb.append("abstract ");
@@ -272,11 +281,53 @@ private void writeFeature(IFeatureStructure feature, int depth) {
sb.append("mandatory ");
}
sb.append("feature ");
- sb.append(feature.getFeature().getName());
+ sb.append(featureName);
+
final String description = feature.getFeature().getProperty().getDescription();
+
+ final List childConstraints = new ArrayList<>();
+ final List childAttributeConstraints = new ArrayList<>();
+
+ final Iterator iteratorC = constraints.iterator();
+ while (iteratorC.hasNext()) {
+ final IConstraint constraint = iteratorC.next();
+ final Node constraintNode = constraint.getNode();
+ final Node[] children = ((Implies) constraintNode).getChildren();
+ final Node parentFeature = children[0];
+ if ((parentFeature.toString().equals(featureName))) {
+ childConstraints.add(constraint);
+ iteratorC.remove();
+ }
+ }
+
+ final Iterator iteratorAC = attributeConstraints.iterator();
+ while (iteratorAC.hasNext()) {
+ String parentFeature = null;
+ final Equation attributeConstraint = iteratorAC.next();
+
+ for (final WeightedTerm term : attributeConstraint.getWeightedTerms()) {
+ /*
+ * go through all terms in equation if there is one, that has a parent which is not present in attributes, we see, that it is equations parent
+ */
+ if (!attributes.containsValue(term.getReference().toString())) {
+ parentFeature = term.getReference().toString();
+ break;
+ }
+ }
+
+ if (featureName.equals(parentFeature)) {
+ childAttributeConstraints.add(attributeConstraint);
+ iteratorAC.remove();
+ }
+
+ }
+
final boolean hasDescription = (description != null) && !description.isEmpty();
+ final boolean hasConstraints = (childConstraints != null) && !childConstraints.isEmpty();
+ final boolean hasAttributeConstraints = (childAttributeConstraints != null) && !childAttributeConstraints.isEmpty();
+ final boolean hasAttributes = attributes.containsValue(featureName);
- if ((feature.getChildrenCount() == 0) && !hasDescription) {
+ if ((feature.getChildrenCount() == 0) && !hasDescription && !hasConstraints && !hasAttributes && !hasAttributeConstraints) {
sb.append(";");
} else {
sb.append(" {");
@@ -288,35 +339,105 @@ private void writeFeature(IFeatureStructure feature, int depth) {
sb.append("\";");
sb.append(NEWLINE);
}
+ if (hasAttributes) {
+ for (final Entry attr : attributes.entrySet()) {
+ if (attr.getValue().equals(featureName)) {
+ writeTab(depth + 1);
+ sb.append(attr.getKey());
+ sb.append(NEWLINE);
+ }
+ }
+ }
+ if (hasAttributeConstraints) {
+ for (final Equation attributeConstraint : childAttributeConstraints) {
+
+ writeAttributeConstraint(attributes, attributeConstraint, featureName, depth);
+ }
+ }
+ if (hasConstraints) {
+ for (final IConstraint constraint : childConstraints) {
+
+ writeConstraint(constraint, depth);
- writeFeatureGroup(feature, depth);
+ }
+ }
+ writeFeatureGroup(feature, depth, constraints, attributes, attributeConstraints);
writeTab(depth);
sb.append("}");
}
sb.append(NEWLINE);
+ } // TODO fix write for inherited feature models private void
+
+ private void writeConstraint(IConstraint constraint, int depth) {
+ writeTab(depth + 1);
+ sb.append("constraint ");
+ final Node constraintNode = ((Implies) constraint.getNode()).getChildren()[1];
+
+ final Node[] children = ((Equals) constraintNode).getChildren();
+ final Node name = children[0];
+ final Node value = children[1];
+ sb.append(name.toString(SYMBOLS));
+ sb.append(" = ");
+ sb.append(value.toString(SYMBOLS));
+ sb.append(";");
+ sb.append(NEWLINE);
+ }
+
+ private void writeAttributeConstraint(Map attributes, Equation attributeConstraint, String featureName, int depth) {
+ writeTab(depth + 1);
+ sb.append("constraint ");
+ sb.append("ID = ");
+ final List sortedTerms = attributeConstraint.getWeightedTerms();
+ sortedTerms.sort(Comparator.comparing(WeightedTerm::isPositive).reversed());
+ boolean first = true;
+ for (final WeightedTerm term : sortedTerms) {
+ if (!term.isPositive()) {
+ sb.append(" - ");
+ } else if (!first) {
+ sb.append(" + ");
+ }
+
+ final String name = term.getReference().getAttributeName();
+ if (!name.equals("attributeName")) {
+ sb.append(name);
+
+ } else {
+ sb.append(term.getWeight());
+ }
+ first = false;
+
+ }
+ sb.append(" ");
+ sb.append(attributeConstraint.getOperator());
+ sb.append(" 0;");
+ sb.append(NEWLINE);
+
}
- // TODO fix write for inherited feature models
- private void writeNewDefined(IFeatureStructure child2, int depth) {
+ private void writeNewDefined(IFeatureStructure child2, int depth, List constraints, Map attributes,
+ List attributeConstraints) {
final IFeature feature = child2.getFeature();
if (feature instanceof MultiFeature) {
final MultiFeature extFeature = (MultiFeature) feature;
-
- if ((extFeature.getType() == MultiFeature.TYPE_INSTANCE) || (extFeature.getType() == MultiFeature.TYPE_INTERFACE)) {
- if (usedVariables.add(extFeature.getExternalModelName())) {
+ if (((extFeature.getType() == MultiFeature.TYPE_INSTANCE) || (extFeature.getType() == MultiFeature.TYPE_INTERFACE))) {
+ if ((usedVariables.add(extFeature.getExternalModelName()))) {
writeTab(depth);
- sb.append(USE);
+ sb.append("use ");
sb.append(extFeature.getExternalModelName());
sb.append(";");
sb.append(NEWLINE);
+
}
- } else if (extFeature.getType() == MultiFeature.TYPE_INTERN) {
- writeFeature(child2, 1);
+ writeFeature(child2, depth, constraints, attributes, attributeConstraints);
+
+ } else if ((extFeature.getType() == MultiFeature.TYPE_INTERN)) {
+
+ writeFeature(child2, depth, constraints, attributes, attributeConstraints);
}
}
for (final IFeatureStructure child : child2.getChildren()) {
- writeNewDefined(child, depth);
+ writeNewDefined(child, depth, constraints, attributes, attributeConstraints);
}
}
@@ -332,9 +453,8 @@ public ProblemList read(IFeatureModel object, CharSequence source) {
factory = MultiFeatureModelFactory.getInstance();
extFeatureModel = (MultiFeatureModel) object;
if (extFeatureModel != null) {
- featureModelFile = extFeatureModel.getSourceFile().toFile();
+ featureModelFile = extFeatureModel.getSourceFile().toFile(); // .toAbsolutePath();
}
-
final ByteArrayInputStream inputstr = new ByteArrayInputStream(source.toString().getBytes(Charset.availableCharsets().get("UTF-8")));
try {
parseInputStream(inputstr);
@@ -344,166 +464,25 @@ public ProblemList read(IFeatureModel object, CharSequence source) {
return problemList;
}
- private static class ConstraintNode {
-
- private final Node computedNode;
- private final Tree rawNode;
-
- public ConstraintNode(Node computedNode, Tree rawNode) {
- this.computedNode = computedNode;
- this.rawNode = rawNode;
- }
- }
-
- private static final int[] binaryOperators =
- { VelvetParser.OP_OR, VelvetParser.OP_AND, VelvetParser.OP_XOR, VelvetParser.OP_IMPLIES, VelvetParser.OP_EQUIVALENT };
- private static final String[] paths = { "%s.velvet", "%s.xml", "MPL/%s.velvet", "MPL/%s.xml" };
-
- private final LinkedList atrributeConstraintNodes = new LinkedList<>();
- private final LinkedList parentStack = new LinkedList<>();
- private final LinkedList constraintNodeList = new LinkedList<>();
- private final HashSet usedVariables = new HashSet<>();
-
- // TODO
- private final boolean velvetImport = false;
-
- private ModelMarkerHandler modelMarkerHandler;
- private MultiFeatureModel extFeatureModel;
- private String extFeatureModelName;
- private boolean localSearch = false;
-
- /**
- * Reads external model with the right FeatureModelReader.
- *
- * @param file file of feature model
- * @return the feature model or null if error occurred
- */
- private IFeatureModel readExternalModelFile(File file) {
- return FeatureModelManager.load(file.toPath());
- }
-
- private boolean checkExternalModelFile(Tree curNode) {
- if (localSearch) {
- if (localSearch(curNode.getText()) == null) {
- reportWarning(curNode, format("No model for %s could be found.", curNode.getText()));
- return false;
- }
- return true;
- }
- if (getExternalModelFile(curNode.getText()) == null) {
- reportWarning(curNode, format("No model for %s could be found.", curNode.getText()));
- return false;
- }
- return true;
- }
-
- private boolean checkInterfaceModelFile(Tree curNode) {
- if (localSearch) {
- if (localSearch(curNode.getText()) == null) {
- reportWarning(curNode, format("No model for %s could be found.", curNode.getText()));
- return false;
- }
- return true;
- }
- if (getInterfaceModelFile(curNode.getText()) == null) {
- reportWarning(curNode, format("No interface for %s could be found.", curNode.getText()));
- return false;
- }
- return true;
- }
-
- private void copyChildnodes(final MultiFeatureModel targetModel, final IFeatureStructure targetParentNode, final IFeatureStructure sourceParentNode,
- final String parentModelName, final String targetParentName, final int type) {
- for (final IFeatureStructure sourceChildStructure : sourceParentNode.getChildren()) {
- final MultiFeature feature;
- if (velvetImport) {
- feature = (MultiFeature) factory.createFeature(targetModel, sourceChildStructure.getFeature().getName());
- } else {
- final String shortName = sourceChildStructure.getFeature().getName().replace(sourceParentNode.getFeature().getName() + ".", "");
- feature = (MultiFeature) factory.createFeature(targetModel, targetParentName + "." + shortName);
- }
- final IFeatureStructure targetChildStructure = feature.getStructure();
- targetChildStructure.setMandatory(sourceChildStructure.isMandatory());
- targetChildStructure.setAbstract(sourceChildStructure.isAbstract());
- targetChildStructure.setHidden(sourceChildStructure.isHidden());
- feature.setExternalModelName(parentModelName);
-
- targetChildStructure.setAND(sourceChildStructure.isAnd());
- targetChildStructure.setMultiple(sourceChildStructure.isMultiple());
- if (sourceChildStructure.isOr()) {
- targetChildStructure.setOr();
- }
-
- targetModel.addFeature(feature);
- targetParentNode.addChild(targetChildStructure);
- feature.setType(type);
-
- if (sourceChildStructure.hasChildren()) {
- copyChildnodes(targetModel, targetChildStructure, sourceChildStructure, parentModelName, feature.getName(), type);
- }
- }
- }
-
- private static WeightedTerm createTerm(final int weight, final boolean rightSide, final boolean minus, final Reference reference) {
- boolean positive = weight >= 0;
- if (rightSide ^ minus) {
- positive = !positive;
- }
- return new WeightedTerm(Math.abs(weight), positive, reference);
- }
-
- private static LinkedList getChildren(final Tree root) {
- final LinkedList children = new LinkedList<>();
-
- final int childCount = root.getChildCount();
- for (int i = 0; i < childCount; i++) {
- children.add(root.getChild(i));
- }
- return children;
- }
-
- private static void updateConstraintNode(Node curNode, String parentModelname, String rootName, IFeatureModel targetModel) {
- if (curNode instanceof Literal) {
- final Literal literal = (Literal) curNode;
- if (literal.var.equals(rootName)) {
- literal.var = parentModelname;
- } else {
- // if fully qualified name
-
- IFeature feature = targetModel.getFeature(literal.var.toString().replace(rootName, parentModelname));
- if (feature == null) {
- // else
- feature = targetModel.getFeature(parentModelname + "." + literal.var.toString());
- }
- literal.var = feature.getName();
- }
- } else {
- for (final Node child : curNode.getChildren()) {
- updateConstraintNode(child, parentModelname, rootName, targetModel);
- }
- }
- }
-
protected synchronized void parseInputStream(final InputStream inputStream) throws UnsupportedModelException {
- ANTLRInputStream antlrInputStream = null;
+ CharStream charStream = null;
try {
- antlrInputStream = new ANTLRInputStream(inputStream);
+ charStream = CharStreams.fromStream(inputStream);
} catch (final IOException e) {
Logger.logError(e);
throw new UnsupportedModelException("Error while reading model!", 0);
}
- final VelvetParser parser = new VelvetParser(new CommonTokenStream(new VelvetLexer(antlrInputStream)));
- Tree root = null;
+ init();
+
+ final VelvetLexer lexer = new VelvetLexer(charStream);
+ final CommonTokenStream tokens = new CommonTokenStream(lexer);
+ final VelvetParser parser = new VelvetParser(tokens);
+ final VelvetVisitorImpl visitor = new VelvetVisitorImpl(this);
try {
- init();
- root = (Tree) parser.velvetModel().getTree();
- if (root == null) {
- throw new UnsupportedModelException("Error while parsing model!", 0);
- }
- checkTree(root);
- parseModel(root);
- parseAttributeConstraints();
+ final ParseTree tree = parser.velvetModel();
+ visitor.visit(tree);
+
} catch (RecognitionException | VelvetParser.InternalSyntaxException e) {
RecognitionException re;
if (e instanceof VelvetParser.InternalSyntaxException) {
@@ -511,887 +490,198 @@ protected synchronized void parseInputStream(final InputStream inputStream) thro
} else {
re = (RecognitionException) e;
}
- Logger.logError(re);
- final String internalMessage = parser.getErrorMessage(re, parser.getTokenNames());
- final String errorMessage = ILLEGAL_SYNTAX_IN_LINE + re.line + ":" + re.charPositionInLine + " (" + internalMessage + ")";
- final UnsupportedModelException unsupportedModelException = new UnsupportedModelException(errorMessage, re.line);
- unsupportedModelException.addSuppressed(re);
- throw unsupportedModelException;
- }
- }
-
- private MultiFeature addFeature(final IFeature parent, final String featureName, final boolean isMandatory, final boolean isAbstract,
- final boolean isHidden) {
- final MultiFeature newFeature = (MultiFeature) factory.createFeature(extFeatureModel, featureName);
- newFeature.getStructure().setMandatory(isMandatory);
- newFeature.getStructure().setAbstract(isAbstract);
- newFeature.getStructure().setHidden(isHidden);
-
- final IFeature orgFeature = extFeatureModel.getFeature(featureName);
- if ((orgFeature != null) && (orgFeature instanceof MultiFeature)) {
- return (MultiFeature) orgFeature;
- } else {
- extFeatureModel.addFeature(newFeature);
- parent.getStructure().addChild(newFeature.getStructure());
- newFeature.setNewDefined(true);
- return newFeature;
- }
- }
-
- private String checkNode(Node curNode) {
- if (curNode instanceof Literal) {
- final Literal literal = (Literal) curNode;
- final String varString = literal.var.toString();
- if (extFeatureModel.getFeature(varString) == null) {
- return literal.var.toString();
- }
- } else {
- for (final Node child : curNode.getChildren()) {
- final String childRet = checkNode(child);
- if (childRet != null) {
- return childRet;
- }
- }
- }
- return null;
- }
-
- private IFeatureModel getExternalFeatureModel(Tree curNode) {
- final File modelFile = getExternalModelFile(curNode.getText());
- if (modelFile == null) {
- reportWarning(curNode, format("No model for %s could be found.", curNode.getText()));
- return null;
- }
- return readModel(modelFile, curNode);
- }
-
- private IFeatureModel getExternalFeatureModel(String modelName, Tree curNode) {
- final File modelFile = getExternalModelFile(modelName);
- if (modelFile == null) {
- return null;
- }
- return readModel(modelFile, curNode);
- }
-
- private IFeatureModel getInterfaceFeatureModel(String modelName, Tree curNode) {
- final File modelFile = getInterfaceModelFile(modelName);
- if (modelFile == null) {
- return null;
- }
- return readModel(modelFile, curNode);
- }
-
- private IFeatureModel readModel(File modelFile, Tree curNode) {
- IFeatureModel fm = null;
- if (IS_USED_AS_API) {
- fm = readExternalModelFileAPI(modelFile);
- } else {
- fm = readExternalModelFile(modelFile);
- }
- if (fm == null) {
- reportWarning(curNode, format("External model for %s could not be read.", curNode.getText()));
- return null;
- }
- return fm;
- }
-
- private IFeatureModel readExternalModelFileAPI(File file) {
- final IFeatureModel fm = new MultiFeatureModelFactory().create();
- fm.setSourceFile(file.toPath());
- SimpleFileHandler.load(file.toPath(), fm, FMFormatManager.getInstance());
- return fm;
- }
-
- /**
- * Search for the right File to include etc. The following search path is used: - ./NAME.velvet
- ./NAME.xml
- ./MPL/NAME.velvet
- * - /NAME_AS_PROJECT/model.xml
- *
- * @param name the name of file or project
- * @return File object if found else null
- */
- private File getExternalModelFile(String name) {
- if (!extFeatureModel.getImports().isEmpty() && !IS_USED_AS_API) {
- for (final String path : extFeatureModel.getImports()) {
- final IProject project = getProject();
- if (!path.endsWith(name)) {
- continue;
- }
- if (project != null) {
- IResource res = project.getFile(path + ".xml");
- if ((res != null) && res.exists()) {
- return res.getLocation().toFile();
- }
- res = project.getFile(path + ".velvet");
- if ((res != null) && res.exists()) {
- return res.getLocation().toFile();
- }
- }
- }
- }
-
- if (localSearch || IS_USED_AS_API) {
- return localSearch(name);
- }
- File returnFile = null;
-
- // local search
- IProject project = getProject();
- if (project != null) {
- for (int i = 0; i < paths.length; i++) {
- final IResource res = project.findMember(format(paths[i], name));
- if (res != null) {
- returnFile = res.getLocation().toFile();
- if (returnFile.equals(featureModelFile)) {
- returnFile = null;
- } else {
- break;
- }
- }
- }
- }
-
- // external search
- if (returnFile == null) {
- // if could not get current project or could not find file in current
- // project assume the name is the project name
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- if (project.isAccessible()) {
- returnFile = project.getFile("model.xml").getLocation().toFile();
- if (returnFile.equals(featureModelFile)) {
- return null;
- }
- } else {
- Logger.logWarning(format("Project %s is not accessible.", name));
- }
- }
-
- if ((returnFile == null) || !returnFile.exists() || !returnFile.canRead()) {
- return null;
- }
- return returnFile;
- }
+ Logger.logError(re);
+ /*
+ * TODO newer parser doesn't have those methods. final String internalMessage = parser.getErrorMessage(re, parser.getTokenNames()); final String
+ * errorMessage = "ILLEGAL_SYNTAX_IN_LINE" + re.line + ":" + re.charPositionInLine + " (" + internalMessage + ")"; final UnsupportedModelException
+ * unsupportedModelException = new UnsupportedModelException(errorMessage, re.line); unsupportedModelException.addSuppressed(re); throw
+ * unsupportedModelException;
+ */
- private File getInterfaceModelFile(String name) {
- if (localSearch) {
- return localSearch(name);
- }
- File returnFile = null;
- final IProject project = getProject();
- if (project != null) {
- final IResource res = project.findMember(format("Interfaces/%s.velvet", name));
- if (res != null) {
- returnFile = res.getLocation().toFile();
- }
}
- return returnFile;
}
- private File localSearch(final String name) {
- if (featureModelFile != null) {
- final File searchDir = new File(featureModelFile.getParentFile(), "MPL");
- if (searchDir != null) {
- final File[] files = searchDir.listFiles(new FilenameFilter() {
-
- @Override
- public boolean accept(File dir, String fileName) {
- final int index = fileName.lastIndexOf('.');
- return (index > 0) && fileName.substring(0, index).equals(name) && fileName.substring(index + 1).matches("xml|velvet");
- }
- });
- if ((files != null) && (files.length > 0)) {
- return files[0];
- }
- }
- }
- return null;
- }
+ private static final int[] binaryOperators =
+ { VelvetParser.OP_OR, VelvetParser.OP_AND, VelvetParser.OP_XOR, VelvetParser.OP_IMPLIES, VelvetParser.OP_EQUIVALENT };
+ private static final String[] paths = { "%s.velvet", "%s.xml", "MPL/%s.velvet", "MPL/%s.xml" };
+ private final LinkedList atrributeConstraintNodes = new LinkedList<>();
+ private final LinkedList parentStack = new LinkedList<>();
+ private final HashSet usedVariables = new HashSet<>(); // TODO private final
+ private final HashSet usedFeatures = new HashSet<>();
+ boolean velvetImport = false;
+ private ModelMarkerHandler modelMarkerHandler;
+ MultiFeatureModel extFeatureModel;
+ String extFeatureModelName;
+ private boolean localSearch = false;
/**
* Returns the eclipse project of the file with the textual representation of the feature model
*
* @return the project of the file or null if not known
+ * @throws IOException
*/
- private IProject getProject() {
+
+ @Override
+ public IProject getProject() {
if ((featureModelFile == null) || IS_USED_AS_API) {
return null;
}
-
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IPath filePath;
+ IPath filePath = null;
try {
- filePath = Path.fromOSString(featureModelFile.getCanonicalPath());
- final IFile file = workspace.getRoot().getFileForLocation(filePath);
- if ((null == file) || !file.exists()) {
- return workspace.getRoot().getFile(filePath).getProject();
- }
- return file.getProject();
+ filePath = new Path(featureModelFile.getCanonicalPath());
} catch (final IOException e) {
- Logger.logError(e);
- return null;
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ final IFile file = workspace.getRoot().getFileForLocation(filePath);
+ if ((null == file) || !file.exists()) {
+ return workspace.getRoot().getFile(filePath).getProject();
}
+ return file.getProject();
}
/**
* Initializes all variables.
*/
private void init() {
- atrributeConstraintNodes.clear();
- parentStack.clear();
- constraintNodeList.clear();
+ usedFeatures.clear();
usedVariables.clear();
-
- extFeatureModel.reset();
- // TODO Layout
- // extFeatureModel.getLayout().showHiddenFeatures(true);
- // extFeatureModel.getLayout().verticalLayout(false);
+ extFeatureModel.reset(); // TODO Layout
if (getProject() != null) {
modelMarkerHandler = new ModelMarkerHandler(getProject().getFile(featureModelFile.getName()));
modelMarkerHandler.deleteAllModelMarkers();
}
-
extFeatureModelName = null;
- extFeatureModel.setInterface(false);
-
- // TODO MPL: Hack for local search
- localSearch = (featureModelFile != null) && (featureModelFile.getParentFile() != null) && featureModelFile.getParentFile().getName().equals("velvet");
- }
-
- private void parseAttribute(final Tree root, final IFeature parent) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
-
- final String name = checkTree(nodeList.poll()).getText();
- final Tree valueNode = nodeList.poll();
-
- switch (valueNode.getType()) {
- case VelvetParser.FLOAT:
- break;
- case VelvetParser.INT:
- extFeatureModel.addAttribute(parent.getName(), name, Integer.parseInt(valueNode.getText()));
- break;
- case VelvetParser.BOOLEAN:
- extFeatureModel.addAttribute(parent.getName(), name, Boolean.parseBoolean(valueNode.getText()));
- break;
- case VelvetParser.STRING:
- final String valueNodeText = valueNode.getText();
- extFeatureModel.addAttribute(parent.getName(), name, valueNodeText.substring(1, valueNodeText.length() - 1));
- break;
- default:
- reportSyntaxError(valueNode);
- }
- }
-
- private void parseAttributeConstraints() throws UnsupportedModelException, RecognitionException {
- while (!atrributeConstraintNodes.isEmpty()) {
- final LinkedList nodeList = getChildren(atrributeConstraintNodes.poll());
-
- final LinkedList weightedTerms = new LinkedList<>();
- RelationOperator relationOperator = null;
- boolean minus = false;
- int degree = 0;
-
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
-
- switch (curNode.getType()) {
- case VelvetParser.ID:
- case VelvetParser.IDPath:
- final String attributeName = curNode.getText();
-
- final Collection> attributes = extFeatureModel.getIntegerAttributes().getAttributes(attributeName);
-
- if (attributes == null) {
- throw new UnsupportedModelException(curNode.getLine() + ":" + curNode.getCharPositionInLine() + NO_SUCH_ATTRIBUTE_DEFINED_,
- curNode.getLine());
- }
-
- for (final FeatureAttribute attr : attributes) {
- weightedTerms.add(createTerm(attr.getValue(), relationOperator != null, minus,
- new Reference(attr.getFeatureName(), ReferenceType.FEATURE, attributeName)));
- }
-
- break;
- // case VelvetParser.FLOAT:
- // break;
- case VelvetParser.INT:
- final int value = Integer.parseInt(curNode.getText());
- if ((relationOperator == null) ^ minus) {
- degree -= value;
- } else {
- degree += value;
- }
- break;
- case VelvetParser.PLUS:
- minus = false;
- break;
- case VelvetParser.MINUS:
- minus = true;
- break;
- case VelvetParser.ATTR_OP_EQUALS:
- relationOperator = RelationOperator.EQUAL;
- break;
- case VelvetParser.ATTR_OP_NOT_EQUALS:
- relationOperator = RelationOperator.NOT_EQUAL;
- break;
- case VelvetParser.ATTR_OP_GREATER:
- relationOperator = RelationOperator.GREATER;
- break;
- case VelvetParser.ATTR_OP_GREATER_EQ:
- relationOperator = RelationOperator.GREATER_EQUAL;
- break;
- case VelvetParser.ATTR_OP_LESS:
- relationOperator = RelationOperator.LESS;
- break;
- case VelvetParser.ATTR_OP_LESS_EQ:
- relationOperator = RelationOperator.LESS_EQUAL;
- break;
- default:
- reportSyntaxError(curNode);
- }
- }
- final Equation equation = new Equation(weightedTerms, relationOperator, degree);
- extFeatureModel.addAttributeConstraint(equation);
- }
- }
-
- private void parseConcept(final Tree root) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
-
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
-
- switch (curNode.getType()) {
- case VelvetParser.ID:
- extFeatureModelName = checkTree(curNode).getText();
-
- final MultiFeature rootFeature = (MultiFeature) factory.createFeature(extFeatureModel, extFeatureModelName);
- rootFeature.getStructure().setAbstract(true);
- rootFeature.getStructure().setMandatory(true);
-
- extFeatureModel.addFeature(rootFeature);
- extFeatureModel.getStructure().setRoot(rootFeature.getStructure());
- parentStack.push(rootFeature);
-
- break;
- case VelvetParser.BASEEXT:
- useLongNames = true;
- parseInheritance(curNode);
- break;
- case VelvetParser.IMPORTINSTANCE:
- useLongNames = true;
- parseInstanceImport(curNode);
- break;
- case VelvetParser.IMPORTINTERFACE:
- useLongNames = true;
- parseInterfaceImport(curNode);
- break;
- case VelvetParser.DEF:
- parseDefinitions(curNode);
- break;
- default:
- reportSyntaxError(curNode);
- }
- }
-
- for (final ConstraintNode constraintNode : constraintNodeList) {
- if (!IS_USED_AS_API) {
- final String nameError = checkNode(constraintNode.computedNode);
- if (nameError == null) {
- extFeatureModel.addConstraint(factory.createConstraint(extFeatureModel, constraintNode.computedNode));
- } else {
- reportWarning(constraintNode.rawNode, format("There is no feature with the name %s.", nameError));
- }
- } else {
- extFeatureModel.addConstraint(factory.createConstraint(extFeatureModel, constraintNode.computedNode));
- }
- }
- }
-
- private void parseConstraint(final Tree root, final IFeature parent) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
-
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
-
- switch (curNode.getType()) {
- case VelvetParser.ID:
- // name = curNode.getText();
- break;
- case VelvetParser.CONSTR:
- Node newNode = parseConstraint_rec(curNode);
- if (useLongNames) {
- newNode = new Implies(new Literal(parent.getName()), newNode);
- }
- constraintNodeList.add(new ConstraintNode(newNode, curNode));
- break;
- case VelvetParser.ACONSTR:
- atrributeConstraintNodes.add(curNode);
- break;
- default:
- reportSyntaxError(curNode);
- }
- }
- }
-
- private Node parseConstraint_rec(final Tree root) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
- final LinkedList nodes = new LinkedList<>();
- final LinkedList operators = new LinkedList<>();
- final LinkedList unaryOp = new LinkedList<>();
- Node n = null;
-
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
-
- switch (curNode.getType()) {
- case VelvetParser.UNARYOP:
- unaryOp.push(curNode.getChild(0).getType());
- break;
- case VelvetParser.CONSTR:
- n = parseConstraint_rec(curNode);
- break;
- case VelvetParser.OPERAND:
- n = new Literal(curNode.getChild(0).getText());
- break;
- default:
- operators.add(curNode.getType());
- }
-
- if (n != null) {
- while (!unaryOp.isEmpty()) {
- switch (unaryOp.pop()) {
- case VelvetParser.OP_NOT:
- n = new Not(n);
- }
- }
- nodes.add(n);
- n = null;
- }
- }
- if (!operators.isEmpty()) {
- for (final int operator : binaryOperators) {
- final ListIterator nodesIt = nodes.listIterator();
- for (final ListIterator opIt = operators.listIterator(); opIt.hasNext();) {
- final Node operand1 = nodesIt.next();
- if (opIt.next() == operator) {
- opIt.remove();
- nodesIt.remove();
- final Node operand2 = nodesIt.next();
- switch (operator) {
- case VelvetParser.OP_AND:
- nodesIt.set(new And(operand1, operand2));
- break;
- case VelvetParser.OP_OR:
- nodesIt.set(new Or(operand1, operand2));
- break;
- case VelvetParser.OP_XOR:
- nodesIt.set(new Choose(1, operand1, operand2));
- break;
- case VelvetParser.OP_IMPLIES:
- nodesIt.set(new Implies(operand1, operand2));
- break;
- case VelvetParser.OP_EQUIVALENT:
- nodesIt.set(new Equals(operand1, operand2));
- break;
- }
- nodesIt.previous();
- }
- }
- }
- }
- if (nodes.isEmpty()) {
- return null;
- }
-
- return nodes.getFirst();
+ extFeatureModel.setInterface(false); // TODO MPL: Hack for local search
+ localSearch = (featureModelFile != null) && (featureModelFile.getParent() != null) && featureModelFile.getName().equals("velvet");
}
- private void parseDefinitions(final Tree root) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
-
- final IFeature parentFeature = parentStack.pop();
- // parentFeature.getStructure().setAnd();
-
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
-
- switch (curNode.getType()) {
- // Feature
- case VelvetParser.FEATURE:
- parseFeature(curNode, parentFeature);
- break;
- // Feature-Group
- case VelvetParser.GROUP:
- parseFeatureGroup(curNode, parentFeature);
- break;
- // Constraint
- case VelvetParser.CONSTRAINT:
- parseConstraint(curNode, parentFeature);
- break;
- // Use
- case VelvetParser.USE:
- parseUse(curNode, parentFeature);
- break;
- // Attribute
- case VelvetParser.ATTR:
- parseAttribute(curNode, parentFeature);
- break;
- case VelvetParser.DESCRIPTION:
- parseDescription(curNode, parentFeature);
- break;
- case VelvetParser.EMPTY:
- break;
- default:
- reportSyntaxError(curNode);
- }
- }
-
- }
-
- private void parseDescription(Tree root, IFeature parent) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
- final Tree valueNode = nodeList.poll();
-
- switch (valueNode.getType()) {
- case VelvetParser.STRING:
- final String valueNodeText = valueNode.getText();
- parent.getProperty().setDescription(valueNodeText.substring(1, valueNodeText.length() - 1).replace("\\\"", "\""));
- break;
- default:
- reportSyntaxError(valueNode);
- }
- }
-
- // XXX Quickfix for issue #383, useLongNames should only be active for MPL models
- private void parseFeature(final Tree root, IFeature parent) throws RecognitionException {
- final LinkedList childList = getChildren(root);
- final String featureName;
- if (extFeatureModel.isInterface()) {
- featureName = checkTree(childList.poll()).getText();
- } else {
- final String childName = checkTree(childList.poll()).getText();
- if (useLongNames && !childName.startsWith(parent.getName())) {
- featureName = parent.getName() + "." + childName;
- } else {
- featureName = childName;
- }
- }
- boolean isMandatory = false, isAbstract = false, moreDefinitions = false;
-
- Tree childNode = null;
- while (!childList.isEmpty() && !moreDefinitions) {
- childNode = childList.poll();
-
- switch (childNode.getType()) {
- case VelvetParser.MANDATORY:
- isMandatory = true;
- break;
- case VelvetParser.ABSTRACT:
- isAbstract = true;
- break;
- case VelvetParser.DEF:
- moreDefinitions = true;
- break;
- default:
- reportSyntaxError(childNode);
- }
- }
-
- final MultiFeature newFeature = addFeature(parent, featureName, isMandatory, isAbstract, false);
- if (moreDefinitions) {
- parentStack.push(newFeature);
- parseDefinitions(childNode);
- }
- }
-
- private void parseFeatureGroup(final Tree root, final IFeature parent) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
-
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
-
- switch (curNode.getType()) {
- case VelvetParser.SOMEOF:
- parent.getStructure().setOr();
- break;
- case VelvetParser.ONEOF:
- parent.getStructure().setAlternative();
- break;
- case VelvetParser.FEATURE:
- parseFeature(curNode, parent);
- break;
- default:
- reportSyntaxError(curNode);
- }
- }
- }
-
- private void parseInheritance(final Tree root) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
-
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
- final String parentModelName = checkTree(curNode).getText();
-
- final IFeatureModel fm = getExternalFeatureModel(curNode);
- if (fm == null) {
- return;
- }
-
- if (!extFeatureModel.addInheritance(parentModelName, parentModelName, null)) {
- reportWarning(curNode, THE_PARENT_MODEL + parentModelName + IS_ALREADY_USED_);
- return;
- }
- addExternalFeatures(fm, parentModelName, extFeatureModel.getStructure().getRoot(), MultiFeature.TYPE_INHERITED);
- }
+ private void reportWarning(Tree curNode, String message) {
+ /*
+ * if (modelMarkerHandler != null) { modelMarkerHandler.createModelMarker(message, org.eclipse.core.resources.IMarker.SEVERITY_WARNING,
+ * curNode.getLine()); } Logger.logWarning(message + " (at line " + curNode.getLine() + ((featureModelFile != null) ? IN_FILE +
+ * featureModelFile.getName() : "") + ": \"" + curNode.getText() + "\")");
+ */
}
- private void addExternalFeatures(IFeatureModel sourceModel, String sourceModelName, IFeatureStructure targetParentFeature, int type) {
- if (sourceModel instanceof MultiFeatureModel) {
- for (final UsedModel usedModel : ((MultiFeatureModel) sourceModel).getExternalModels().values()) {
- extFeatureModel.addExternalModel(new UsedModel(usedModel, sourceModelName));
- }
- }
-
- final UsedModel usedModel = extFeatureModel.getExternalModel(sourceModelName);
- if (usedModel != null) {
- usedModel.setPrefix(targetParentFeature.getFeature().getName() + "." + sourceModelName);
- }
-
- final IFeatureStructure instanceRoot = sourceModel.getStructure().getRoot();
-
- String connectorName = "";
- if (type == MultiFeature.TYPE_INHERITED) {
- connectorName = targetParentFeature.getFeature().getName();
- } else {
- connectorName = (targetParentFeature.isRoot() && targetParentFeature.getFeature().getName().equals(sourceModelName))
- ? targetParentFeature.getFeature().getName() : targetParentFeature.getFeature().getName() + "." + sourceModelName;
- }
- final MultiFeature connector = addFeature(targetParentFeature.getFeature(), connectorName, true, true, instanceRoot.isHidden());
- connector.setType(type);
- connector.setExternalModelName(sourceModelName);
- if (instanceRoot.isAlternative()) {
- connector.getStructure().setAlternative();
- } else if (instanceRoot.isOr()) {
- connector.getStructure().setOr();
- }
-
- copyChildnodes(extFeatureModel, connector.getStructure(), instanceRoot, sourceModelName, connectorName, type);
-
- for (final IConstraint constraint : sourceModel.getConstraints()) {
- final Node constraintNode = constraint.getNode();
- updateConstraintNode(constraintNode, connectorName, instanceRoot.getFeature().getName(), extFeatureModel);
- final MultiConstraint newConstraint = (MultiConstraint) factory.createConstraint(extFeatureModel, constraintNode);
- newConstraint.setType(type);
- extFeatureModel.addConstraint(newConstraint);
- }
+ private void reportSyntaxError(Tree curNode) throws RecognitionException {
+ /*
+ * final RecognitionException ex = new RecognitionException(null, null, null); ex.line = 1; ex.charPositionInLine = 1; throwException(ex, curNode);
+ */
}
- private void parseInterfaceImport(final Tree root) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
-
- while (!nodeList.isEmpty()) {
- final Tree idNode = checkTree(nodeList.poll());
- final String interfaceName = idNode.getText();
- final Tree nameNode = checkTree(nodeList.poll());
- final String varName = nameNode.getText();
-
- if (checkInterfaceModelFile(idNode)) {
- if (!extFeatureModel.addInterface(interfaceName, varName, null)) {
- reportWarning(idNode, THE_VARIABLE_NAME + varName + IS_ALREADY_IN_USE_);
- }
- }
- }
+ private void throwException(RecognitionException e, Tree curNode) throws RecognitionException {
+ /*
+ * if (modelMarkerHandler != null) { final String text = ""; if (curNode != null) { curNode.getText(); } final String message = ILLEGAL_SYNTAX_IN_LINE +
+ * e.line + ":" + e.charPositionInLine + ". " + text; modelMarkerHandler.createModelMarker(message, org.eclipse.core.resources.IMarker.SEVERITY_ERROR,
+ * e.line); } throw e;
+ */
}
- private void parseInstanceImport(final Tree root) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
-
- while (!nodeList.isEmpty()) {
- final Tree idNode = checkTree(nodeList.poll());
- final String interfaceName = idNode.getText();
- final Tree nameNode = checkTree(nodeList.poll());
- final String varName = nameNode.getText();
-
- if (checkExternalModelFile(idNode)) {
- if (!extFeatureModel.addInstance(interfaceName, varName, null)) {
- reportWarning(idNode, THE_VARIABLE_NAME + varName + IS_ALREADY_IN_USE_);
- }
- }
- }
+ @Override
+ public String getSuffix() {
+ return FILE_EXTENSION;
}
- private void parseModel(final Tree root) throws RecognitionException {
- final LinkedList nodeList = getChildren(root);
- while (!nodeList.isEmpty()) {
- final Tree curNode = nodeList.poll();
- switch (curNode.getType()) {
- case VelvetParser.IMPORT:
- useLongNames = true;
- parseImport(curNode);
- break;
- case VelvetParser.CONCEPT:
- parseConcept(curNode);
- break;
- case VelvetParser.CINTERFACE:
- extFeatureModel.setInterface(true);
- parseConcept(curNode);
- break;
- case VelvetParser.EOF:
- if (curNode.getTokenStartIndex() > -1) {
- break;
- }
- default:
- reportSyntaxError(curNode);
- }
- }
- if (!IS_USED_AS_API) {
- final IFeatureModelFactory mappingModelFactory = DefaultFeatureModelFactory.getInstance();
- final IFeatureModel mappingModel = mappingModelFactory.create();
- final IFeatureStructure rootFeature = mappingModelFactory.createFeature(mappingModel, "MPL").getStructure();
- rootFeature.setAnd();
- rootFeature.setAbstract(true);
- rootFeature.setMandatory(true);
-
- final LinkedList possibleProjects = new LinkedList<>();
- final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- final IProject project = projects[i];
- if (project.isAccessible()) {
- possibleProjects.add(project.getName());
- }
- }
-
- for (final Entry parameter : extFeatureModel.getExternalModels().entrySet()) {
- if (parameter.getValue().getType() == MultiFeature.TYPE_INTERFACE) {
- final IFeatureStructure parameterFeature = mappingModelFactory.createFeature(mappingModel, parameter.getKey()).getStructure();
- parameterFeature.setOr();
- parameterFeature.setAbstract(true);
- parameterFeature.setMandatory(true);
- rootFeature.addChild(parameterFeature);
-
- for (final String projectName : possibleProjects) {
- final IFeatureStructure projectFeature =
- mappingModelFactory.createFeature(mappingModel, parameterFeature.getFeature().getName() + "." + projectName).getStructure();
- projectFeature.setAbstract(false);
- projectFeature.setMandatory(false);
- parameterFeature.addChild(projectFeature);
- }
- }
- }
-
- mappingModel.getStructure().setRoot(rootFeature);
- extFeatureModel.setMappingModel(mappingModel);
- }
+ @Override
+ public VelvetFeatureModelFormat getInstance() {
+ return new VelvetFeatureModelFormat(this);
}
- private void parseImport(Tree curNode) throws RecognitionException {
- final LinkedList nodeList = getChildren(curNode);
- while (!nodeList.isEmpty()) {
- final Tree node = nodeList.poll();
- final String text = node.getText();
- extFeatureModel.addImport(text);
- }
+ @Override
+ public String getId() {
+ return ID;
}
- private void parseUse(Tree root, IFeature parent) throws RecognitionException {
- final LinkedList childList = getChildren(root);
- final Tree useNameNode = checkTree(childList.poll());
- final String varName = useNameNode.getText();
-
- if (!usedVariables.add(varName)) {
- reportWarning(useNameNode, format("The Variable with the name %s was already used in this model.", varName));
- return;
- }
-
- final UsedModel usedModel = extFeatureModel.getExternalModel(varName);
- if (usedModel == null) {
- reportWarning(useNameNode, format("No variable with the name %s found.", varName));
- return;
- }
-
- switch (usedModel.getType()) {
- case MultiFeature.TYPE_INTERFACE:
- final IFeatureModel interfaceModel = getInterfaceFeatureModel(usedModel.getModelName(), useNameNode);
- if (interfaceModel == null) {
- return;
- }
- addExternalFeatures(interfaceModel, varName, parent.getStructure(), MultiFeature.TYPE_INTERFACE);
- break;
- case MultiFeature.TYPE_INSTANCE:
- final IFeatureModel instanceModel = getExternalFeatureModel(usedModel.getModelName(), useNameNode);
- if (instanceModel == null) {
- return;
- }
- addExternalFeatures(instanceModel, varName, parent.getStructure(), MultiFeature.TYPE_INSTANCE);
- break;
- default:
- reportWarning(useNameNode, format("The variable with the name %s is no interface or instance.", varName));
- }
+ @Override
+ public String getName() {
+ return "Velvet";
}
- private void reportWarning(Tree curNode, String message) {
- if (modelMarkerHandler != null) {
- modelMarkerHandler.createModelMarker(message, org.eclipse.core.resources.IMarker.SEVERITY_WARNING, curNode.getLine());
+ @Override
+ public boolean initExtension() {
+ if (super.initExtension()) {
+ FMFactoryManager.getInstance().getDefaultFactoryWorkspace().assignID(VelvetFeatureModelFormat.ID, MultiFeatureModelFactory.ID);
+ return true;
}
- Logger.logWarning(message + " (at line " + curNode.getLine() + ((featureModelFile != null) ? IN_FILE + featureModelFile.getName() : "") + ": \""
- + curNode.getText() + "\")");
+ return false;
}
- private Tree checkTree(Tree root) throws RecognitionException {
- if (root instanceof CommonErrorNode) {
- throwException(((CommonErrorNode) root).trappedException, root);
- }
- return root;
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getExtFeatureModelName()
+ */
+ @Override
+ public String getExtFeatureModelName() {
+ return extFeatureModelName;
}
- private void reportSyntaxError(Tree curNode) throws RecognitionException {
- checkTree(curNode);
- final RecognitionException ex = new RecognitionException();
- ex.line = 1;
- ex.charPositionInLine = 1;
- throwException(ex, curNode);
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getExtFeatureModel()
+ */
+ @Override
+ public MultiFeatureModel getExtFeatureModel() {
+ return extFeatureModel;
}
- private void throwException(RecognitionException e, Tree curNode) throws RecognitionException {
- if (modelMarkerHandler != null) {
- final String text = "";
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#setExtFeatureModelName(java.lang.String)
+ */
+ @Override
+ public void setExtFeatureModelName(String name) {
+ extFeatureModelName = name;
- if (curNode != null) {
- curNode.getText();
- }
- final String message = ILLEGAL_SYNTAX_IN_LINE + e.line + ":" + e.charPositionInLine + ". " + text;
- modelMarkerHandler.createModelMarker(message, org.eclipse.core.resources.IMarker.SEVERITY_ERROR, e.line);
- }
- throw e;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getFeatureModelFile()
+ */
@Override
- public String getSuffix() {
- return FILE_EXTENSION;
+ public File getFeatureModelFile() {
+
+ return featureModelFile;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#isVelvetImport()
+ */
@Override
- public VelvetFeatureModelFormat getInstance() {
- return new VelvetFeatureModelFormat(this);
+ public boolean isVelvetImport() {
+ return velvetImport;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getLocalSearch()
+ */
@Override
- public String getId() {
- return ID;
+ public boolean getLocalSearch() {
+ return localSearch;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getIsUsedAsAPI()
+ */
@Override
- public String getName() {
- return "Velvet";
+ public boolean getIsUsedAsAPI() {
+ // TODO Auto-generated method stub
+ return IS_USED_AS_API;
}
+ /*
+ * (non-Javadoc)
+ * @see de.ovgu.featureide.fm.core.io.velvet.IVelvetFeatureModelFormat#getPaths()
+ */
@Override
- public boolean initExtension() {
- if (super.initExtension()) {
- FMFactoryManager.getInstance().getDefaultFactoryWorkspace().assignID(VelvetFeatureModelFormat.ID, MultiFeatureModelFactory.ID);
- }
- return false;
+ public String[] getPaths() {
+ return paths;
}
}
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.interp b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.interp
new file mode 100644
index 0000000000..f9258fe5d9
--- /dev/null
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.interp
@@ -0,0 +1,193 @@
+token literal names:
+null
+'import'
+'mandatory'
+'abstract'
+'someOf'
+'oneOf'
+'concept'
+'cinterface'
+'constraint'
+'feature'
+'use'
+'instance'
+'interface'
+'description'
+'int'
+'float'
+'string'
+'bool'
+';'
+'{'
+'}'
+'('
+')'
+'='
+','
+':'
+'+'
+'-'
+'!'
+'&&'
+'||'
+'xor'
+'->'
+'<->'
+'=='
+'!='
+'>'
+'<'
+'>='
+'<='
+'EMPTY'
+'CONSTR'
+'ACONSTR'
+'BASEEXT'
+'DEF'
+'GROUP'
+'ATTR'
+'UNARYOP'
+'OPERAND'
+null
+null
+null
+null
+null
+null
+null
+null
+null
+
+token symbolic names:
+null
+IMPORT
+MANDATORY
+ABSTRACT
+SOMEOF
+ONEOF
+CONCEPT
+CINTERFACE
+CONSTRAINT
+FEATURE
+USE
+IMPORTINSTANCE
+IMPORTINTERFACE
+DESCRIPTION
+VAR_INT
+VAR_FLOAT
+VAR_STRING
+VAR_BOOL
+SEMI
+START_C
+END_C
+START_R
+END_R
+EQ
+COMMA
+COLON
+PLUS
+MINUS
+OP_NOT
+OP_AND
+OP_OR
+OP_XOR
+OP_IMPLIES
+OP_EQUIVALENT
+ATTR_OP_EQUALS
+ATTR_OP_NOT_EQUALS
+ATTR_OP_GREATER
+ATTR_OP_LESS
+ATTR_OP_GREATER_EQ
+ATTR_OP_LESS_EQ
+EMPTY
+CONSTR
+ACONSTR
+BASEEXT
+DEF
+GROUP
+ATTR
+UNARYOP
+OPERAND
+BOOLEAN
+ID
+IDPath
+INT
+FLOAT
+STRING
+WS
+SL_COMMENT
+ML_COMMENT
+
+rule names:
+IMPORT
+MANDATORY
+ABSTRACT
+SOMEOF
+ONEOF
+CONCEPT
+CINTERFACE
+CONSTRAINT
+FEATURE
+USE
+IMPORTINSTANCE
+IMPORTINTERFACE
+DESCRIPTION
+VAR_INT
+VAR_FLOAT
+VAR_STRING
+VAR_BOOL
+SEMI
+START_C
+END_C
+START_R
+END_R
+EQ
+COMMA
+COLON
+PLUS
+MINUS
+OP_NOT
+OP_AND
+OP_OR
+OP_XOR
+OP_IMPLIES
+OP_EQUIVALENT
+ATTR_OP_EQUALS
+ATTR_OP_NOT_EQUALS
+ATTR_OP_GREATER
+ATTR_OP_LESS
+ATTR_OP_GREATER_EQ
+ATTR_OP_LESS_EQ
+EMPTY
+CONSTR
+ACONSTR
+BASEEXT
+DEF
+GROUP
+ATTR
+UNARYOP
+OPERAND
+BOOLEAN
+ID
+IDPath
+INT
+FLOAT
+STRING
+EXPONENT
+HEX_DIGIT
+ESC_SEQ
+OCTAL_ESC
+UNICODE_ESC
+WS
+SL_COMMENT
+ML_COMMENT
+
+channel names:
+DEFAULT_TOKEN_CHANNEL
+HIDDEN
+
+mode names:
+DEFAULT_MODE
+
+atn:
+[4, 0, 57, 522, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 384, 8, 48, 1, 49, 1, 49, 5, 49, 388, 8, 49, 10, 49, 12, 49, 391, 9, 49, 1, 50, 1, 50, 1, 50, 4, 50, 396, 8, 50, 11, 50, 12, 50, 397, 1, 51, 4, 51, 401, 8, 51, 11, 51, 12, 51, 402, 1, 52, 4, 52, 406, 8, 52, 11, 52, 12, 52, 407, 1, 52, 1, 52, 5, 52, 412, 8, 52, 10, 52, 12, 52, 415, 9, 52, 1, 52, 3, 52, 418, 8, 52, 1, 52, 1, 52, 4, 52, 422, 8, 52, 11, 52, 12, 52, 423, 1, 52, 3, 52, 427, 8, 52, 1, 52, 4, 52, 430, 8, 52, 11, 52, 12, 52, 431, 1, 52, 3, 52, 435, 8, 52, 1, 53, 1, 53, 1, 53, 5, 53, 440, 8, 53, 10, 53, 12, 53, 443, 9, 53, 1, 53, 1, 53, 1, 54, 1, 54, 3, 54, 449, 8, 54, 1, 54, 4, 54, 452, 8, 54, 11, 54, 12, 54, 453, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 463, 8, 56, 1, 56, 1, 56, 3, 56, 467, 8, 56, 1, 57, 1, 57, 1, 57, 1, 57, 3, 57, 473, 8, 57, 1, 57, 1, 57, 1, 57, 3, 57, 478, 8, 57, 1, 57, 1, 57, 3, 57, 482, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 4, 59, 492, 8, 59, 11, 59, 12, 59, 493, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 5, 60, 502, 8, 60, 10, 60, 12, 60, 505, 9, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 5, 61, 513, 8, 61, 10, 61, 12, 61, 516, 9, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 514, 0, 62, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 0, 111, 0, 113, 0, 115, 0, 117, 0, 119, 55, 121, 56, 123, 57, 1, 0, 10, 4, 0, 45, 45, 65, 90, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 34, 34, 92, 92, 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97, 102, 5, 0, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 2, 0, 39, 39, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 543, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 1, 125, 1, 0, 0, 0, 3, 132, 1, 0, 0, 0, 5, 142, 1, 0, 0, 0, 7, 151, 1, 0, 0, 0, 9, 158, 1, 0, 0, 0, 11, 164, 1, 0, 0, 0, 13, 172, 1, 0, 0, 0, 15, 183, 1, 0, 0, 0, 17, 194, 1, 0, 0, 0, 19, 202, 1, 0, 0, 0, 21, 206, 1, 0, 0, 0, 23, 215, 1, 0, 0, 0, 25, 225, 1, 0, 0, 0, 27, 237, 1, 0, 0, 0, 29, 241, 1, 0, 0, 0, 31, 247, 1, 0, 0, 0, 33, 254, 1, 0, 0, 0, 35, 259, 1, 0, 0, 0, 37, 261, 1, 0, 0, 0, 39, 263, 1, 0, 0, 0, 41, 265, 1, 0, 0, 0, 43, 267, 1, 0, 0, 0, 45, 269, 1, 0, 0, 0, 47, 271, 1, 0, 0, 0, 49, 273, 1, 0, 0, 0, 51, 275, 1, 0, 0, 0, 53, 277, 1, 0, 0, 0, 55, 279, 1, 0, 0, 0, 57, 281, 1, 0, 0, 0, 59, 284, 1, 0, 0, 0, 61, 287, 1, 0, 0, 0, 63, 291, 1, 0, 0, 0, 65, 294, 1, 0, 0, 0, 67, 298, 1, 0, 0, 0, 69, 301, 1, 0, 0, 0, 71, 304, 1, 0, 0, 0, 73, 306, 1, 0, 0, 0, 75, 308, 1, 0, 0, 0, 77, 311, 1, 0, 0, 0, 79, 314, 1, 0, 0, 0, 81, 320, 1, 0, 0, 0, 83, 327, 1, 0, 0, 0, 85, 335, 1, 0, 0, 0, 87, 343, 1, 0, 0, 0, 89, 347, 1, 0, 0, 0, 91, 353, 1, 0, 0, 0, 93, 358, 1, 0, 0, 0, 95, 366, 1, 0, 0, 0, 97, 383, 1, 0, 0, 0, 99, 385, 1, 0, 0, 0, 101, 392, 1, 0, 0, 0, 103, 400, 1, 0, 0, 0, 105, 434, 1, 0, 0, 0, 107, 436, 1, 0, 0, 0, 109, 446, 1, 0, 0, 0, 111, 455, 1, 0, 0, 0, 113, 466, 1, 0, 0, 0, 115, 481, 1, 0, 0, 0, 117, 483, 1, 0, 0, 0, 119, 491, 1, 0, 0, 0, 121, 497, 1, 0, 0, 0, 123, 508, 1, 0, 0, 0, 125, 126, 5, 105, 0, 0, 126, 127, 5, 109, 0, 0, 127, 128, 5, 112, 0, 0, 128, 129, 5, 111, 0, 0, 129, 130, 5, 114, 0, 0, 130, 131, 5, 116, 0, 0, 131, 2, 1, 0, 0, 0, 132, 133, 5, 109, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 110, 0, 0, 135, 136, 5, 100, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 116, 0, 0, 138, 139, 5, 111, 0, 0, 139, 140, 5, 114, 0, 0, 140, 141, 5, 121, 0, 0, 141, 4, 1, 0, 0, 0, 142, 143, 5, 97, 0, 0, 143, 144, 5, 98, 0, 0, 144, 145, 5, 115, 0, 0, 145, 146, 5, 116, 0, 0, 146, 147, 5, 114, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 99, 0, 0, 149, 150, 5, 116, 0, 0, 150, 6, 1, 0, 0, 0, 151, 152, 5, 115, 0, 0, 152, 153, 5, 111, 0, 0, 153, 154, 5, 109, 0, 0, 154, 155, 5, 101, 0, 0, 155, 156, 5, 79, 0, 0, 156, 157, 5, 102, 0, 0, 157, 8, 1, 0, 0, 0, 158, 159, 5, 111, 0, 0, 159, 160, 5, 110, 0, 0, 160, 161, 5, 101, 0, 0, 161, 162, 5, 79, 0, 0, 162, 163, 5, 102, 0, 0, 163, 10, 1, 0, 0, 0, 164, 165, 5, 99, 0, 0, 165, 166, 5, 111, 0, 0, 166, 167, 5, 110, 0, 0, 167, 168, 5, 99, 0, 0, 168, 169, 5, 101, 0, 0, 169, 170, 5, 112, 0, 0, 170, 171, 5, 116, 0, 0, 171, 12, 1, 0, 0, 0, 172, 173, 5, 99, 0, 0, 173, 174, 5, 105, 0, 0, 174, 175, 5, 110, 0, 0, 175, 176, 5, 116, 0, 0, 176, 177, 5, 101, 0, 0, 177, 178, 5, 114, 0, 0, 178, 179, 5, 102, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 99, 0, 0, 181, 182, 5, 101, 0, 0, 182, 14, 1, 0, 0, 0, 183, 184, 5, 99, 0, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 115, 0, 0, 187, 188, 5, 116, 0, 0, 188, 189, 5, 114, 0, 0, 189, 190, 5, 97, 0, 0, 190, 191, 5, 105, 0, 0, 191, 192, 5, 110, 0, 0, 192, 193, 5, 116, 0, 0, 193, 16, 1, 0, 0, 0, 194, 195, 5, 102, 0, 0, 195, 196, 5, 101, 0, 0, 196, 197, 5, 97, 0, 0, 197, 198, 5, 116, 0, 0, 198, 199, 5, 117, 0, 0, 199, 200, 5, 114, 0, 0, 200, 201, 5, 101, 0, 0, 201, 18, 1, 0, 0, 0, 202, 203, 5, 117, 0, 0, 203, 204, 5, 115, 0, 0, 204, 205, 5, 101, 0, 0, 205, 20, 1, 0, 0, 0, 206, 207, 5, 105, 0, 0, 207, 208, 5, 110, 0, 0, 208, 209, 5, 115, 0, 0, 209, 210, 5, 116, 0, 0, 210, 211, 5, 97, 0, 0, 211, 212, 5, 110, 0, 0, 212, 213, 5, 99, 0, 0, 213, 214, 5, 101, 0, 0, 214, 22, 1, 0, 0, 0, 215, 216, 5, 105, 0, 0, 216, 217, 5, 110, 0, 0, 217, 218, 5, 116, 0, 0, 218, 219, 5, 101, 0, 0, 219, 220, 5, 114, 0, 0, 220, 221, 5, 102, 0, 0, 221, 222, 5, 97, 0, 0, 222, 223, 5, 99, 0, 0, 223, 224, 5, 101, 0, 0, 224, 24, 1, 0, 0, 0, 225, 226, 5, 100, 0, 0, 226, 227, 5, 101, 0, 0, 227, 228, 5, 115, 0, 0, 228, 229, 5, 99, 0, 0, 229, 230, 5, 114, 0, 0, 230, 231, 5, 105, 0, 0, 231, 232, 5, 112, 0, 0, 232, 233, 5, 116, 0, 0, 233, 234, 5, 105, 0, 0, 234, 235, 5, 111, 0, 0, 235, 236, 5, 110, 0, 0, 236, 26, 1, 0, 0, 0, 237, 238, 5, 105, 0, 0, 238, 239, 5, 110, 0, 0, 239, 240, 5, 116, 0, 0, 240, 28, 1, 0, 0, 0, 241, 242, 5, 102, 0, 0, 242, 243, 5, 108, 0, 0, 243, 244, 5, 111, 0, 0, 244, 245, 5, 97, 0, 0, 245, 246, 5, 116, 0, 0, 246, 30, 1, 0, 0, 0, 247, 248, 5, 115, 0, 0, 248, 249, 5, 116, 0, 0, 249, 250, 5, 114, 0, 0, 250, 251, 5, 105, 0, 0, 251, 252, 5, 110, 0, 0, 252, 253, 5, 103, 0, 0, 253, 32, 1, 0, 0, 0, 254, 255, 5, 98, 0, 0, 255, 256, 5, 111, 0, 0, 256, 257, 5, 111, 0, 0, 257, 258, 5, 108, 0, 0, 258, 34, 1, 0, 0, 0, 259, 260, 5, 59, 0, 0, 260, 36, 1, 0, 0, 0, 261, 262, 5, 123, 0, 0, 262, 38, 1, 0, 0, 0, 263, 264, 5, 125, 0, 0, 264, 40, 1, 0, 0, 0, 265, 266, 5, 40, 0, 0, 266, 42, 1, 0, 0, 0, 267, 268, 5, 41, 0, 0, 268, 44, 1, 0, 0, 0, 269, 270, 5, 61, 0, 0, 270, 46, 1, 0, 0, 0, 271, 272, 5, 44, 0, 0, 272, 48, 1, 0, 0, 0, 273, 274, 5, 58, 0, 0, 274, 50, 1, 0, 0, 0, 275, 276, 5, 43, 0, 0, 276, 52, 1, 0, 0, 0, 277, 278, 5, 45, 0, 0, 278, 54, 1, 0, 0, 0, 279, 280, 5, 33, 0, 0, 280, 56, 1, 0, 0, 0, 281, 282, 5, 38, 0, 0, 282, 283, 5, 38, 0, 0, 283, 58, 1, 0, 0, 0, 284, 285, 5, 124, 0, 0, 285, 286, 5, 124, 0, 0, 286, 60, 1, 0, 0, 0, 287, 288, 5, 120, 0, 0, 288, 289, 5, 111, 0, 0, 289, 290, 5, 114, 0, 0, 290, 62, 1, 0, 0, 0, 291, 292, 5, 45, 0, 0, 292, 293, 5, 62, 0, 0, 293, 64, 1, 0, 0, 0, 294, 295, 5, 60, 0, 0, 295, 296, 5, 45, 0, 0, 296, 297, 5, 62, 0, 0, 297, 66, 1, 0, 0, 0, 298, 299, 5, 61, 0, 0, 299, 300, 5, 61, 0, 0, 300, 68, 1, 0, 0, 0, 301, 302, 5, 33, 0, 0, 302, 303, 5, 61, 0, 0, 303, 70, 1, 0, 0, 0, 304, 305, 5, 62, 0, 0, 305, 72, 1, 0, 0, 0, 306, 307, 5, 60, 0, 0, 307, 74, 1, 0, 0, 0, 308, 309, 5, 62, 0, 0, 309, 310, 5, 61, 0, 0, 310, 76, 1, 0, 0, 0, 311, 312, 5, 60, 0, 0, 312, 313, 5, 61, 0, 0, 313, 78, 1, 0, 0, 0, 314, 315, 5, 69, 0, 0, 315, 316, 5, 77, 0, 0, 316, 317, 5, 80, 0, 0, 317, 318, 5, 84, 0, 0, 318, 319, 5, 89, 0, 0, 319, 80, 1, 0, 0, 0, 320, 321, 5, 67, 0, 0, 321, 322, 5, 79, 0, 0, 322, 323, 5, 78, 0, 0, 323, 324, 5, 83, 0, 0, 324, 325, 5, 84, 0, 0, 325, 326, 5, 82, 0, 0, 326, 82, 1, 0, 0, 0, 327, 328, 5, 65, 0, 0, 328, 329, 5, 67, 0, 0, 329, 330, 5, 79, 0, 0, 330, 331, 5, 78, 0, 0, 331, 332, 5, 83, 0, 0, 332, 333, 5, 84, 0, 0, 333, 334, 5, 82, 0, 0, 334, 84, 1, 0, 0, 0, 335, 336, 5, 66, 0, 0, 336, 337, 5, 65, 0, 0, 337, 338, 5, 83, 0, 0, 338, 339, 5, 69, 0, 0, 339, 340, 5, 69, 0, 0, 340, 341, 5, 88, 0, 0, 341, 342, 5, 84, 0, 0, 342, 86, 1, 0, 0, 0, 343, 344, 5, 68, 0, 0, 344, 345, 5, 69, 0, 0, 345, 346, 5, 70, 0, 0, 346, 88, 1, 0, 0, 0, 347, 348, 5, 71, 0, 0, 348, 349, 5, 82, 0, 0, 349, 350, 5, 79, 0, 0, 350, 351, 5, 85, 0, 0, 351, 352, 5, 80, 0, 0, 352, 90, 1, 0, 0, 0, 353, 354, 5, 65, 0, 0, 354, 355, 5, 84, 0, 0, 355, 356, 5, 84, 0, 0, 356, 357, 5, 82, 0, 0, 357, 92, 1, 0, 0, 0, 358, 359, 5, 85, 0, 0, 359, 360, 5, 78, 0, 0, 360, 361, 5, 65, 0, 0, 361, 362, 5, 82, 0, 0, 362, 363, 5, 89, 0, 0, 363, 364, 5, 79, 0, 0, 364, 365, 5, 80, 0, 0, 365, 94, 1, 0, 0, 0, 366, 367, 5, 79, 0, 0, 367, 368, 5, 80, 0, 0, 368, 369, 5, 69, 0, 0, 369, 370, 5, 82, 0, 0, 370, 371, 5, 65, 0, 0, 371, 372, 5, 78, 0, 0, 372, 373, 5, 68, 0, 0, 373, 96, 1, 0, 0, 0, 374, 375, 5, 116, 0, 0, 375, 376, 5, 114, 0, 0, 376, 377, 5, 117, 0, 0, 377, 384, 5, 101, 0, 0, 378, 379, 5, 102, 0, 0, 379, 380, 5, 97, 0, 0, 380, 381, 5, 108, 0, 0, 381, 382, 5, 115, 0, 0, 382, 384, 5, 101, 0, 0, 383, 374, 1, 0, 0, 0, 383, 378, 1, 0, 0, 0, 384, 98, 1, 0, 0, 0, 385, 389, 7, 0, 0, 0, 386, 388, 7, 1, 0, 0, 387, 386, 1, 0, 0, 0, 388, 391, 1, 0, 0, 0, 389, 387, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 100, 1, 0, 0, 0, 391, 389, 1, 0, 0, 0, 392, 395, 3, 99, 49, 0, 393, 394, 5, 46, 0, 0, 394, 396, 3, 99, 49, 0, 395, 393, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 102, 1, 0, 0, 0, 399, 401, 2, 48, 57, 0, 400, 399, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 402, 400, 1, 0, 0, 0, 402, 403, 1, 0, 0, 0, 403, 104, 1, 0, 0, 0, 404, 406, 2, 48, 57, 0, 405, 404, 1, 0, 0, 0, 406, 407, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 407, 408, 1, 0, 0, 0, 408, 409, 1, 0, 0, 0, 409, 413, 5, 46, 0, 0, 410, 412, 2, 48, 57, 0, 411, 410, 1, 0, 0, 0, 412, 415, 1, 0, 0, 0, 413, 411, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 417, 1, 0, 0, 0, 415, 413, 1, 0, 0, 0, 416, 418, 3, 109, 54, 0, 417, 416, 1, 0, 0, 0, 417, 418, 1, 0, 0, 0, 418, 435, 1, 0, 0, 0, 419, 421, 5, 46, 0, 0, 420, 422, 2, 48, 57, 0, 421, 420, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 421, 1, 0, 0, 0, 423, 424, 1, 0, 0, 0, 424, 426, 1, 0, 0, 0, 425, 427, 3, 109, 54, 0, 426, 425, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 435, 1, 0, 0, 0, 428, 430, 2, 48, 57, 0, 429, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 429, 1, 0, 0, 0, 431, 432, 1, 0, 0, 0, 432, 433, 1, 0, 0, 0, 433, 435, 3, 109, 54, 0, 434, 405, 1, 0, 0, 0, 434, 419, 1, 0, 0, 0, 434, 429, 1, 0, 0, 0, 435, 106, 1, 0, 0, 0, 436, 441, 5, 34, 0, 0, 437, 440, 3, 113, 56, 0, 438, 440, 8, 2, 0, 0, 439, 437, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 443, 1, 0, 0, 0, 441, 439, 1, 0, 0, 0, 441, 442, 1, 0, 0, 0, 442, 444, 1, 0, 0, 0, 443, 441, 1, 0, 0, 0, 444, 445, 5, 34, 0, 0, 445, 108, 1, 0, 0, 0, 446, 448, 7, 3, 0, 0, 447, 449, 7, 4, 0, 0, 448, 447, 1, 0, 0, 0, 448, 449, 1, 0, 0, 0, 449, 451, 1, 0, 0, 0, 450, 452, 2, 48, 57, 0, 451, 450, 1, 0, 0, 0, 452, 453, 1, 0, 0, 0, 453, 451, 1, 0, 0, 0, 453, 454, 1, 0, 0, 0, 454, 110, 1, 0, 0, 0, 455, 456, 7, 5, 0, 0, 456, 112, 1, 0, 0, 0, 457, 462, 5, 92, 0, 0, 458, 463, 7, 6, 0, 0, 459, 460, 5, 92, 0, 0, 460, 463, 5, 34, 0, 0, 461, 463, 7, 7, 0, 0, 462, 458, 1, 0, 0, 0, 462, 459, 1, 0, 0, 0, 462, 461, 1, 0, 0, 0, 463, 467, 1, 0, 0, 0, 464, 467, 3, 117, 58, 0, 465, 467, 3, 115, 57, 0, 466, 457, 1, 0, 0, 0, 466, 464, 1, 0, 0, 0, 466, 465, 1, 0, 0, 0, 467, 114, 1, 0, 0, 0, 468, 469, 5, 92, 0, 0, 469, 470, 2, 48, 51, 0, 470, 472, 2, 48, 55, 0, 471, 473, 2, 48, 55, 0, 472, 471, 1, 0, 0, 0, 472, 473, 1, 0, 0, 0, 473, 482, 1, 0, 0, 0, 474, 475, 5, 92, 0, 0, 475, 477, 2, 48, 55, 0, 476, 478, 2, 48, 55, 0, 477, 476, 1, 0, 0, 0, 477, 478, 1, 0, 0, 0, 478, 482, 1, 0, 0, 0, 479, 480, 5, 92, 0, 0, 480, 482, 2, 48, 55, 0, 481, 468, 1, 0, 0, 0, 481, 474, 1, 0, 0, 0, 481, 479, 1, 0, 0, 0, 482, 116, 1, 0, 0, 0, 483, 484, 5, 92, 0, 0, 484, 485, 5, 117, 0, 0, 485, 486, 3, 111, 55, 0, 486, 487, 3, 111, 55, 0, 487, 488, 3, 111, 55, 0, 488, 489, 3, 111, 55, 0, 489, 118, 1, 0, 0, 0, 490, 492, 7, 8, 0, 0, 491, 490, 1, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 491, 1, 0, 0, 0, 493, 494, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 496, 6, 59, 0, 0, 496, 120, 1, 0, 0, 0, 497, 498, 5, 47, 0, 0, 498, 499, 5, 47, 0, 0, 499, 503, 1, 0, 0, 0, 500, 502, 8, 9, 0, 0, 501, 500, 1, 0, 0, 0, 502, 505, 1, 0, 0, 0, 503, 501, 1, 0, 0, 0, 503, 504, 1, 0, 0, 0, 504, 506, 1, 0, 0, 0, 505, 503, 1, 0, 0, 0, 506, 507, 6, 60, 0, 0, 507, 122, 1, 0, 0, 0, 508, 509, 5, 47, 0, 0, 509, 510, 5, 42, 0, 0, 510, 514, 1, 0, 0, 0, 511, 513, 9, 0, 0, 0, 512, 511, 1, 0, 0, 0, 513, 516, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 515, 517, 1, 0, 0, 0, 516, 514, 1, 0, 0, 0, 517, 518, 5, 42, 0, 0, 518, 519, 5, 47, 0, 0, 519, 520, 1, 0, 0, 0, 520, 521, 6, 61, 0, 0, 521, 124, 1, 0, 0, 0, 24, 0, 383, 389, 397, 402, 407, 413, 417, 423, 426, 431, 434, 439, 441, 448, 453, 462, 466, 472, 477, 481, 493, 503, 514, 1, 6, 0, 0]
\ No newline at end of file
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.java b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.java
index b34d65225f..f2af56b235 100644
--- a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.java
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.java
@@ -1,2433 +1,479 @@
-// $ANTLR 3.4 Velvet.g 2016-07-17 21:07:31
-/* FeatureIDE - A Framework for Feature-Oriented Software Development
- * Copyright (C) 2005-2019 FeatureIDE team, University of Magdeburg, Germany
- *
- * This file is part of FeatureIDE.
- *
- * FeatureIDE is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * FeatureIDE is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with FeatureIDE. If not, see .
- *
- * See http://featureide.cs.ovgu.de/ for further information.
- */
-package de.ovgu.featureide.fm.core.io.velvet;
-
-import org.antlr.runtime.BaseRecognizer;
-import org.antlr.runtime.CharStream;
-import org.antlr.runtime.DFA;
-import org.antlr.runtime.EarlyExitException;
-import org.antlr.runtime.Lexer;
-import org.antlr.runtime.MismatchedSetException;
-import org.antlr.runtime.NoViableAltException;
-import org.antlr.runtime.RecognitionException;
-import org.antlr.runtime.RecognizerSharedState;
-
-@SuppressWarnings({ "all", "warnings", "unchecked" })
-public class VelvetLexer extends Lexer {
-
- public static final int EOF = -1;
- public static final int ABSTRACT = 4;
- public static final int ACONSTR = 5;
- public static final int ATTR = 6;
- public static final int ATTR_OP_EQUALS = 7;
- public static final int ATTR_OP_GREATER = 8;
- public static final int ATTR_OP_GREATER_EQ = 9;
- public static final int ATTR_OP_LESS = 10;
- public static final int ATTR_OP_LESS_EQ = 11;
- public static final int ATTR_OP_NOT_EQUALS = 12;
- public static final int BASEEXT = 13;
- public static final int BOOLEAN = 14;
- public static final int CINTERFACE = 15;
- public static final int COLON = 16;
- public static final int COMMA = 17;
- public static final int CONCEPT = 18;
- public static final int CONSTR = 19;
- public static final int CONSTRAINT = 20;
- public static final int DEF = 21;
- public static final int DESCRIPTION = 22;
- public static final int EMPTY = 23;
- public static final int END_C = 24;
- public static final int END_R = 25;
- public static final int EQ = 26;
- public static final int ESC_SEQ = 27;
- public static final int EXPONENT = 28;
- public static final int FEATURE = 29;
- public static final int FLOAT = 30;
- public static final int GROUP = 31;
- public static final int HEX_DIGIT = 32;
- public static final int ID = 33;
- public static final int IDPath = 34;
- public static final int IMPORT = 35;
- public static final int IMPORTINSTANCE = 36;
- public static final int IMPORTINTERFACE = 37;
- public static final int INT = 38;
- public static final int MANDATORY = 39;
- public static final int MINUS = 40;
- public static final int ML_COMMENT = 41;
- public static final int OCTAL_ESC = 42;
- public static final int ONEOF = 43;
- public static final int OPERAND = 44;
- public static final int OP_AND = 45;
- public static final int OP_EQUIVALENT = 46;
- public static final int OP_IMPLIES = 47;
- public static final int OP_NOT = 48;
- public static final int OP_OR = 49;
- public static final int OP_XOR = 50;
- public static final int PLUS = 51;
- public static final int SEMI = 52;
- public static final int SL_COMMENT = 53;
- public static final int SOMEOF = 54;
- public static final int START_C = 55;
- public static final int START_R = 56;
- public static final int STRING = 57;
- public static final int UNARYOP = 58;
- public static final int UNICODE_ESC = 59;
- public static final int USE = 60;
- public static final int VAR_BOOL = 61;
- public static final int VAR_FLOAT = 62;
- public static final int VAR_INT = 63;
- public static final int VAR_STRING = 64;
- public static final int WS = 65;
-
- // delegates
- // delegators
- public Lexer[] getDelegates() {
- return new Lexer[] {};
- }
-
- public VelvetLexer() {}
-
- public VelvetLexer(CharStream input) {
- this(input, new RecognizerSharedState());
- }
-
- public VelvetLexer(CharStream input, RecognizerSharedState state) {
- super(input, state);
- }
-
- @Override
- public String getGrammarFileName() {
- return "Velvet.g";
- }
-
- // $ANTLR start "ABSTRACT"
- public final void mABSTRACT() throws RecognitionException {
- try {
- final int _type = ABSTRACT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:4:10: ( 'abstract' )
- // Velvet.g:4:12: 'abstract'
- {
- match("abstract");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ABSTRACT"
-
- // $ANTLR start "ATTR_OP_EQUALS"
- public final void mATTR_OP_EQUALS() throws RecognitionException {
- try {
- final int _type = ATTR_OP_EQUALS;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:5:16: ( '==' )
- // Velvet.g:5:18: '=='
- {
- match("==");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ATTR_OP_EQUALS"
-
- // $ANTLR start "ATTR_OP_GREATER"
- public final void mATTR_OP_GREATER() throws RecognitionException {
- try {
- final int _type = ATTR_OP_GREATER;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:6:17: ( '>' )
- // Velvet.g:6:19: '>'
- {
- match('>');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ATTR_OP_GREATER"
-
- // $ANTLR start "ATTR_OP_GREATER_EQ"
- public final void mATTR_OP_GREATER_EQ() throws RecognitionException {
- try {
- final int _type = ATTR_OP_GREATER_EQ;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:7:20: ( '>=' )
- // Velvet.g:7:22: '>='
- {
- match(">=");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ATTR_OP_GREATER_EQ"
-
- // $ANTLR start "ATTR_OP_LESS"
- public final void mATTR_OP_LESS() throws RecognitionException {
- try {
- final int _type = ATTR_OP_LESS;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:8:14: ( '<' )
- // Velvet.g:8:16: '<'
- {
- match('<');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ATTR_OP_LESS"
-
- // $ANTLR start "ATTR_OP_LESS_EQ"
- public final void mATTR_OP_LESS_EQ() throws RecognitionException {
- try {
- final int _type = ATTR_OP_LESS_EQ;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:9:17: ( '<=' )
- // Velvet.g:9:19: '<='
- {
- match("<=");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ATTR_OP_LESS_EQ"
-
- // $ANTLR start "ATTR_OP_NOT_EQUALS"
- public final void mATTR_OP_NOT_EQUALS() throws RecognitionException {
- try {
- final int _type = ATTR_OP_NOT_EQUALS;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:10:20: ( '!=' )
- // Velvet.g:10:22: '!='
- {
- match("!=");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ATTR_OP_NOT_EQUALS"
-
- // $ANTLR start "CINTERFACE"
- public final void mCINTERFACE() throws RecognitionException {
- try {
- final int _type = CINTERFACE;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:11:12: ( 'cinterface' )
- // Velvet.g:11:14: 'cinterface'
- {
- match("cinterface");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "CINTERFACE"
-
- // $ANTLR start "COLON"
- public final void mCOLON() throws RecognitionException {
- try {
- final int _type = COLON;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:12:7: ( ':' )
- // Velvet.g:12:9: ':'
- {
- match(':');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "COLON"
-
- // $ANTLR start "COMMA"
- public final void mCOMMA() throws RecognitionException {
- try {
- final int _type = COMMA;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:13:7: ( ',' )
- // Velvet.g:13:9: ','
- {
- match(',');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "COMMA"
-
- // $ANTLR start "CONCEPT"
- public final void mCONCEPT() throws RecognitionException {
- try {
- final int _type = CONCEPT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:14:9: ( 'concept' )
- // Velvet.g:14:11: 'concept'
- {
- match("concept");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "CONCEPT"
-
- // $ANTLR start "CONSTRAINT"
- public final void mCONSTRAINT() throws RecognitionException {
- try {
- final int _type = CONSTRAINT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:15:12: ( 'constraint' )
- // Velvet.g:15:14: 'constraint'
- {
- match("constraint");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "CONSTRAINT"
-
- // $ANTLR start "DESCRIPTION"
- public final void mDESCRIPTION() throws RecognitionException {
- try {
- final int _type = DESCRIPTION;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:16:13: ( 'description' )
- // Velvet.g:16:15: 'description'
- {
- match("description");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "DESCRIPTION"
-
- // $ANTLR start "END_C"
- public final void mEND_C() throws RecognitionException {
- try {
- final int _type = END_C;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:17:7: ( '}' )
- // Velvet.g:17:9: '}'
- {
- match('}');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "END_C"
-
- // $ANTLR start "END_R"
- public final void mEND_R() throws RecognitionException {
- try {
- final int _type = END_R;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:18:7: ( ')' )
- // Velvet.g:18:9: ')'
- {
- match(')');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "END_R"
-
- // $ANTLR start "EQ"
- public final void mEQ() throws RecognitionException {
- try {
- final int _type = EQ;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:19:4: ( '=' )
- // Velvet.g:19:6: '='
- {
- match('=');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "EQ"
-
- // $ANTLR start "FEATURE"
- public final void mFEATURE() throws RecognitionException {
- try {
- final int _type = FEATURE;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:20:9: ( 'feature' )
- // Velvet.g:20:11: 'feature'
- {
- match("feature");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "FEATURE"
-
- // $ANTLR start "IMPORT"
- public final void mIMPORT() throws RecognitionException {
- try {
- final int _type = IMPORT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:21:8: ( 'import' )
- // Velvet.g:21:10: 'import'
- {
- match("import");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "IMPORT"
-
- // $ANTLR start "IMPORTINSTANCE"
- public final void mIMPORTINSTANCE() throws RecognitionException {
- try {
- final int _type = IMPORTINSTANCE;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:22:16: ( 'instance' )
- // Velvet.g:22:18: 'instance'
- {
- match("instance");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "IMPORTINSTANCE"
-
- // $ANTLR start "IMPORTINTERFACE"
- public final void mIMPORTINTERFACE() throws RecognitionException {
- try {
- final int _type = IMPORTINTERFACE;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:23:17: ( 'interface' )
- // Velvet.g:23:19: 'interface'
- {
- match("interface");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "IMPORTINTERFACE"
-
- // $ANTLR start "MANDATORY"
- public final void mMANDATORY() throws RecognitionException {
- try {
- final int _type = MANDATORY;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:24:11: ( 'mandatory' )
- // Velvet.g:24:13: 'mandatory'
- {
- match("mandatory");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "MANDATORY"
-
- // $ANTLR start "MINUS"
- public final void mMINUS() throws RecognitionException {
- try {
- final int _type = MINUS;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:25:7: ( '-' )
- // Velvet.g:25:9: '-'
- {
- match('-');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "MINUS"
-
- // $ANTLR start "ONEOF"
- public final void mONEOF() throws RecognitionException {
- try {
- final int _type = ONEOF;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:26:7: ( 'oneOf' )
- // Velvet.g:26:9: 'oneOf'
- {
- match("oneOf");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ONEOF"
-
- // $ANTLR start "OP_AND"
- public final void mOP_AND() throws RecognitionException {
- try {
- final int _type = OP_AND;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:27:8: ( '&&' )
- // Velvet.g:27:10: '&&'
- {
- match("&&");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "OP_AND"
-
- // $ANTLR start "OP_EQUIVALENT"
- public final void mOP_EQUIVALENT() throws RecognitionException {
- try {
- final int _type = OP_EQUIVALENT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:28:15: ( '<->' )
- // Velvet.g:28:17: '<->'
- {
- match("<->");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "OP_EQUIVALENT"
-
- // $ANTLR start "OP_IMPLIES"
- public final void mOP_IMPLIES() throws RecognitionException {
- try {
- final int _type = OP_IMPLIES;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:29:12: ( '->' )
- // Velvet.g:29:14: '->'
- {
- match("->");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "OP_IMPLIES"
-
- // $ANTLR start "OP_NOT"
- public final void mOP_NOT() throws RecognitionException {
- try {
- final int _type = OP_NOT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:30:8: ( '!' )
- // Velvet.g:30:10: '!'
- {
- match('!');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "OP_NOT"
-
- // $ANTLR start "OP_OR"
- public final void mOP_OR() throws RecognitionException {
- try {
- final int _type = OP_OR;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:31:7: ( '||' )
- // Velvet.g:31:9: '||'
- {
- match("||");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "OP_OR"
-
- // $ANTLR start "OP_XOR"
- public final void mOP_XOR() throws RecognitionException {
- try {
- final int _type = OP_XOR;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:32:8: ( 'xor' )
- // Velvet.g:32:10: 'xor'
- {
- match("xor");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "OP_XOR"
-
- // $ANTLR start "PLUS"
- public final void mPLUS() throws RecognitionException {
- try {
- final int _type = PLUS;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:33:6: ( '+' )
- // Velvet.g:33:8: '+'
- {
- match('+');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "PLUS"
-
- // $ANTLR start "SEMI"
- public final void mSEMI() throws RecognitionException {
- try {
- final int _type = SEMI;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:34:6: ( ';' )
- // Velvet.g:34:8: ';'
- {
- match(';');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "SEMI"
-
- // $ANTLR start "SOMEOF"
- public final void mSOMEOF() throws RecognitionException {
- try {
- final int _type = SOMEOF;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:35:8: ( 'someOf' )
- // Velvet.g:35:10: 'someOf'
- {
- match("someOf");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "SOMEOF"
-
- // $ANTLR start "START_C"
- public final void mSTART_C() throws RecognitionException {
- try {
- final int _type = START_C;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:36:9: ( '{' )
- // Velvet.g:36:11: '{'
- {
- match('{');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "START_C"
-
- // $ANTLR start "START_R"
- public final void mSTART_R() throws RecognitionException {
- try {
- final int _type = START_R;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:37:9: ( '(' )
- // Velvet.g:37:11: '('
- {
- match('(');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "START_R"
-
- // $ANTLR start "USE"
- public final void mUSE() throws RecognitionException {
- try {
- final int _type = USE;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:38:5: ( 'use' )
- // Velvet.g:38:7: 'use'
- {
- match("use");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "USE"
-
- // $ANTLR start "VAR_BOOL"
- public final void mVAR_BOOL() throws RecognitionException {
- try {
- final int _type = VAR_BOOL;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:39:10: ( 'bool' )
- // Velvet.g:39:12: 'bool'
- {
- match("bool");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "VAR_BOOL"
-
- // $ANTLR start "VAR_FLOAT"
- public final void mVAR_FLOAT() throws RecognitionException {
- try {
- final int _type = VAR_FLOAT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:40:11: ( 'float' )
- // Velvet.g:40:13: 'float'
- {
- match("float");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "VAR_FLOAT"
-
- // $ANTLR start "VAR_INT"
- public final void mVAR_INT() throws RecognitionException {
- try {
- final int _type = VAR_INT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:41:9: ( 'int' )
- // Velvet.g:41:11: 'int'
- {
- match("int");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "VAR_INT"
-
- // $ANTLR start "VAR_STRING"
- public final void mVAR_STRING() throws RecognitionException {
- try {
- final int _type = VAR_STRING;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:42:12: ( 'string' )
- // Velvet.g:42:14: 'string'
- {
- match("string");
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "VAR_STRING"
-
- // $ANTLR start "BOOLEAN"
- public final void mBOOLEAN() throws RecognitionException {
- try {
- final int _type = BOOLEAN;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:241:9: ( 'true' | 'false' )
- int alt1 = 2;
- final int LA1_0 = input.LA(1);
-
- if ((LA1_0 == 't')) {
- alt1 = 1;
- } else if ((LA1_0 == 'f')) {
- alt1 = 2;
- } else {
- final NoViableAltException nvae = new NoViableAltException("", 1, 0, input);
-
- throw nvae;
-
- }
- switch (alt1) {
- case 1:
- // Velvet.g:241:11: 'true'
- {
- match("true");
-
- }
- break;
- case 2:
- // Velvet.g:242:4: 'false'
- {
- match("false");
-
- }
- break;
-
- }
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "BOOLEAN"
-
- // $ANTLR start "ID"
- public final void mID() throws RecognitionException {
- try {
- final int _type = ID;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:245:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '-' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '-' )* )
- // Velvet.g:245:7: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '-' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '-' )*
- {
- if ((input.LA(1) == '-') || ((input.LA(1) >= 'A') && (input.LA(1) <= 'Z')) || (input.LA(1) == '_')
- || ((input.LA(1) >= 'a') && (input.LA(1) <= 'z'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- // Velvet.g:245:35: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '-' )*
- loop2: do {
- int alt2 = 2;
- final int LA2_0 = input.LA(1);
-
- if (((LA2_0 == '-') || ((LA2_0 >= '0') && (LA2_0 <= '9')) || ((LA2_0 >= 'A') && (LA2_0 <= 'Z')) || (LA2_0 == '_')
- || ((LA2_0 >= 'a') && (LA2_0 <= 'z')))) {
- alt2 = 1;
- }
-
- switch (alt2) {
- case 1:
- // Velvet.g:
- {
- if ((input.LA(1) == '-') || ((input.LA(1) >= '0') && (input.LA(1) <= '9')) || ((input.LA(1) >= 'A') && (input.LA(1) <= 'Z'))
- || (input.LA(1) == '_') || ((input.LA(1) >= 'a') && (input.LA(1) <= 'z'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- break loop2;
- }
- } while (true);
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "ID"
-
- // $ANTLR start "IDPath"
- public final void mIDPath() throws RecognitionException {
- try {
- final int _type = IDPath;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:248:8: ( ID ( '.' ID )+ )
- // Velvet.g:248:10: ID ( '.' ID )+
- {
- mID();
-
- // Velvet.g:248:13: ( '.' ID )+
- int cnt3 = 0;
- loop3: do {
- int alt3 = 2;
- final int LA3_0 = input.LA(1);
-
- if ((LA3_0 == '.')) {
- alt3 = 1;
- }
-
- switch (alt3) {
- case 1:
- // Velvet.g:248:14: '.' ID
- {
- match('.');
-
- mID();
-
- }
- break;
-
- default:
- if (cnt3 >= 1) {
- break loop3;
- }
- final EarlyExitException eee = new EarlyExitException(3, input);
- throw eee;
- }
- cnt3++;
- } while (true);
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "IDPath"
-
- // $ANTLR start "INT"
- public final void mINT() throws RecognitionException {
- try {
- final int _type = INT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:251:5: ( ( '0' .. '9' )+ )
- // Velvet.g:251:7: ( '0' .. '9' )+
- {
- // Velvet.g:251:7: ( '0' .. '9' )+
- int cnt4 = 0;
- loop4: do {
- int alt4 = 2;
- final int LA4_0 = input.LA(1);
-
- if ((((LA4_0 >= '0') && (LA4_0 <= '9')))) {
- alt4 = 1;
- }
-
- switch (alt4) {
- case 1:
- // Velvet.g:
- {
- if (((input.LA(1) >= '0') && (input.LA(1) <= '9'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- if (cnt4 >= 1) {
- break loop4;
- }
- final EarlyExitException eee = new EarlyExitException(4, input);
- throw eee;
- }
- cnt4++;
- } while (true);
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "INT"
-
- // $ANTLR start "FLOAT"
- public final void mFLOAT() throws RecognitionException {
- try {
- final int _type = FLOAT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:255:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )
- int alt11 = 3;
- alt11 = dfa11.predict(input);
- switch (alt11) {
- case 1:
- // Velvet.g:255:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )?
- {
- // Velvet.g:255:9: ( '0' .. '9' )+
- int cnt5 = 0;
- loop5: do {
- int alt5 = 2;
- final int LA5_0 = input.LA(1);
-
- if ((((LA5_0 >= '0') && (LA5_0 <= '9')))) {
- alt5 = 1;
- }
-
- switch (alt5) {
- case 1:
- // Velvet.g:
- {
- if (((input.LA(1) >= '0') && (input.LA(1) <= '9'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- if (cnt5 >= 1) {
- break loop5;
- }
- final EarlyExitException eee = new EarlyExitException(5, input);
- throw eee;
- }
- cnt5++;
- } while (true);
-
- match('.');
-
- // Velvet.g:255:25: ( '0' .. '9' )*
- loop6: do {
- int alt6 = 2;
- final int LA6_0 = input.LA(1);
-
- if ((((LA6_0 >= '0') && (LA6_0 <= '9')))) {
- alt6 = 1;
- }
-
- switch (alt6) {
- case 1:
- // Velvet.g:
- {
- if (((input.LA(1) >= '0') && (input.LA(1) <= '9'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- break loop6;
- }
- } while (true);
-
- // Velvet.g:255:37: ( EXPONENT )?
- int alt7 = 2;
- final int LA7_0 = input.LA(1);
-
- if (((LA7_0 == 'E') || (LA7_0 == 'e'))) {
- alt7 = 1;
- }
- switch (alt7) {
- case 1:
- // Velvet.g:255:37: EXPONENT
- {
- mEXPONENT();
-
- }
- break;
-
- }
-
- }
- break;
- case 2:
- // Velvet.g:256:9: '.' ( '0' .. '9' )+ ( EXPONENT )?
- {
- match('.');
+// Generated from Velvet.g4 by ANTLR 4.13.2
- // Velvet.g:256:13: ( '0' .. '9' )+
- int cnt8 = 0;
- loop8: do {
- int alt8 = 2;
- final int LA8_0 = input.LA(1);
-
- if ((((LA8_0 >= '0') && (LA8_0 <= '9')))) {
- alt8 = 1;
- }
-
- switch (alt8) {
- case 1:
- // Velvet.g:
- {
- if (((input.LA(1) >= '0') && (input.LA(1) <= '9'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- if (cnt8 >= 1) {
- break loop8;
- }
- final EarlyExitException eee = new EarlyExitException(8, input);
- throw eee;
- }
- cnt8++;
- } while (true);
-
- // Velvet.g:256:25: ( EXPONENT )?
- int alt9 = 2;
- final int LA9_0 = input.LA(1);
-
- if (((LA9_0 == 'E') || (LA9_0 == 'e'))) {
- alt9 = 1;
- }
- switch (alt9) {
- case 1:
- // Velvet.g:256:25: EXPONENT
- {
- mEXPONENT();
-
- }
- break;
-
- }
-
- }
- break;
- case 3:
- // Velvet.g:257:9: ( '0' .. '9' )+ EXPONENT
- {
- // Velvet.g:257:9: ( '0' .. '9' )+
- int cnt10 = 0;
- loop10: do {
- int alt10 = 2;
- final int LA10_0 = input.LA(1);
-
- if ((((LA10_0 >= '0') && (LA10_0 <= '9')))) {
- alt10 = 1;
- }
-
- switch (alt10) {
- case 1:
- // Velvet.g:
- {
- if (((input.LA(1) >= '0') && (input.LA(1) <= '9'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- if (cnt10 >= 1) {
- break loop10;
- }
- final EarlyExitException eee = new EarlyExitException(10, input);
- throw eee;
- }
- cnt10++;
- } while (true);
-
- mEXPONENT();
-
- }
- break;
-
- }
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "FLOAT"
-
- // $ANTLR start "STRING"
- public final void mSTRING() throws RecognitionException {
- try {
- final int _type = STRING;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:261:5: ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' )
- // Velvet.g:261:8: '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"'
- {
- match('\"');
-
- // Velvet.g:261:12: ( ESC_SEQ |~ ( '\\\\' | '\"' ) )*
- loop12: do {
- int alt12 = 3;
- final int LA12_0 = input.LA(1);
-
- if ((LA12_0 == '\\')) {
- alt12 = 1;
- } else
- if ((((LA12_0 >= '\u0000') && (LA12_0 <= '!')) || ((LA12_0 >= '#') && (LA12_0 <= '[')) || ((LA12_0 >= ']') && (LA12_0 <= '\uFFFF')))) {
- alt12 = 2;
- }
-
- switch (alt12) {
- case 1:
- // Velvet.g:261:14: ESC_SEQ
- {
- mESC_SEQ();
-
- }
- break;
- case 2:
- // Velvet.g:261:24: ~ ( '\\\\' | '\"' )
- {
- if (((input.LA(1) >= '\u0000') && (input.LA(1) <= '!')) || ((input.LA(1) >= '#') && (input.LA(1) <= '['))
- || ((input.LA(1) >= ']') && (input.LA(1) <= '\uFFFF'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- break loop12;
- }
- } while (true);
-
- match('\"');
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "STRING"
-
- // $ANTLR start "EXPONENT"
- public final void mEXPONENT() throws RecognitionException {
- try {
- // Velvet.g:266:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
- // Velvet.g:266:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
- {
- if ((input.LA(1) == 'E') || (input.LA(1) == 'e')) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- // Velvet.g:266:22: ( '+' | '-' )?
- int alt13 = 2;
- final int LA13_0 = input.LA(1);
-
- if (((LA13_0 == '+') || (LA13_0 == '-'))) {
- alt13 = 1;
- }
- switch (alt13) {
- case 1:
- // Velvet.g:
- {
- if ((input.LA(1) == '+') || (input.LA(1) == '-')) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- }
-
- // Velvet.g:266:33: ( '0' .. '9' )+
- int cnt14 = 0;
- loop14: do {
- int alt14 = 2;
- final int LA14_0 = input.LA(1);
-
- if ((((LA14_0 >= '0') && (LA14_0 <= '9')))) {
- alt14 = 1;
- }
-
- switch (alt14) {
- case 1:
- // Velvet.g:
- {
- if (((input.LA(1) >= '0') && (input.LA(1) <= '9'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- if (cnt14 >= 1) {
- break loop14;
- }
- final EarlyExitException eee = new EarlyExitException(14, input);
- throw eee;
- }
- cnt14++;
- } while (true);
-
- }
-
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "EXPONENT"
-
- // $ANTLR start "HEX_DIGIT"
- public final void mHEX_DIGIT() throws RecognitionException {
- try {
- // Velvet.g:269:11: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
- // Velvet.g:
- {
- if (((input.LA(1) >= '0') && (input.LA(1) <= '9')) || ((input.LA(1) >= 'A') && (input.LA(1) <= 'F'))
- || ((input.LA(1) >= 'a') && (input.LA(1) <= 'f'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
-
- } finally {
- // do for sure before leaving
- }
- }
- // $ANTLR end "HEX_DIGIT"
-
- // $ANTLR start "ESC_SEQ"
- public final void mESC_SEQ() throws RecognitionException {
- try {
- // Velvet.g:273:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESC | OCTAL_ESC )
- int alt15 = 3;
- final int LA15_0 = input.LA(1);
-
- if ((LA15_0 == '\\')) {
- switch (input.LA(2)) {
- case '\"':
- case '\'':
- case '\\':
- case 'b':
- case 'f':
- case 'n':
- case 'r':
- case 't': {
- alt15 = 1;
- }
- break;
- case 'u': {
- alt15 = 2;
- }
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7': {
- alt15 = 3;
- }
- break;
- default:
- final NoViableAltException nvae = new NoViableAltException("", 15, 1, input);
-
- throw nvae;
-
- }
-
- } else {
- final NoViableAltException nvae = new NoViableAltException("", 15, 0, input);
-
- throw nvae;
-
- }
- switch (alt15) {
- case 1:
- // Velvet.g:273:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
- {
- match('\\');
-
- if ((input.LA(1) == '\"') || (input.LA(1) == '\'') || (input.LA(1) == '\\') || (input.LA(1) == 'b') || (input.LA(1) == 'f')
- || (input.LA(1) == 'n') || (input.LA(1) == 'r') || (input.LA(1) == 't')) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
- case 2:
- // Velvet.g:274:9: UNICODE_ESC
- {
- mUNICODE_ESC();
-
- }
- break;
- case 3:
- // Velvet.g:275:9: OCTAL_ESC
- {
- mOCTAL_ESC();
+package de.ovgu.featureide.fm.core.io.velvet;
+import de.ovgu.featureide.fm.core.FMCorePlugin;
+import org.antlr.v4.runtime.Lexer;
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.TokenStream;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.atn.*;
+import org.antlr.v4.runtime.dfa.DFA;
+import org.antlr.v4.runtime.misc.*;
+
+@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"})
+public class VelvetLexer extends Lexer {
+ static { RuntimeMetaData.checkVersion("4.13.2", RuntimeMetaData.VERSION); }
+
+ protected static final DFA[] _decisionToDFA;
+ protected static final PredictionContextCache _sharedContextCache =
+ new PredictionContextCache();
+ public static final int
+ IMPORT=1, MANDATORY=2, ABSTRACT=3, SOMEOF=4, ONEOF=5, CONCEPT=6, CINTERFACE=7,
+ CONSTRAINT=8, FEATURE=9, USE=10, IMPORTINSTANCE=11, IMPORTINTERFACE=12,
+ DESCRIPTION=13, VAR_INT=14, VAR_FLOAT=15, VAR_STRING=16, VAR_BOOL=17,
+ SEMI=18, START_C=19, END_C=20, START_R=21, END_R=22, EQ=23, COMMA=24,
+ COLON=25, PLUS=26, MINUS=27, OP_NOT=28, OP_AND=29, OP_OR=30, OP_XOR=31,
+ OP_IMPLIES=32, OP_EQUIVALENT=33, ATTR_OP_EQUALS=34, ATTR_OP_NOT_EQUALS=35,
+ ATTR_OP_GREATER=36, ATTR_OP_LESS=37, ATTR_OP_GREATER_EQ=38, ATTR_OP_LESS_EQ=39,
+ EMPTY=40, CONSTR=41, ACONSTR=42, BASEEXT=43, DEF=44, GROUP=45, ATTR=46,
+ UNARYOP=47, OPERAND=48, BOOLEAN=49, ID=50, IDPath=51, INT=52, FLOAT=53,
+ STRING=54, WS=55, SL_COMMENT=56, ML_COMMENT=57;
+ public static String[] channelNames = {
+ "DEFAULT_TOKEN_CHANNEL", "HIDDEN"
+ };
+
+ public static String[] modeNames = {
+ "DEFAULT_MODE"
+ };
+
+ private static String[] makeRuleNames() {
+ return new String[] {
+ "IMPORT", "MANDATORY", "ABSTRACT", "SOMEOF", "ONEOF", "CONCEPT", "CINTERFACE",
+ "CONSTRAINT", "FEATURE", "USE", "IMPORTINSTANCE", "IMPORTINTERFACE",
+ "DESCRIPTION", "VAR_INT", "VAR_FLOAT", "VAR_STRING", "VAR_BOOL", "SEMI",
+ "START_C", "END_C", "START_R", "END_R", "EQ", "COMMA", "COLON", "PLUS",
+ "MINUS", "OP_NOT", "OP_AND", "OP_OR", "OP_XOR", "OP_IMPLIES", "OP_EQUIVALENT",
+ "ATTR_OP_EQUALS", "ATTR_OP_NOT_EQUALS", "ATTR_OP_GREATER", "ATTR_OP_LESS",
+ "ATTR_OP_GREATER_EQ", "ATTR_OP_LESS_EQ", "EMPTY", "CONSTR", "ACONSTR",
+ "BASEEXT", "DEF", "GROUP", "ATTR", "UNARYOP", "OPERAND", "BOOLEAN", "ID",
+ "IDPath", "INT", "FLOAT", "STRING", "EXPONENT", "HEX_DIGIT", "ESC_SEQ",
+ "OCTAL_ESC", "UNICODE_ESC", "WS", "SL_COMMENT", "ML_COMMENT"
+ };
+ }
+ public static final String[] ruleNames = makeRuleNames();
+
+ private static String[] makeLiteralNames() {
+ return new String[] {
+ null, "'import'", "'mandatory'", "'abstract'", "'someOf'", "'oneOf'",
+ "'concept'", "'cinterface'", "'constraint'", "'feature'", "'use'", "'instance'",
+ "'interface'", "'description'", "'int'", "'float'", "'string'", "'bool'",
+ "';'", "'{'", "'}'", "'('", "')'", "'='", "','", "':'", "'+'", "'-'",
+ "'!'", "'&&'", "'||'", "'xor'", "'->'", "'<->'", "'=='", "'!='", "'>'",
+ "'<'", "'>='", "'<='", "'EMPTY'", "'CONSTR'", "'ACONSTR'", "'BASEEXT'",
+ "'DEF'", "'GROUP'", "'ATTR'", "'UNARYOP'", "'OPERAND'"
+ };
+ }
+ private static final String[] _LITERAL_NAMES = makeLiteralNames();
+ private static String[] makeSymbolicNames() {
+ return new String[] {
+ null, "IMPORT", "MANDATORY", "ABSTRACT", "SOMEOF", "ONEOF", "CONCEPT",
+ "CINTERFACE", "CONSTRAINT", "FEATURE", "USE", "IMPORTINSTANCE", "IMPORTINTERFACE",
+ "DESCRIPTION", "VAR_INT", "VAR_FLOAT", "VAR_STRING", "VAR_BOOL", "SEMI",
+ "START_C", "END_C", "START_R", "END_R", "EQ", "COMMA", "COLON", "PLUS",
+ "MINUS", "OP_NOT", "OP_AND", "OP_OR", "OP_XOR", "OP_IMPLIES", "OP_EQUIVALENT",
+ "ATTR_OP_EQUALS", "ATTR_OP_NOT_EQUALS", "ATTR_OP_GREATER", "ATTR_OP_LESS",
+ "ATTR_OP_GREATER_EQ", "ATTR_OP_LESS_EQ", "EMPTY", "CONSTR", "ACONSTR",
+ "BASEEXT", "DEF", "GROUP", "ATTR", "UNARYOP", "OPERAND", "BOOLEAN", "ID",
+ "IDPath", "INT", "FLOAT", "STRING", "WS", "SL_COMMENT", "ML_COMMENT"
+ };
+ }
+ private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
+ public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
+
+ /**
+ * @deprecated Use {@link #VOCABULARY} instead.
+ */
+ @Deprecated
+ public static final String[] tokenNames;
+ static {
+ tokenNames = new String[_SYMBOLIC_NAMES.length];
+ for (int i = 0; i < tokenNames.length; i++) {
+ tokenNames[i] = VOCABULARY.getLiteralName(i);
+ if (tokenNames[i] == null) {
+ tokenNames[i] = VOCABULARY.getSymbolicName(i);
}
- break;
+ if (tokenNames[i] == null) {
+ tokenNames[i] = "";
}
-
- } finally {
- // do for sure before leaving
}
}
- // $ANTLR end "ESC_SEQ"
-
- // $ANTLR start "OCTAL_ESC"
- public final void mOCTAL_ESC() throws RecognitionException {
- try {
- // Velvet.g:280:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
- int alt16 = 3;
- final int LA16_0 = input.LA(1);
-
- if ((LA16_0 == '\\')) {
- final int LA16_1 = input.LA(2);
-
- if ((((LA16_1 >= '0') && (LA16_1 <= '3')))) {
- final int LA16_2 = input.LA(3);
-
- if ((((LA16_2 >= '0') && (LA16_2 <= '7')))) {
- final int LA16_4 = input.LA(4);
-
- if ((((LA16_4 >= '0') && (LA16_4 <= '7')))) {
- alt16 = 1;
- } else {
- alt16 = 2;
- }
- } else {
- alt16 = 3;
- }
- } else if ((((LA16_1 >= '4') && (LA16_1 <= '7')))) {
- final int LA16_3 = input.LA(3);
-
- if ((((LA16_3 >= '0') && (LA16_3 <= '7')))) {
- alt16 = 2;
- } else {
- alt16 = 3;
- }
- } else {
- final NoViableAltException nvae = new NoViableAltException("", 16, 1, input);
-
- throw nvae;
-
- }
- } else {
- final NoViableAltException nvae = new NoViableAltException("", 16, 0, input);
-
- throw nvae;
-
- }
- switch (alt16) {
- case 1:
- // Velvet.g:280:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
- {
- match('\\');
-
- if (((input.LA(1) >= '0') && (input.LA(1) <= '3'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- if (((input.LA(1) >= '0') && (input.LA(1) <= '7'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- if (((input.LA(1) >= '0') && (input.LA(1) <= '7'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
- case 2:
- // Velvet.g:281:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
- {
- match('\\');
-
- if (((input.LA(1) >= '0') && (input.LA(1) <= '7'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- if (((input.LA(1) >= '0') && (input.LA(1) <= '7'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
- case 3:
- // Velvet.g:282:9: '\\\\' ( '0' .. '7' )
- {
- match('\\');
-
- if (((input.LA(1) >= '0') && (input.LA(1) <= '7'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- }
- } finally {
- // do for sure before leaving
- }
+ @Override
+ @Deprecated
+ public String[] getTokenNames() {
+ return tokenNames;
}
- // $ANTLR end "OCTAL_ESC"
-
- // $ANTLR start "UNICODE_ESC"
- public final void mUNICODE_ESC() throws RecognitionException {
- try {
- // Velvet.g:287:5: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT )
- // Velvet.g:287:9: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
- {
- match('\\');
-
- match('u');
-
- mHEX_DIGIT();
-
- mHEX_DIGIT();
-
- mHEX_DIGIT();
- mHEX_DIGIT();
-
- }
+ @Override
- } finally {
- // do for sure before leaving
- }
+ public Vocabulary getVocabulary() {
+ return VOCABULARY;
}
- // $ANTLR end "UNICODE_ESC"
- // $ANTLR start "WS"
- public final void mWS() throws RecognitionException {
- try {
- final int _type = WS;
- int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:289:5: ( ( ' ' | '\\t' | '\\r' | '\\n' ) )
- // Velvet.g:289:7: ( ' ' | '\\t' | '\\r' | '\\n' )
- {
- if (((input.LA(1) >= '\t') && (input.LA(1) <= '\n')) || (input.LA(1) == '\r') || (input.LA(1) == ' ')) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
- _channel = HIDDEN;
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
+ public class InternalSyntaxException extends RuntimeException{
+ private final RecognitionException e;
+ public InternalSyntaxException(RecognitionException e){
+ this.e = e;
}
- }
- // $ANTLR end "WS"
-
- // $ANTLR start "SL_COMMENT"
- public final void mSL_COMMENT() throws RecognitionException {
- try {
- final int _type = SL_COMMENT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:296:12: ( ( '//' (~ ( '\\r' | '\\n' ) )* ) )
- // Velvet.g:296:14: ( '//' (~ ( '\\r' | '\\n' ) )* )
- {
- // Velvet.g:296:14: ( '//' (~ ( '\\r' | '\\n' ) )* )
- // Velvet.g:296:15: '//' (~ ( '\\r' | '\\n' ) )*
- {
- match("//");
-
- // Velvet.g:296:20: (~ ( '\\r' | '\\n' ) )*
- loop17: do {
- int alt17 = 2;
- final int LA17_0 = input.LA(1);
-
- if ((((LA17_0 >= '\u0000') && (LA17_0 <= '\t')) || ((LA17_0 >= '\u000B') && (LA17_0 <= '\f'))
- || ((LA17_0 >= '\u000E') && (LA17_0 <= '\uFFFF')))) {
- alt17 = 1;
- }
-
- switch (alt17) {
- case 1:
- // Velvet.g:
- {
- if (((input.LA(1) >= '\u0000') && (input.LA(1) <= '\t')) || ((input.LA(1) >= '\u000B') && (input.LA(1) <= '\f'))
- || ((input.LA(1) >= '\u000E') && (input.LA(1) <= '\uFFFF'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
-
- default:
- break loop17;
- }
- } while (true);
-
- }
-
- skip();
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
+
+ public RecognitionException getException(){
+ return e;
}
}
- // $ANTLR end "SL_COMMENT"
-
- // $ANTLR start "ML_COMMENT"
- public final void mML_COMMENT() throws RecognitionException {
- try {
- final int _type = ML_COMMENT;
- final int _channel = DEFAULT_TOKEN_CHANNEL;
- // Velvet.g:298:12: ( ( '/*' (~ ( '*/' ) )* ) )
- // Velvet.g:298:14: ( '/*' (~ ( '*/' ) )* )
- {
- // Velvet.g:298:14: ( '/*' (~ ( '*/' ) )* )
- // Velvet.g:298:15: '/*' (~ ( '*/' ) )*
- {
- match("/*");
-
- // Velvet.g:298:20: (~ ( '*/' ) )*
- loop18: do {
- int alt18 = 2;
- final int LA18_0 = input.LA(1);
-
- if ((((LA18_0 >= '\u0000') && (LA18_0 <= '\uFFFF')))) {
- alt18 = 1;
- }
-
- switch (alt18) {
- case 1:
- // Velvet.g:298:20: ~ ( '*/' )
- {
- if (((input.LA(1) >= '\u0000') && (input.LA(1) <= '\uFFFF'))) {
- input.consume();
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- recover(mse);
- throw mse;
- }
-
- }
- break;
- default:
- break loop18;
- }
- } while (true);
- }
-
- skip();
-
- }
-
- state.type = _type;
- state.channel = _channel;
- } finally {
- // do for sure before leaving
- }
+ public VelvetLexer(CharStream input) {
+ super(input);
+ _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
- // $ANTLR end "ML_COMMENT"
@Override
- public void mTokens() throws RecognitionException {
- // Velvet.g:1:8: ( ABSTRACT | ATTR_OP_EQUALS | ATTR_OP_GREATER | ATTR_OP_GREATER_EQ | ATTR_OP_LESS | ATTR_OP_LESS_EQ | ATTR_OP_NOT_EQUALS | CINTERFACE |
- // COLON | COMMA | CONCEPT | CONSTRAINT | DESCRIPTION | END_C | END_R | EQ | FEATURE | IMPORT | IMPORTINSTANCE | IMPORTINTERFACE | MANDATORY | MINUS |
- // ONEOF | OP_AND | OP_EQUIVALENT | OP_IMPLIES | OP_NOT | OP_OR | OP_XOR | PLUS | SEMI | SOMEOF | START_C | START_R | USE | VAR_BOOL | VAR_FLOAT |
- // VAR_INT | VAR_STRING | BOOLEAN | ID | IDPath | INT | FLOAT | STRING | WS | SL_COMMENT | ML_COMMENT )
- int alt19 = 48;
- alt19 = dfa19.predict(input);
- switch (alt19) {
- case 1:
- // Velvet.g:1:10: ABSTRACT
- {
- mABSTRACT();
-
- }
- break;
- case 2:
- // Velvet.g:1:19: ATTR_OP_EQUALS
- {
- mATTR_OP_EQUALS();
-
- }
- break;
- case 3:
- // Velvet.g:1:34: ATTR_OP_GREATER
- {
- mATTR_OP_GREATER();
-
- }
- break;
- case 4:
- // Velvet.g:1:50: ATTR_OP_GREATER_EQ
- {
- mATTR_OP_GREATER_EQ();
-
- }
- break;
- case 5:
- // Velvet.g:1:69: ATTR_OP_LESS
- {
- mATTR_OP_LESS();
-
- }
- break;
- case 6:
- // Velvet.g:1:82: ATTR_OP_LESS_EQ
- {
- mATTR_OP_LESS_EQ();
-
- }
- break;
- case 7:
- // Velvet.g:1:98: ATTR_OP_NOT_EQUALS
- {
- mATTR_OP_NOT_EQUALS();
-
- }
- break;
- case 8:
- // Velvet.g:1:117: CINTERFACE
- {
- mCINTERFACE();
-
- }
- break;
- case 9:
- // Velvet.g:1:128: COLON
- {
- mCOLON();
-
- }
- break;
- case 10:
- // Velvet.g:1:134: COMMA
- {
- mCOMMA();
-
- }
- break;
- case 11:
- // Velvet.g:1:140: CONCEPT
- {
- mCONCEPT();
-
- }
- break;
- case 12:
- // Velvet.g:1:148: CONSTRAINT
- {
- mCONSTRAINT();
-
- }
- break;
- case 13:
- // Velvet.g:1:159: DESCRIPTION
- {
- mDESCRIPTION();
-
- }
- break;
- case 14:
- // Velvet.g:1:171: END_C
- {
- mEND_C();
-
- }
- break;
- case 15:
- // Velvet.g:1:177: END_R
- {
- mEND_R();
-
- }
- break;
- case 16:
- // Velvet.g:1:183: EQ
- {
- mEQ();
-
- }
- break;
- case 17:
- // Velvet.g:1:186: FEATURE
- {
- mFEATURE();
-
- }
- break;
- case 18:
- // Velvet.g:1:194: IMPORT
- {
- mIMPORT();
-
- }
- break;
- case 19:
- // Velvet.g:1:201: IMPORTINSTANCE
- {
- mIMPORTINSTANCE();
-
- }
- break;
- case 20:
- // Velvet.g:1:216: IMPORTINTERFACE
- {
- mIMPORTINTERFACE();
-
- }
- break;
- case 21:
- // Velvet.g:1:232: MANDATORY
- {
- mMANDATORY();
-
- }
- break;
- case 22:
- // Velvet.g:1:242: MINUS
- {
- mMINUS();
-
- }
- break;
- case 23:
- // Velvet.g:1:248: ONEOF
- {
- mONEOF();
-
- }
- break;
- case 24:
- // Velvet.g:1:254: OP_AND
- {
- mOP_AND();
-
- }
- break;
- case 25:
- // Velvet.g:1:261: OP_EQUIVALENT
- {
- mOP_EQUIVALENT();
-
- }
- break;
- case 26:
- // Velvet.g:1:275: OP_IMPLIES
- {
- mOP_IMPLIES();
-
- }
- break;
- case 27:
- // Velvet.g:1:286: OP_NOT
- {
- mOP_NOT();
-
- }
- break;
- case 28:
- // Velvet.g:1:293: OP_OR
- {
- mOP_OR();
-
- }
- break;
- case 29:
- // Velvet.g:1:299: OP_XOR
- {
- mOP_XOR();
-
- }
- break;
- case 30:
- // Velvet.g:1:306: PLUS
- {
- mPLUS();
+ public String getGrammarFileName() { return "Velvet.g4"; }
- }
- break;
- case 31:
- // Velvet.g:1:311: SEMI
- {
- mSEMI();
-
- }
- break;
- case 32:
- // Velvet.g:1:316: SOMEOF
- {
- mSOMEOF();
-
- }
- break;
- case 33:
- // Velvet.g:1:323: START_C
- {
- mSTART_C();
-
- }
- break;
- case 34:
- // Velvet.g:1:331: START_R
- {
- mSTART_R();
-
- }
- break;
- case 35:
- // Velvet.g:1:339: USE
- {
- mUSE();
-
- }
- break;
- case 36:
- // Velvet.g:1:343: VAR_BOOL
- {
- mVAR_BOOL();
-
- }
- break;
- case 37:
- // Velvet.g:1:352: VAR_FLOAT
- {
- mVAR_FLOAT();
-
- }
- break;
- case 38:
- // Velvet.g:1:362: VAR_INT
- {
- mVAR_INT();
-
- }
- break;
- case 39:
- // Velvet.g:1:370: VAR_STRING
- {
- mVAR_STRING();
-
- }
- break;
- case 40:
- // Velvet.g:1:381: BOOLEAN
- {
- mBOOLEAN();
-
- }
- break;
- case 41:
- // Velvet.g:1:389: ID
- {
- mID();
-
- }
- break;
- case 42:
- // Velvet.g:1:392: IDPath
- {
- mIDPath();
-
- }
- break;
- case 43:
- // Velvet.g:1:399: INT
- {
- mINT();
-
- }
- break;
- case 44:
- // Velvet.g:1:403: FLOAT
- {
- mFLOAT();
-
- }
- break;
- case 45:
- // Velvet.g:1:409: STRING
- {
- mSTRING();
-
- }
- break;
- case 46:
- // Velvet.g:1:416: WS
- {
- mWS();
-
- }
- break;
- case 47:
- // Velvet.g:1:419: SL_COMMENT
- {
- mSL_COMMENT();
-
- }
- break;
- case 48:
- // Velvet.g:1:430: ML_COMMENT
- {
- mML_COMMENT();
-
- }
- break;
-
- }
-
- }
-
- protected DFA11 dfa11 = new DFA11(this);
- protected DFA19 dfa19 = new DFA19(this);
- static final String DFA11_eotS = "\5\uffff";
- static final String DFA11_eofS = "\5\uffff";
- static final String DFA11_minS = "\2\56\3\uffff";
- static final String DFA11_maxS = "\1\71\1\145\3\uffff";
- static final String DFA11_acceptS = "\2\uffff\1\2\1\1\1\3";
- static final String DFA11_specialS = "\5\uffff}>";
- static final String[] DFA11_transitionS = { "\1\2\1\uffff\12\1", "\1\3\1\uffff\12\1\13\uffff\1\4\37\uffff\1\4", "", "", "" };
-
- static final short[] DFA11_eot = DFA.unpackEncodedString(DFA11_eotS);
- static final short[] DFA11_eof = DFA.unpackEncodedString(DFA11_eofS);
- static final char[] DFA11_min = DFA.unpackEncodedStringToUnsignedChars(DFA11_minS);
- static final char[] DFA11_max = DFA.unpackEncodedStringToUnsignedChars(DFA11_maxS);
- static final short[] DFA11_accept = DFA.unpackEncodedString(DFA11_acceptS);
- static final short[] DFA11_special = DFA.unpackEncodedString(DFA11_specialS);
- static final short[][] DFA11_transition;
-
- static {
- final int numStates = DFA11_transitionS.length;
- DFA11_transition = new short[numStates][];
- for (int i = 0; i < numStates; i++) {
- DFA11_transition[i] = DFA.unpackEncodedString(DFA11_transitionS[i]);
- }
- }
-
- class DFA11 extends DFA {
-
- public DFA11(BaseRecognizer recognizer) {
- this.recognizer = recognizer;
- decisionNumber = 11;
- eot = DFA11_eot;
- eof = DFA11_eof;
- min = DFA11_min;
- max = DFA11_max;
- accept = DFA11_accept;
- special = DFA11_special;
- transition = DFA11_transition;
- }
+ @Override
+ public String[] getRuleNames() { return ruleNames; }
- @Override
- public String getDescription() {
- return "254:1: FLOAT : ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT );";
- }
- }
+ @Override
+ public String getSerializedATN() { return _serializedATN; }
- static final String DFA19_eotS = "\1\uffff\1\44\1\47\1\51\1\54\1\56\1\44\2\uffff\1\44\2\uffff\3\44"
- + "\1\71\1\44\2\uffff\1\44\2\uffff\1\44\2\uffff\4\44\1\101\4\uffff" + "\2\44\13\uffff\11\44\2\uffff\7\44\3\uffff\11\44\1\141\2\44\1\144"
- + "\2\44\1\147\15\44\1\uffff\2\44\1\uffff\2\44\1\uffff\1\171\1\172" + "\6\44\1\u0081\1\172\4\44\1\u0086\2\44\2\uffff\6\44\1\uffff\1\u008f"
- + "\3\44\1\uffff\1\u0093\1\u0094\2\44\1\u0097\2\44\1\u009a\1\uffff" + "\3\44\2\uffff\1\u009e\1\44\1\uffff\2\44\1\uffff\1\u00a2\2\44\1\uffff"
- + "\3\44\1\uffff\1\u00a8\1\u00a9\1\u00aa\1\u00ab\1\44\4\uffff\1\u00ad" + "\1\uffff";
- static final String DFA19_eofS = "\u00ae\uffff";
- static final String DFA19_minS =
- "\1\11\1\55\2\75\1\55\1\75\1\55\2\uffff\1\55\2\uffff\5\55\2\uffff" + "\1\55\2\uffff\1\55\2\uffff\4\55\1\56\3\uffff\1\52\2\55\13\uffff"
- + "\11\55\2\uffff\7\55\3\uffff\35\55\1\uffff\2\55\1\uffff\2\55\1\uffff" + "\21\55\2\uffff\6\55\1\uffff\4\55\1\uffff\10\55\1\uffff\3\55\2\uffff"
- + "\2\55\1\uffff\2\55\1\uffff\3\55\1\uffff\3\55\1\uffff\5\55\4\uffff" + "\1\55\1\uffff";
- static final String DFA19_maxS =
- "\1\175\1\172\4\75\1\172\2\uffff\1\172\2\uffff\5\172\2\uffff\1\172" + "\2\uffff\1\172\2\uffff\4\172\1\145\3\uffff\1\57\2\172\13\uffff\11"
- + "\172\2\uffff\7\172\3\uffff\35\172\1\uffff\2\172\1\uffff\2\172\1" + "\uffff\21\172\2\uffff\6\172\1\uffff\4\172\1\uffff\10\172\1\uffff"
- + "\3\172\2\uffff\2\172\1\uffff\2\172\1\uffff\3\172\1\uffff\3\172\1" + "\uffff\5\172\4\uffff\1\172\1\uffff";
- static final String DFA19_acceptS = "\7\uffff\1\11\1\12\1\uffff\1\16\1\17\5\uffff\1\30\1\34\1\uffff\1"
- + "\36\1\37\1\uffff\1\41\1\42\5\uffff\1\54\1\55\1\56\3\uffff\1\51\1" + "\52\1\2\1\20\1\4\1\3\1\6\1\31\1\5\1\7\1\33\11\uffff\1\32\1\26\7"
- + "\uffff\1\53\1\57\1\60\35\uffff\1\46\2\uffff\1\35\2\uffff\1\43\21" + "\uffff\1\44\1\50\6\uffff\1\45\4\uffff\1\27\10\uffff\1\22\3\uffff"
- + "\1\40\1\47\2\uffff\1\13\2\uffff\1\21\3\uffff\1\1\3\uffff\1\23\5" + "\uffff\1\24\1\25\1\10\1\14\1\uffff\1\15";
- static final String DFA19_specialS = "\u00ae\uffff}>";
- static final String[] DFA19_transitionS = {
- "\2\40\2\uffff\1\40\22\uffff\1\40\1\5\1\37\3\uffff\1\21\1\uffff" + "\1\30\1\13\1\uffff\1\24\1\10\1\17\1\36\1\41\12\35\1\7\1\25\1"
- + "\4\1\2\1\3\2\uffff\32\34\4\uffff\1\34\1\uffff\1\1\1\32\1\6\1" + "\11\1\34\1\14\2\34\1\15\3\34\1\16\1\34\1\20\3\34\1\26\1\33\1"
- + "\31\2\34\1\23\2\34\1\27\1\22\1\12",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\43\1\42\30\43", "\1\46", "\1\50", "\1\53\17\uffff\1\52", "\1\55",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\10\43\1\57\5\43\1\60\13\43", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\61\25\43", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\64\3\43\1\62\6\43\1\63\16\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\14\43\1\65\1\66\14\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\67\31\43",
- "\1\43\1\45\1\uffff\12\43\4\uffff\1\70\2\uffff\32\43\4\uffff" + "\1\43\1\uffff\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\15\43\1\72\14\43", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\16\43\1\73\13\43", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\16\43\1\74\4\43\1\75\6\43", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\22\43\1\76\7\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\16\43\1\77\13\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\100\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "\1\36\1\uffff\12\35\13\uffff\1\36\37\uffff\1\36", "", "", "",
- "\1\103\4\uffff\1\102", "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\22\43\1\104\7\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "", "", "", "", "", "", "", "", "", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\15\43\1\105\14\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\15\43\1\106\14\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\22\43\1\107\7\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\110\31\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\16\43\1\111\13\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\13\43\1\112\16\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\17\43\1\113\12\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\22\43\1\114\1\115\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\15\43\1\116\14\43", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\117\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\120\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\14\43\1\121\15\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\122\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\123\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\16\43\1\124\13\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\24\43\1\125\5\43", "", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\126\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\127\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\2\43\1\130\17\43\1\131\7\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\2\43\1\132\27\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\133\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\134\31\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\22\43\1\135\7\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\16\43\1\136\13\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\137\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\140\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\3\43\1\142\26\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\16\43\1\143\13\43\4\uffff" + "\1\43\1\uffff\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\145\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\10\43\1\146\21\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\13\43\1\150\16\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\151\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\152\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\153\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\154\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\155\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\156\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\24\43\1\157\5\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\160\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\161\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\162\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\163\31\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\164\10\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\165\31\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\5\43\1\166\24\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\16\43\1\167\13\43\4\uffff" + "\1\43\1\uffff\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\15\43\1\170\14\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\173\31\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\174\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\17\43\1\175\12\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\176\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\10\43\1\177\21\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\u0080\10\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\u0082\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\15\43\1\u0083\14\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\5\43\1\u0084\24\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\u0085\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\5\43\1\u0087\24\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\6\43\1\u0088\23\43", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\2\43\1\u0089\27\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\5\43\1\u008a\24\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\u008b\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\u008c\31\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\17\43\1\u008d\12\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\u008e\25\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\2\43\1\u0090\27\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\u0091\31\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\16\43\1\u0092\13\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\u0095\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\1\u0096\31\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\10\43\1\u0098\21\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\u0099\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\u009b\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\2\43\1\u009c\27\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\21\43\1\u009d\10\43", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\2\43\1\u009f\27\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\15\43\1\u00a0\14\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\10\43\1\u00a1\21\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\u00a3\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\30\43\1\u00a4\1\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\4\43\1\u00a5\25\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\23\43\1\u00a6\6\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\16\43\1\u00a7\13\43", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\15\43\1\u00ac\14\43", "", "", "", "",
- "\1\43\1\45\1\uffff\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff" + "\32\43", "" };
+ @Override
+ public String[] getChannelNames() { return channelNames; }
- static final short[] DFA19_eot = DFA.unpackEncodedString(DFA19_eotS);
- static final short[] DFA19_eof = DFA.unpackEncodedString(DFA19_eofS);
- static final char[] DFA19_min = DFA.unpackEncodedStringToUnsignedChars(DFA19_minS);
- static final char[] DFA19_max = DFA.unpackEncodedStringToUnsignedChars(DFA19_maxS);
- static final short[] DFA19_accept = DFA.unpackEncodedString(DFA19_acceptS);
- static final short[] DFA19_special = DFA.unpackEncodedString(DFA19_specialS);
- static final short[][] DFA19_transition;
+ @Override
+ public String[] getModeNames() { return modeNames; }
+ @Override
+ public ATN getATN() { return _ATN; }
+
+ public static final String _serializedATN =
+ "\u0004\u00009\u020a\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+
+ "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+
+ "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+
+ "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+
+ "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002"+
+ "\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002"+
+ "\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002"+
+ "\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002"+
+ "\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002"+
+ "\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002"+
+ "\u001e\u0007\u001e\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007"+
+ "!\u0002\"\u0007\"\u0002#\u0007#\u0002$\u0007$\u0002%\u0007%\u0002&\u0007"+
+ "&\u0002\'\u0007\'\u0002(\u0007(\u0002)\u0007)\u0002*\u0007*\u0002+\u0007"+
+ "+\u0002,\u0007,\u0002-\u0007-\u0002.\u0007.\u0002/\u0007/\u00020\u0007"+
+ "0\u00021\u00071\u00022\u00072\u00023\u00073\u00024\u00074\u00025\u0007"+
+ "5\u00026\u00076\u00027\u00077\u00028\u00078\u00029\u00079\u0002:\u0007"+
+ ":\u0002;\u0007;\u0002<\u0007<\u0002=\u0007=\u0001\u0000\u0001\u0000\u0001"+
+ "\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001"+
+ "\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
+ "\u0001\u0001\u0001\u0001\u0001\u0001\u0002\u0001\u0002\u0001\u0002\u0001"+
+ "\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001"+
+ "\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001"+
+ "\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001"+
+ "\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+
+ "\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001"+
+ "\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001"+
+ "\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001"+
+ "\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001"+
+ "\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b"+
+ "\u0001\t\u0001\t\u0001\t\u0001\t\u0001\n\u0001\n\u0001\n\u0001\n\u0001"+
+ "\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001\u000b"+
+ "\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b"+
+ "\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001"+
+ "\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\r\u0001\r\u0001\r\u0001\r\u0001"+
+ "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+
+ "\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001"+
+ "\u000f\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001"+
+ "\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0013\u0001\u0013\u0001"+
+ "\u0014\u0001\u0014\u0001\u0015\u0001\u0015\u0001\u0016\u0001\u0016\u0001"+
+ "\u0017\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001"+
+ "\u001a\u0001\u001a\u0001\u001b\u0001\u001b\u0001\u001c\u0001\u001c\u0001"+
+ "\u001c\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001e\u0001\u001e\u0001"+
+ "\u001e\u0001\u001e\u0001\u001f\u0001\u001f\u0001\u001f\u0001 \u0001 \u0001"+
+ " \u0001 \u0001!\u0001!\u0001!\u0001\"\u0001\"\u0001\"\u0001#\u0001#\u0001"+
+ "$\u0001$\u0001%\u0001%\u0001%\u0001&\u0001&\u0001&\u0001\'\u0001\'\u0001"+
+ "\'\u0001\'\u0001\'\u0001\'\u0001(\u0001(\u0001(\u0001(\u0001(\u0001(\u0001"+
+ "(\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001*\u0001"+
+ "*\u0001*\u0001*\u0001*\u0001*\u0001*\u0001*\u0001+\u0001+\u0001+\u0001"+
+ "+\u0001,\u0001,\u0001,\u0001,\u0001,\u0001,\u0001-\u0001-\u0001-\u0001"+
+ "-\u0001-\u0001.\u0001.\u0001.\u0001.\u0001.\u0001.\u0001.\u0001.\u0001"+
+ "/\u0001/\u0001/\u0001/\u0001/\u0001/\u0001/\u0001/\u00010\u00010\u0001"+
+ "0\u00010\u00010\u00010\u00010\u00010\u00010\u00030\u0180\b0\u00011\u0001"+
+ "1\u00051\u0184\b1\n1\f1\u0187\t1\u00012\u00012\u00012\u00042\u018c\b2"+
+ "\u000b2\f2\u018d\u00013\u00043\u0191\b3\u000b3\f3\u0192\u00014\u00044"+
+ "\u0196\b4\u000b4\f4\u0197\u00014\u00014\u00054\u019c\b4\n4\f4\u019f\t"+
+ "4\u00014\u00034\u01a2\b4\u00014\u00014\u00044\u01a6\b4\u000b4\f4\u01a7"+
+ "\u00014\u00034\u01ab\b4\u00014\u00044\u01ae\b4\u000b4\f4\u01af\u00014"+
+ "\u00034\u01b3\b4\u00015\u00015\u00015\u00055\u01b8\b5\n5\f5\u01bb\t5\u0001"+
+ "5\u00015\u00016\u00016\u00036\u01c1\b6\u00016\u00046\u01c4\b6\u000b6\f"+
+ "6\u01c5\u00017\u00017\u00018\u00018\u00018\u00018\u00018\u00038\u01cf"+
+ "\b8\u00018\u00018\u00038\u01d3\b8\u00019\u00019\u00019\u00019\u00039\u01d9"+
+ "\b9\u00019\u00019\u00019\u00039\u01de\b9\u00019\u00019\u00039\u01e2\b"+
+ "9\u0001:\u0001:\u0001:\u0001:\u0001:\u0001:\u0001:\u0001;\u0004;\u01ec"+
+ "\b;\u000b;\f;\u01ed\u0001;\u0001;\u0001<\u0001<\u0001<\u0001<\u0005<\u01f6"+
+ "\b<\n<\f<\u01f9\t<\u0001<\u0001<\u0001=\u0001=\u0001=\u0001=\u0005=\u0201"+
+ "\b=\n=\f=\u0204\t=\u0001=\u0001=\u0001=\u0001=\u0001=\u0001\u0202\u0000"+
+ ">\u0001\u0001\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005\u000b\u0006"+
+ "\r\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019\r\u001b\u000e"+
+ "\u001d\u000f\u001f\u0010!\u0011#\u0012%\u0013\'\u0014)\u0015+\u0016-\u0017"+
+ "/\u00181\u00193\u001a5\u001b7\u001c9\u001d;\u001e=\u001f? A!C\"E#G$I%"+
+ "K&M\'O(Q)S*U+W,Y-[.]/_0a1c2e3g4i5k6m\u0000o\u0000q\u0000s\u0000u\u0000"+
+ "w7y8{9\u0001\u0000\n\u0004\u0000--AZ__az\u0005\u0000--09AZ__az\u0002\u0000"+
+ "\"\"\\\\\u0002\u0000EEee\u0002\u0000++--\u0003\u000009AFaf\u0005\u0000"+
+ "bbffnnrrtt\u0002\u0000\'\'\\\\\u0003\u0000\t\n\r\r \u0002\u0000\n\n\r"+
+ "\r\u021f\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000"+
+ "\u0000\u0000\u0005\u0001\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000"+
+ "\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000"+
+ "\u0000\r\u0001\u0000\u0000\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000"+
+ "\u0011\u0001\u0000\u0000\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000"+
+ "\u0015\u0001\u0000\u0000\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000"+
+ "\u0019\u0001\u0000\u0000\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0000"+
+ "\u001d\u0001\u0000\u0000\u0000\u0000\u001f\u0001\u0000\u0000\u0000\u0000"+
+ "!\u0001\u0000\u0000\u0000\u0000#\u0001\u0000\u0000\u0000\u0000%\u0001"+
+ "\u0000\u0000\u0000\u0000\'\u0001\u0000\u0000\u0000\u0000)\u0001\u0000"+
+ "\u0000\u0000\u0000+\u0001\u0000\u0000\u0000\u0000-\u0001\u0000\u0000\u0000"+
+ "\u0000/\u0001\u0000\u0000\u0000\u00001\u0001\u0000\u0000\u0000\u00003"+
+ "\u0001\u0000\u0000\u0000\u00005\u0001\u0000\u0000\u0000\u00007\u0001\u0000"+
+ "\u0000\u0000\u00009\u0001\u0000\u0000\u0000\u0000;\u0001\u0000\u0000\u0000"+
+ "\u0000=\u0001\u0000\u0000\u0000\u0000?\u0001\u0000\u0000\u0000\u0000A"+
+ "\u0001\u0000\u0000\u0000\u0000C\u0001\u0000\u0000\u0000\u0000E\u0001\u0000"+
+ "\u0000\u0000\u0000G\u0001\u0000\u0000\u0000\u0000I\u0001\u0000\u0000\u0000"+
+ "\u0000K\u0001\u0000\u0000\u0000\u0000M\u0001\u0000\u0000\u0000\u0000O"+
+ "\u0001\u0000\u0000\u0000\u0000Q\u0001\u0000\u0000\u0000\u0000S\u0001\u0000"+
+ "\u0000\u0000\u0000U\u0001\u0000\u0000\u0000\u0000W\u0001\u0000\u0000\u0000"+
+ "\u0000Y\u0001\u0000\u0000\u0000\u0000[\u0001\u0000\u0000\u0000\u0000]"+
+ "\u0001\u0000\u0000\u0000\u0000_\u0001\u0000\u0000\u0000\u0000a\u0001\u0000"+
+ "\u0000\u0000\u0000c\u0001\u0000\u0000\u0000\u0000e\u0001\u0000\u0000\u0000"+
+ "\u0000g\u0001\u0000\u0000\u0000\u0000i\u0001\u0000\u0000\u0000\u0000k"+
+ "\u0001\u0000\u0000\u0000\u0000w\u0001\u0000\u0000\u0000\u0000y\u0001\u0000"+
+ "\u0000\u0000\u0000{\u0001\u0000\u0000\u0000\u0001}\u0001\u0000\u0000\u0000"+
+ "\u0003\u0084\u0001\u0000\u0000\u0000\u0005\u008e\u0001\u0000\u0000\u0000"+
+ "\u0007\u0097\u0001\u0000\u0000\u0000\t\u009e\u0001\u0000\u0000\u0000\u000b"+
+ "\u00a4\u0001\u0000\u0000\u0000\r\u00ac\u0001\u0000\u0000\u0000\u000f\u00b7"+
+ "\u0001\u0000\u0000\u0000\u0011\u00c2\u0001\u0000\u0000\u0000\u0013\u00ca"+
+ "\u0001\u0000\u0000\u0000\u0015\u00ce\u0001\u0000\u0000\u0000\u0017\u00d7"+
+ "\u0001\u0000\u0000\u0000\u0019\u00e1\u0001\u0000\u0000\u0000\u001b\u00ed"+
+ "\u0001\u0000\u0000\u0000\u001d\u00f1\u0001\u0000\u0000\u0000\u001f\u00f7"+
+ "\u0001\u0000\u0000\u0000!\u00fe\u0001\u0000\u0000\u0000#\u0103\u0001\u0000"+
+ "\u0000\u0000%\u0105\u0001\u0000\u0000\u0000\'\u0107\u0001\u0000\u0000"+
+ "\u0000)\u0109\u0001\u0000\u0000\u0000+\u010b\u0001\u0000\u0000\u0000-"+
+ "\u010d\u0001\u0000\u0000\u0000/\u010f\u0001\u0000\u0000\u00001\u0111\u0001"+
+ "\u0000\u0000\u00003\u0113\u0001\u0000\u0000\u00005\u0115\u0001\u0000\u0000"+
+ "\u00007\u0117\u0001\u0000\u0000\u00009\u0119\u0001\u0000\u0000\u0000;"+
+ "\u011c\u0001\u0000\u0000\u0000=\u011f\u0001\u0000\u0000\u0000?\u0123\u0001"+
+ "\u0000\u0000\u0000A\u0126\u0001\u0000\u0000\u0000C\u012a\u0001\u0000\u0000"+
+ "\u0000E\u012d\u0001\u0000\u0000\u0000G\u0130\u0001\u0000\u0000\u0000I"+
+ "\u0132\u0001\u0000\u0000\u0000K\u0134\u0001\u0000\u0000\u0000M\u0137\u0001"+
+ "\u0000\u0000\u0000O\u013a\u0001\u0000\u0000\u0000Q\u0140\u0001\u0000\u0000"+
+ "\u0000S\u0147\u0001\u0000\u0000\u0000U\u014f\u0001\u0000\u0000\u0000W"+
+ "\u0157\u0001\u0000\u0000\u0000Y\u015b\u0001\u0000\u0000\u0000[\u0161\u0001"+
+ "\u0000\u0000\u0000]\u0166\u0001\u0000\u0000\u0000_\u016e\u0001\u0000\u0000"+
+ "\u0000a\u017f\u0001\u0000\u0000\u0000c\u0181\u0001\u0000\u0000\u0000e"+
+ "\u0188\u0001\u0000\u0000\u0000g\u0190\u0001\u0000\u0000\u0000i\u01b2\u0001"+
+ "\u0000\u0000\u0000k\u01b4\u0001\u0000\u0000\u0000m\u01be\u0001\u0000\u0000"+
+ "\u0000o\u01c7\u0001\u0000\u0000\u0000q\u01d2\u0001\u0000\u0000\u0000s"+
+ "\u01e1\u0001\u0000\u0000\u0000u\u01e3\u0001\u0000\u0000\u0000w\u01eb\u0001"+
+ "\u0000\u0000\u0000y\u01f1\u0001\u0000\u0000\u0000{\u01fc\u0001\u0000\u0000"+
+ "\u0000}~\u0005i\u0000\u0000~\u007f\u0005m\u0000\u0000\u007f\u0080\u0005"+
+ "p\u0000\u0000\u0080\u0081\u0005o\u0000\u0000\u0081\u0082\u0005r\u0000"+
+ "\u0000\u0082\u0083\u0005t\u0000\u0000\u0083\u0002\u0001\u0000\u0000\u0000"+
+ "\u0084\u0085\u0005m\u0000\u0000\u0085\u0086\u0005a\u0000\u0000\u0086\u0087"+
+ "\u0005n\u0000\u0000\u0087\u0088\u0005d\u0000\u0000\u0088\u0089\u0005a"+
+ "\u0000\u0000\u0089\u008a\u0005t\u0000\u0000\u008a\u008b\u0005o\u0000\u0000"+
+ "\u008b\u008c\u0005r\u0000\u0000\u008c\u008d\u0005y\u0000\u0000\u008d\u0004"+
+ "\u0001\u0000\u0000\u0000\u008e\u008f\u0005a\u0000\u0000\u008f\u0090\u0005"+
+ "b\u0000\u0000\u0090\u0091\u0005s\u0000\u0000\u0091\u0092\u0005t\u0000"+
+ "\u0000\u0092\u0093\u0005r\u0000\u0000\u0093\u0094\u0005a\u0000\u0000\u0094"+
+ "\u0095\u0005c\u0000\u0000\u0095\u0096\u0005t\u0000\u0000\u0096\u0006\u0001"+
+ "\u0000\u0000\u0000\u0097\u0098\u0005s\u0000\u0000\u0098\u0099\u0005o\u0000"+
+ "\u0000\u0099\u009a\u0005m\u0000\u0000\u009a\u009b\u0005e\u0000\u0000\u009b"+
+ "\u009c\u0005O\u0000\u0000\u009c\u009d\u0005f\u0000\u0000\u009d\b\u0001"+
+ "\u0000\u0000\u0000\u009e\u009f\u0005o\u0000\u0000\u009f\u00a0\u0005n\u0000"+
+ "\u0000\u00a0\u00a1\u0005e\u0000\u0000\u00a1\u00a2\u0005O\u0000\u0000\u00a2"+
+ "\u00a3\u0005f\u0000\u0000\u00a3\n\u0001\u0000\u0000\u0000\u00a4\u00a5"+
+ "\u0005c\u0000\u0000\u00a5\u00a6\u0005o\u0000\u0000\u00a6\u00a7\u0005n"+
+ "\u0000\u0000\u00a7\u00a8\u0005c\u0000\u0000\u00a8\u00a9\u0005e\u0000\u0000"+
+ "\u00a9\u00aa\u0005p\u0000\u0000\u00aa\u00ab\u0005t\u0000\u0000\u00ab\f"+
+ "\u0001\u0000\u0000\u0000\u00ac\u00ad\u0005c\u0000\u0000\u00ad\u00ae\u0005"+
+ "i\u0000\u0000\u00ae\u00af\u0005n\u0000\u0000\u00af\u00b0\u0005t\u0000"+
+ "\u0000\u00b0\u00b1\u0005e\u0000\u0000\u00b1\u00b2\u0005r\u0000\u0000\u00b2"+
+ "\u00b3\u0005f\u0000\u0000\u00b3\u00b4\u0005a\u0000\u0000\u00b4\u00b5\u0005"+
+ "c\u0000\u0000\u00b5\u00b6\u0005e\u0000\u0000\u00b6\u000e\u0001\u0000\u0000"+
+ "\u0000\u00b7\u00b8\u0005c\u0000\u0000\u00b8\u00b9\u0005o\u0000\u0000\u00b9"+
+ "\u00ba\u0005n\u0000\u0000\u00ba\u00bb\u0005s\u0000\u0000\u00bb\u00bc\u0005"+
+ "t\u0000\u0000\u00bc\u00bd\u0005r\u0000\u0000\u00bd\u00be\u0005a\u0000"+
+ "\u0000\u00be\u00bf\u0005i\u0000\u0000\u00bf\u00c0\u0005n\u0000\u0000\u00c0"+
+ "\u00c1\u0005t\u0000\u0000\u00c1\u0010\u0001\u0000\u0000\u0000\u00c2\u00c3"+
+ "\u0005f\u0000\u0000\u00c3\u00c4\u0005e\u0000\u0000\u00c4\u00c5\u0005a"+
+ "\u0000\u0000\u00c5\u00c6\u0005t\u0000\u0000\u00c6\u00c7\u0005u\u0000\u0000"+
+ "\u00c7\u00c8\u0005r\u0000\u0000\u00c8\u00c9\u0005e\u0000\u0000\u00c9\u0012"+
+ "\u0001\u0000\u0000\u0000\u00ca\u00cb\u0005u\u0000\u0000\u00cb\u00cc\u0005"+
+ "s\u0000\u0000\u00cc\u00cd\u0005e\u0000\u0000\u00cd\u0014\u0001\u0000\u0000"+
+ "\u0000\u00ce\u00cf\u0005i\u0000\u0000\u00cf\u00d0\u0005n\u0000\u0000\u00d0"+
+ "\u00d1\u0005s\u0000\u0000\u00d1\u00d2\u0005t\u0000\u0000\u00d2\u00d3\u0005"+
+ "a\u0000\u0000\u00d3\u00d4\u0005n\u0000\u0000\u00d4\u00d5\u0005c\u0000"+
+ "\u0000\u00d5\u00d6\u0005e\u0000\u0000\u00d6\u0016\u0001\u0000\u0000\u0000"+
+ "\u00d7\u00d8\u0005i\u0000\u0000\u00d8\u00d9\u0005n\u0000\u0000\u00d9\u00da"+
+ "\u0005t\u0000\u0000\u00da\u00db\u0005e\u0000\u0000\u00db\u00dc\u0005r"+
+ "\u0000\u0000\u00dc\u00dd\u0005f\u0000\u0000\u00dd\u00de\u0005a\u0000\u0000"+
+ "\u00de\u00df\u0005c\u0000\u0000\u00df\u00e0\u0005e\u0000\u0000\u00e0\u0018"+
+ "\u0001\u0000\u0000\u0000\u00e1\u00e2\u0005d\u0000\u0000\u00e2\u00e3\u0005"+
+ "e\u0000\u0000\u00e3\u00e4\u0005s\u0000\u0000\u00e4\u00e5\u0005c\u0000"+
+ "\u0000\u00e5\u00e6\u0005r\u0000\u0000\u00e6\u00e7\u0005i\u0000\u0000\u00e7"+
+ "\u00e8\u0005p\u0000\u0000\u00e8\u00e9\u0005t\u0000\u0000\u00e9\u00ea\u0005"+
+ "i\u0000\u0000\u00ea\u00eb\u0005o\u0000\u0000\u00eb\u00ec\u0005n\u0000"+
+ "\u0000\u00ec\u001a\u0001\u0000\u0000\u0000\u00ed\u00ee\u0005i\u0000\u0000"+
+ "\u00ee\u00ef\u0005n\u0000\u0000\u00ef\u00f0\u0005t\u0000\u0000\u00f0\u001c"+
+ "\u0001\u0000\u0000\u0000\u00f1\u00f2\u0005f\u0000\u0000\u00f2\u00f3\u0005"+
+ "l\u0000\u0000\u00f3\u00f4\u0005o\u0000\u0000\u00f4\u00f5\u0005a\u0000"+
+ "\u0000\u00f5\u00f6\u0005t\u0000\u0000\u00f6\u001e\u0001\u0000\u0000\u0000"+
+ "\u00f7\u00f8\u0005s\u0000\u0000\u00f8\u00f9\u0005t\u0000\u0000\u00f9\u00fa"+
+ "\u0005r\u0000\u0000\u00fa\u00fb\u0005i\u0000\u0000\u00fb\u00fc\u0005n"+
+ "\u0000\u0000\u00fc\u00fd\u0005g\u0000\u0000\u00fd \u0001\u0000\u0000\u0000"+
+ "\u00fe\u00ff\u0005b\u0000\u0000\u00ff\u0100\u0005o\u0000\u0000\u0100\u0101"+
+ "\u0005o\u0000\u0000\u0101\u0102\u0005l\u0000\u0000\u0102\"\u0001\u0000"+
+ "\u0000\u0000\u0103\u0104\u0005;\u0000\u0000\u0104$\u0001\u0000\u0000\u0000"+
+ "\u0105\u0106\u0005{\u0000\u0000\u0106&\u0001\u0000\u0000\u0000\u0107\u0108"+
+ "\u0005}\u0000\u0000\u0108(\u0001\u0000\u0000\u0000\u0109\u010a\u0005("+
+ "\u0000\u0000\u010a*\u0001\u0000\u0000\u0000\u010b\u010c\u0005)\u0000\u0000"+
+ "\u010c,\u0001\u0000\u0000\u0000\u010d\u010e\u0005=\u0000\u0000\u010e."+
+ "\u0001\u0000\u0000\u0000\u010f\u0110\u0005,\u0000\u0000\u01100\u0001\u0000"+
+ "\u0000\u0000\u0111\u0112\u0005:\u0000\u0000\u01122\u0001\u0000\u0000\u0000"+
+ "\u0113\u0114\u0005+\u0000\u0000\u01144\u0001\u0000\u0000\u0000\u0115\u0116"+
+ "\u0005-\u0000\u0000\u01166\u0001\u0000\u0000\u0000\u0117\u0118\u0005!"+
+ "\u0000\u0000\u01188\u0001\u0000\u0000\u0000\u0119\u011a\u0005&\u0000\u0000"+
+ "\u011a\u011b\u0005&\u0000\u0000\u011b:\u0001\u0000\u0000\u0000\u011c\u011d"+
+ "\u0005|\u0000\u0000\u011d\u011e\u0005|\u0000\u0000\u011e<\u0001\u0000"+
+ "\u0000\u0000\u011f\u0120\u0005x\u0000\u0000\u0120\u0121\u0005o\u0000\u0000"+
+ "\u0121\u0122\u0005r\u0000\u0000\u0122>\u0001\u0000\u0000\u0000\u0123\u0124"+
+ "\u0005-\u0000\u0000\u0124\u0125\u0005>\u0000\u0000\u0125@\u0001\u0000"+
+ "\u0000\u0000\u0126\u0127\u0005<\u0000\u0000\u0127\u0128\u0005-\u0000\u0000"+
+ "\u0128\u0129\u0005>\u0000\u0000\u0129B\u0001\u0000\u0000\u0000\u012a\u012b"+
+ "\u0005=\u0000\u0000\u012b\u012c\u0005=\u0000\u0000\u012cD\u0001\u0000"+
+ "\u0000\u0000\u012d\u012e\u0005!\u0000\u0000\u012e\u012f\u0005=\u0000\u0000"+
+ "\u012fF\u0001\u0000\u0000\u0000\u0130\u0131\u0005>\u0000\u0000\u0131H"+
+ "\u0001\u0000\u0000\u0000\u0132\u0133\u0005<\u0000\u0000\u0133J\u0001\u0000"+
+ "\u0000\u0000\u0134\u0135\u0005>\u0000\u0000\u0135\u0136\u0005=\u0000\u0000"+
+ "\u0136L\u0001\u0000\u0000\u0000\u0137\u0138\u0005<\u0000\u0000\u0138\u0139"+
+ "\u0005=\u0000\u0000\u0139N\u0001\u0000\u0000\u0000\u013a\u013b\u0005E"+
+ "\u0000\u0000\u013b\u013c\u0005M\u0000\u0000\u013c\u013d\u0005P\u0000\u0000"+
+ "\u013d\u013e\u0005T\u0000\u0000\u013e\u013f\u0005Y\u0000\u0000\u013fP"+
+ "\u0001\u0000\u0000\u0000\u0140\u0141\u0005C\u0000\u0000\u0141\u0142\u0005"+
+ "O\u0000\u0000\u0142\u0143\u0005N\u0000\u0000\u0143\u0144\u0005S\u0000"+
+ "\u0000\u0144\u0145\u0005T\u0000\u0000\u0145\u0146\u0005R\u0000\u0000\u0146"+
+ "R\u0001\u0000\u0000\u0000\u0147\u0148\u0005A\u0000\u0000\u0148\u0149\u0005"+
+ "C\u0000\u0000\u0149\u014a\u0005O\u0000\u0000\u014a\u014b\u0005N\u0000"+
+ "\u0000\u014b\u014c\u0005S\u0000\u0000\u014c\u014d\u0005T\u0000\u0000\u014d"+
+ "\u014e\u0005R\u0000\u0000\u014eT\u0001\u0000\u0000\u0000\u014f\u0150\u0005"+
+ "B\u0000\u0000\u0150\u0151\u0005A\u0000\u0000\u0151\u0152\u0005S\u0000"+
+ "\u0000\u0152\u0153\u0005E\u0000\u0000\u0153\u0154\u0005E\u0000\u0000\u0154"+
+ "\u0155\u0005X\u0000\u0000\u0155\u0156\u0005T\u0000\u0000\u0156V\u0001"+
+ "\u0000\u0000\u0000\u0157\u0158\u0005D\u0000\u0000\u0158\u0159\u0005E\u0000"+
+ "\u0000\u0159\u015a\u0005F\u0000\u0000\u015aX\u0001\u0000\u0000\u0000\u015b"+
+ "\u015c\u0005G\u0000\u0000\u015c\u015d\u0005R\u0000\u0000\u015d\u015e\u0005"+
+ "O\u0000\u0000\u015e\u015f\u0005U\u0000\u0000\u015f\u0160\u0005P\u0000"+
+ "\u0000\u0160Z\u0001\u0000\u0000\u0000\u0161\u0162\u0005A\u0000\u0000\u0162"+
+ "\u0163\u0005T\u0000\u0000\u0163\u0164\u0005T\u0000\u0000\u0164\u0165\u0005"+
+ "R\u0000\u0000\u0165\\\u0001\u0000\u0000\u0000\u0166\u0167\u0005U\u0000"+
+ "\u0000\u0167\u0168\u0005N\u0000\u0000\u0168\u0169\u0005A\u0000\u0000\u0169"+
+ "\u016a\u0005R\u0000\u0000\u016a\u016b\u0005Y\u0000\u0000\u016b\u016c\u0005"+
+ "O\u0000\u0000\u016c\u016d\u0005P\u0000\u0000\u016d^\u0001\u0000\u0000"+
+ "\u0000\u016e\u016f\u0005O\u0000\u0000\u016f\u0170\u0005P\u0000\u0000\u0170"+
+ "\u0171\u0005E\u0000\u0000\u0171\u0172\u0005R\u0000\u0000\u0172\u0173\u0005"+
+ "A\u0000\u0000\u0173\u0174\u0005N\u0000\u0000\u0174\u0175\u0005D\u0000"+
+ "\u0000\u0175`\u0001\u0000\u0000\u0000\u0176\u0177\u0005t\u0000\u0000\u0177"+
+ "\u0178\u0005r\u0000\u0000\u0178\u0179\u0005u\u0000\u0000\u0179\u0180\u0005"+
+ "e\u0000\u0000\u017a\u017b\u0005f\u0000\u0000\u017b\u017c\u0005a\u0000"+
+ "\u0000\u017c\u017d\u0005l\u0000\u0000\u017d\u017e\u0005s\u0000\u0000\u017e"+
+ "\u0180\u0005e\u0000\u0000\u017f\u0176\u0001\u0000\u0000\u0000\u017f\u017a"+
+ "\u0001\u0000\u0000\u0000\u0180b\u0001\u0000\u0000\u0000\u0181\u0185\u0007"+
+ "\u0000\u0000\u0000\u0182\u0184\u0007\u0001\u0000\u0000\u0183\u0182\u0001"+
+ "\u0000\u0000\u0000\u0184\u0187\u0001\u0000\u0000\u0000\u0185\u0183\u0001"+
+ "\u0000\u0000\u0000\u0185\u0186\u0001\u0000\u0000\u0000\u0186d\u0001\u0000"+
+ "\u0000\u0000\u0187\u0185\u0001\u0000\u0000\u0000\u0188\u018b\u0003c1\u0000"+
+ "\u0189\u018a\u0005.\u0000\u0000\u018a\u018c\u0003c1\u0000\u018b\u0189"+
+ "\u0001\u0000\u0000\u0000\u018c\u018d\u0001\u0000\u0000\u0000\u018d\u018b"+
+ "\u0001\u0000\u0000\u0000\u018d\u018e\u0001\u0000\u0000\u0000\u018ef\u0001"+
+ "\u0000\u0000\u0000\u018f\u0191\u000209\u0000\u0190\u018f\u0001\u0000\u0000"+
+ "\u0000\u0191\u0192\u0001\u0000\u0000\u0000\u0192\u0190\u0001\u0000\u0000"+
+ "\u0000\u0192\u0193\u0001\u0000\u0000\u0000\u0193h\u0001\u0000\u0000\u0000"+
+ "\u0194\u0196\u000209\u0000\u0195\u0194\u0001\u0000\u0000\u0000\u0196\u0197"+
+ "\u0001\u0000\u0000\u0000\u0197\u0195\u0001\u0000\u0000\u0000\u0197\u0198"+
+ "\u0001\u0000\u0000\u0000\u0198\u0199\u0001\u0000\u0000\u0000\u0199\u019d"+
+ "\u0005.\u0000\u0000\u019a\u019c\u000209\u0000\u019b\u019a\u0001\u0000"+
+ "\u0000\u0000\u019c\u019f\u0001\u0000\u0000\u0000\u019d\u019b\u0001\u0000"+
+ "\u0000\u0000\u019d\u019e\u0001\u0000\u0000\u0000\u019e\u01a1\u0001\u0000"+
+ "\u0000\u0000\u019f\u019d\u0001\u0000\u0000\u0000\u01a0\u01a2\u0003m6\u0000"+
+ "\u01a1\u01a0\u0001\u0000\u0000\u0000\u01a1\u01a2\u0001\u0000\u0000\u0000"+
+ "\u01a2\u01b3\u0001\u0000\u0000\u0000\u01a3\u01a5\u0005.\u0000\u0000\u01a4"+
+ "\u01a6\u000209\u0000\u01a5\u01a4\u0001\u0000\u0000\u0000\u01a6\u01a7\u0001"+
+ "\u0000\u0000\u0000\u01a7\u01a5\u0001\u0000\u0000\u0000\u01a7\u01a8\u0001"+
+ "\u0000\u0000\u0000\u01a8\u01aa\u0001\u0000\u0000\u0000\u01a9\u01ab\u0003"+
+ "m6\u0000\u01aa\u01a9\u0001\u0000\u0000\u0000\u01aa\u01ab\u0001\u0000\u0000"+
+ "\u0000\u01ab\u01b3\u0001\u0000\u0000\u0000\u01ac\u01ae\u000209\u0000\u01ad"+
+ "\u01ac\u0001\u0000\u0000\u0000\u01ae\u01af\u0001\u0000\u0000\u0000\u01af"+
+ "\u01ad\u0001\u0000\u0000\u0000\u01af\u01b0\u0001\u0000\u0000\u0000\u01b0"+
+ "\u01b1\u0001\u0000\u0000\u0000\u01b1\u01b3\u0003m6\u0000\u01b2\u0195\u0001"+
+ "\u0000\u0000\u0000\u01b2\u01a3\u0001\u0000\u0000\u0000\u01b2\u01ad\u0001"+
+ "\u0000\u0000\u0000\u01b3j\u0001\u0000\u0000\u0000\u01b4\u01b9\u0005\""+
+ "\u0000\u0000\u01b5\u01b8\u0003q8\u0000\u01b6\u01b8\b\u0002\u0000\u0000"+
+ "\u01b7\u01b5\u0001\u0000\u0000\u0000\u01b7\u01b6\u0001\u0000\u0000\u0000"+
+ "\u01b8\u01bb\u0001\u0000\u0000\u0000\u01b9\u01b7\u0001\u0000\u0000\u0000"+
+ "\u01b9\u01ba\u0001\u0000\u0000\u0000\u01ba\u01bc\u0001\u0000\u0000\u0000"+
+ "\u01bb\u01b9\u0001\u0000\u0000\u0000\u01bc\u01bd\u0005\"\u0000\u0000\u01bd"+
+ "l\u0001\u0000\u0000\u0000\u01be\u01c0\u0007\u0003\u0000\u0000\u01bf\u01c1"+
+ "\u0007\u0004\u0000\u0000\u01c0\u01bf\u0001\u0000\u0000\u0000\u01c0\u01c1"+
+ "\u0001\u0000\u0000\u0000\u01c1\u01c3\u0001\u0000\u0000\u0000\u01c2\u01c4"+
+ "\u000209\u0000\u01c3\u01c2\u0001\u0000\u0000\u0000\u01c4\u01c5\u0001\u0000"+
+ "\u0000\u0000\u01c5\u01c3\u0001\u0000\u0000\u0000\u01c5\u01c6\u0001\u0000"+
+ "\u0000\u0000\u01c6n\u0001\u0000\u0000\u0000\u01c7\u01c8\u0007\u0005\u0000"+
+ "\u0000\u01c8p\u0001\u0000\u0000\u0000\u01c9\u01ce\u0005\\\u0000\u0000"+
+ "\u01ca\u01cf\u0007\u0006\u0000\u0000\u01cb\u01cc\u0005\\\u0000\u0000\u01cc"+
+ "\u01cf\u0005\"\u0000\u0000\u01cd\u01cf\u0007\u0007\u0000\u0000\u01ce\u01ca"+
+ "\u0001\u0000\u0000\u0000\u01ce\u01cb\u0001\u0000\u0000\u0000\u01ce\u01cd"+
+ "\u0001\u0000\u0000\u0000\u01cf\u01d3\u0001\u0000\u0000\u0000\u01d0\u01d3"+
+ "\u0003u:\u0000\u01d1\u01d3\u0003s9\u0000\u01d2\u01c9\u0001\u0000\u0000"+
+ "\u0000\u01d2\u01d0\u0001\u0000\u0000\u0000\u01d2\u01d1\u0001\u0000\u0000"+
+ "\u0000\u01d3r\u0001\u0000\u0000\u0000\u01d4\u01d5\u0005\\\u0000\u0000"+
+ "\u01d5\u01d6\u000203\u0000\u01d6\u01d8\u000207\u0000\u01d7\u01d9\u0002"+
+ "07\u0000\u01d8\u01d7\u0001\u0000\u0000\u0000\u01d8\u01d9\u0001\u0000\u0000"+
+ "\u0000\u01d9\u01e2\u0001\u0000\u0000\u0000\u01da\u01db\u0005\\\u0000\u0000"+
+ "\u01db\u01dd\u000207\u0000\u01dc\u01de\u000207\u0000\u01dd\u01dc\u0001"+
+ "\u0000\u0000\u0000\u01dd\u01de\u0001\u0000\u0000\u0000\u01de\u01e2\u0001"+
+ "\u0000\u0000\u0000\u01df\u01e0\u0005\\\u0000\u0000\u01e0\u01e2\u00020"+
+ "7\u0000\u01e1\u01d4\u0001\u0000\u0000\u0000\u01e1\u01da\u0001\u0000\u0000"+
+ "\u0000\u01e1\u01df\u0001\u0000\u0000\u0000\u01e2t\u0001\u0000\u0000\u0000"+
+ "\u01e3\u01e4\u0005\\\u0000\u0000\u01e4\u01e5\u0005u\u0000\u0000\u01e5"+
+ "\u01e6\u0003o7\u0000\u01e6\u01e7\u0003o7\u0000\u01e7\u01e8\u0003o7\u0000"+
+ "\u01e8\u01e9\u0003o7\u0000\u01e9v\u0001\u0000\u0000\u0000\u01ea\u01ec"+
+ "\u0007\b\u0000\u0000\u01eb\u01ea\u0001\u0000\u0000\u0000\u01ec\u01ed\u0001"+
+ "\u0000\u0000\u0000\u01ed\u01eb\u0001\u0000\u0000\u0000\u01ed\u01ee\u0001"+
+ "\u0000\u0000\u0000\u01ee\u01ef\u0001\u0000\u0000\u0000\u01ef\u01f0\u0006"+
+ ";\u0000\u0000\u01f0x\u0001\u0000\u0000\u0000\u01f1\u01f2\u0005/\u0000"+
+ "\u0000\u01f2\u01f3\u0005/\u0000\u0000\u01f3\u01f7\u0001\u0000\u0000\u0000"+
+ "\u01f4\u01f6\b\t\u0000\u0000\u01f5\u01f4\u0001\u0000\u0000\u0000\u01f6"+
+ "\u01f9\u0001\u0000\u0000\u0000\u01f7\u01f5\u0001\u0000\u0000\u0000\u01f7"+
+ "\u01f8\u0001\u0000\u0000\u0000\u01f8\u01fa\u0001\u0000\u0000\u0000\u01f9"+
+ "\u01f7\u0001\u0000\u0000\u0000\u01fa\u01fb\u0006<\u0000\u0000\u01fbz\u0001"+
+ "\u0000\u0000\u0000\u01fc\u01fd\u0005/\u0000\u0000\u01fd\u01fe\u0005*\u0000"+
+ "\u0000\u01fe\u0202\u0001\u0000\u0000\u0000\u01ff\u0201\t\u0000\u0000\u0000"+
+ "\u0200\u01ff\u0001\u0000\u0000\u0000\u0201\u0204\u0001\u0000\u0000\u0000"+
+ "\u0202\u0203\u0001\u0000\u0000\u0000\u0202\u0200\u0001\u0000\u0000\u0000"+
+ "\u0203\u0205\u0001\u0000\u0000\u0000\u0204\u0202\u0001\u0000\u0000\u0000"+
+ "\u0205\u0206\u0005*\u0000\u0000\u0206\u0207\u0005/\u0000\u0000\u0207\u0208"+
+ "\u0001\u0000\u0000\u0000\u0208\u0209\u0006=\u0000\u0000\u0209|\u0001\u0000"+
+ "\u0000\u0000\u0018\u0000\u017f\u0185\u018d\u0192\u0197\u019d\u01a1\u01a7"+
+ "\u01aa\u01af\u01b2\u01b7\u01b9\u01c0\u01c5\u01ce\u01d2\u01d8\u01dd\u01e1"+
+ "\u01ed\u01f7\u0202\u0001\u0006\u0000\u0000";
+ public static final ATN _ATN =
+ new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
- final int numStates = DFA19_transitionS.length;
- DFA19_transition = new short[numStates][];
- for (int i = 0; i < numStates; i++) {
- DFA19_transition[i] = DFA.unpackEncodedString(DFA19_transitionS[i]);
- }
- }
-
- class DFA19 extends DFA {
-
- public DFA19(BaseRecognizer recognizer) {
- this.recognizer = recognizer;
- decisionNumber = 19;
- eot = DFA19_eot;
- eof = DFA19_eof;
- min = DFA19_min;
- max = DFA19_max;
- accept = DFA19_accept;
- special = DFA19_special;
- transition = DFA19_transition;
- }
-
- @Override
- public String getDescription() {
- return "1:1: Tokens : ( ABSTRACT | ATTR_OP_EQUALS | ATTR_OP_GREATER | ATTR_OP_GREATER_EQ | ATTR_OP_LESS | ATTR_OP_LESS_EQ | ATTR_OP_NOT_EQUALS | CINTERFACE | COLON | COMMA | CONCEPT | CONSTRAINT | DESCRIPTION | END_C | END_R | EQ | FEATURE | IMPORT | IMPORTINSTANCE | IMPORTINTERFACE | MANDATORY | MINUS | ONEOF | OP_AND | OP_EQUIVALENT | OP_IMPLIES | OP_NOT | OP_OR | OP_XOR | PLUS | SEMI | SOMEOF | START_C | START_R | USE | VAR_BOOL | VAR_FLOAT | VAR_INT | VAR_STRING | BOOLEAN | ID | IDPath | INT | FLOAT | STRING | WS | SL_COMMENT | ML_COMMENT );";
+ _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
+ for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
+ _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
}
}
-
-}
+}
\ No newline at end of file
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.tokens b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.tokens
new file mode 100644
index 0000000000..3c8e8941ac
--- /dev/null
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetLexer.tokens
@@ -0,0 +1,105 @@
+IMPORT=1
+MANDATORY=2
+ABSTRACT=3
+SOMEOF=4
+ONEOF=5
+CONCEPT=6
+CINTERFACE=7
+CONSTRAINT=8
+FEATURE=9
+USE=10
+IMPORTINSTANCE=11
+IMPORTINTERFACE=12
+DESCRIPTION=13
+VAR_INT=14
+VAR_FLOAT=15
+VAR_STRING=16
+VAR_BOOL=17
+SEMI=18
+START_C=19
+END_C=20
+START_R=21
+END_R=22
+EQ=23
+COMMA=24
+COLON=25
+PLUS=26
+MINUS=27
+OP_NOT=28
+OP_AND=29
+OP_OR=30
+OP_XOR=31
+OP_IMPLIES=32
+OP_EQUIVALENT=33
+ATTR_OP_EQUALS=34
+ATTR_OP_NOT_EQUALS=35
+ATTR_OP_GREATER=36
+ATTR_OP_LESS=37
+ATTR_OP_GREATER_EQ=38
+ATTR_OP_LESS_EQ=39
+EMPTY=40
+CONSTR=41
+ACONSTR=42
+BASEEXT=43
+DEF=44
+GROUP=45
+ATTR=46
+UNARYOP=47
+OPERAND=48
+BOOLEAN=49
+ID=50
+IDPath=51
+INT=52
+FLOAT=53
+STRING=54
+WS=55
+SL_COMMENT=56
+ML_COMMENT=57
+'import'=1
+'mandatory'=2
+'abstract'=3
+'someOf'=4
+'oneOf'=5
+'concept'=6
+'cinterface'=7
+'constraint'=8
+'feature'=9
+'use'=10
+'instance'=11
+'interface'=12
+'description'=13
+'int'=14
+'float'=15
+'string'=16
+'bool'=17
+';'=18
+'{'=19
+'}'=20
+'('=21
+')'=22
+'='=23
+','=24
+':'=25
+'+'=26
+'-'=27
+'!'=28
+'&&'=29
+'||'=30
+'xor'=31
+'->'=32
+'<->'=33
+'=='=34
+'!='=35
+'>'=36
+'<'=37
+'>='=38
+'<='=39
+'EMPTY'=40
+'CONSTR'=41
+'ACONSTR'=42
+'BASEEXT'=43
+'DEF'=44
+'GROUP'=45
+'ATTR'=46
+'UNARYOP'=47
+'OPERAND'=48
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetListener.java b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetListener.java
new file mode 100644
index 0000000000..37bbe342df
--- /dev/null
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetListener.java
@@ -0,0 +1,323 @@
+// Generated from Velvet.g4 by ANTLR 4.13.2
+
+package de.ovgu.featureide.fm.core.io.velvet;
+
+import de.ovgu.featureide.fm.core.FMCorePlugin;
+import org.antlr.v4.runtime.tree.ParseTreeListener;
+
+/**
+ * This interface defines a complete listener for a parse tree produced by
+ * {@link VelvetParser}.
+ */
+public interface VelvetListener extends ParseTreeListener {
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#velvetModel}.
+ * @param ctx the parse tree
+ */
+ void enterVelvetModel(VelvetParser.VelvetModelContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#velvetModel}.
+ * @param ctx the parse tree
+ */
+ void exitVelvetModel(VelvetParser.VelvetModelContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#imp}.
+ * @param ctx the parse tree
+ */
+ void enterImp(VelvetParser.ImpContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#imp}.
+ * @param ctx the parse tree
+ */
+ void exitImp(VelvetParser.ImpContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#concept}.
+ * @param ctx the parse tree
+ */
+ void enterConcept(VelvetParser.ConceptContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#concept}.
+ * @param ctx the parse tree
+ */
+ void exitConcept(VelvetParser.ConceptContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#cinterface}.
+ * @param ctx the parse tree
+ */
+ void enterCinterface(VelvetParser.CinterfaceContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#cinterface}.
+ * @param ctx the parse tree
+ */
+ void exitCinterface(VelvetParser.CinterfaceContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#conceptBaseExt}.
+ * @param ctx the parse tree
+ */
+ void enterConceptBaseExt(VelvetParser.ConceptBaseExtContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#conceptBaseExt}.
+ * @param ctx the parse tree
+ */
+ void exitConceptBaseExt(VelvetParser.ConceptBaseExtContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#instanceImports}.
+ * @param ctx the parse tree
+ */
+ void enterInstanceImports(VelvetParser.InstanceImportsContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#instanceImports}.
+ * @param ctx the parse tree
+ */
+ void exitInstanceImports(VelvetParser.InstanceImportsContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#interfaceImports}.
+ * @param ctx the parse tree
+ */
+ void enterInterfaceImports(VelvetParser.InterfaceImportsContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#interfaceImports}.
+ * @param ctx the parse tree
+ */
+ void exitInterfaceImports(VelvetParser.InterfaceImportsContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#name}.
+ * @param ctx the parse tree
+ */
+ void enterName(VelvetParser.NameContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#name}.
+ * @param ctx the parse tree
+ */
+ void exitName(VelvetParser.NameContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#definitions}.
+ * @param ctx the parse tree
+ */
+ void enterDefinitions(VelvetParser.DefinitionsContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#definitions}.
+ * @param ctx the parse tree
+ */
+ void exitDefinitions(VelvetParser.DefinitionsContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#definition}.
+ * @param ctx the parse tree
+ */
+ void enterDefinition(VelvetParser.DefinitionContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#definition}.
+ * @param ctx the parse tree
+ */
+ void exitDefinition(VelvetParser.DefinitionContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#nonFeatureDefinition}.
+ * @param ctx the parse tree
+ */
+ void enterNonFeatureDefinition(VelvetParser.NonFeatureDefinitionContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#nonFeatureDefinition}.
+ * @param ctx the parse tree
+ */
+ void exitNonFeatureDefinition(VelvetParser.NonFeatureDefinitionContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#use}.
+ * @param ctx the parse tree
+ */
+ void enterUse(VelvetParser.UseContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#use}.
+ * @param ctx the parse tree
+ */
+ void exitUse(VelvetParser.UseContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#feature}.
+ * @param ctx the parse tree
+ */
+ void enterFeature(VelvetParser.FeatureContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#feature}.
+ * @param ctx the parse tree
+ */
+ void exitFeature(VelvetParser.FeatureContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#featureGroup}.
+ * @param ctx the parse tree
+ */
+ void enterFeatureGroup(VelvetParser.FeatureGroupContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#featureGroup}.
+ * @param ctx the parse tree
+ */
+ void exitFeatureGroup(VelvetParser.FeatureGroupContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#groupType}.
+ * @param ctx the parse tree
+ */
+ void enterGroupType(VelvetParser.GroupTypeContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#groupType}.
+ * @param ctx the parse tree
+ */
+ void exitGroupType(VelvetParser.GroupTypeContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#description}.
+ * @param ctx the parse tree
+ */
+ void enterDescription(VelvetParser.DescriptionContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#description}.
+ * @param ctx the parse tree
+ */
+ void exitDescription(VelvetParser.DescriptionContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#constraint}.
+ * @param ctx the parse tree
+ */
+ void enterConstraint(VelvetParser.ConstraintContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#constraint}.
+ * @param ctx the parse tree
+ */
+ void exitConstraint(VelvetParser.ConstraintContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#constraintDefinition}.
+ * @param ctx the parse tree
+ */
+ void enterConstraintDefinition(VelvetParser.ConstraintDefinitionContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#constraintDefinition}.
+ * @param ctx the parse tree
+ */
+ void exitConstraintDefinition(VelvetParser.ConstraintDefinitionContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#constraintOperand}.
+ * @param ctx the parse tree
+ */
+ void enterConstraintOperand(VelvetParser.ConstraintOperandContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#constraintOperand}.
+ * @param ctx the parse tree
+ */
+ void exitConstraintOperand(VelvetParser.ConstraintOperandContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#attribute}.
+ * @param ctx the parse tree
+ */
+ void enterAttribute(VelvetParser.AttributeContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#attribute}.
+ * @param ctx the parse tree
+ */
+ void exitAttribute(VelvetParser.AttributeContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#attributeConstraint}.
+ * @param ctx the parse tree
+ */
+ void enterAttributeConstraint(VelvetParser.AttributeConstraintContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#attributeConstraint}.
+ * @param ctx the parse tree
+ */
+ void exitAttributeConstraint(VelvetParser.AttributeConstraintContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#attribNumExpr}.
+ * @param ctx the parse tree
+ */
+ void enterAttribNumExpr(VelvetParser.AttribNumExprContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#attribNumExpr}.
+ * @param ctx the parse tree
+ */
+ void exitAttribNumExpr(VelvetParser.AttribNumExprContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#attribOperator}.
+ * @param ctx the parse tree
+ */
+ void enterAttribOperator(VelvetParser.AttribOperatorContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#attribOperator}.
+ * @param ctx the parse tree
+ */
+ void exitAttribOperator(VelvetParser.AttribOperatorContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#attribNumInstance}.
+ * @param ctx the parse tree
+ */
+ void enterAttribNumInstance(VelvetParser.AttribNumInstanceContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#attribNumInstance}.
+ * @param ctx the parse tree
+ */
+ void exitAttribNumInstance(VelvetParser.AttribNumInstanceContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#intAttribute}.
+ * @param ctx the parse tree
+ */
+ void enterIntAttribute(VelvetParser.IntAttributeContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#intAttribute}.
+ * @param ctx the parse tree
+ */
+ void exitIntAttribute(VelvetParser.IntAttributeContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#floatAttribute}.
+ * @param ctx the parse tree
+ */
+ void enterFloatAttribute(VelvetParser.FloatAttributeContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#floatAttribute}.
+ * @param ctx the parse tree
+ */
+ void exitFloatAttribute(VelvetParser.FloatAttributeContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#stringAttribute}.
+ * @param ctx the parse tree
+ */
+ void enterStringAttribute(VelvetParser.StringAttributeContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#stringAttribute}.
+ * @param ctx the parse tree
+ */
+ void exitStringAttribute(VelvetParser.StringAttributeContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#boolAttribute}.
+ * @param ctx the parse tree
+ */
+ void enterBoolAttribute(VelvetParser.BoolAttributeContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#boolAttribute}.
+ * @param ctx the parse tree
+ */
+ void exitBoolAttribute(VelvetParser.BoolAttributeContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#unaryOp}.
+ * @param ctx the parse tree
+ */
+ void enterUnaryOp(VelvetParser.UnaryOpContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#unaryOp}.
+ * @param ctx the parse tree
+ */
+ void exitUnaryOp(VelvetParser.UnaryOpContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#binaryOp}.
+ * @param ctx the parse tree
+ */
+ void enterBinaryOp(VelvetParser.BinaryOpContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#binaryOp}.
+ * @param ctx the parse tree
+ */
+ void exitBinaryOp(VelvetParser.BinaryOpContext ctx);
+ /**
+ * Enter a parse tree produced by {@link VelvetParser#attribRelation}.
+ * @param ctx the parse tree
+ */
+ void enterAttribRelation(VelvetParser.AttribRelationContext ctx);
+ /**
+ * Exit a parse tree produced by {@link VelvetParser#attribRelation}.
+ * @param ctx the parse tree
+ */
+ void exitAttribRelation(VelvetParser.AttribRelationContext ctx);
+}
\ No newline at end of file
diff --git a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetParser.java b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetParser.java
index 053f4ce203..8c1e26272d 100644
--- a/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetParser.java
+++ b/plugins/de.ovgu.featureide.fm.core/src/de/ovgu/featureide/fm/core/io/velvet/VelvetParser.java
@@ -1,4051 +1,2537 @@
-// $ANTLR 3.4 Velvet.g 2016-07-17 21:07:30
-/* FeatureIDE - A Framework for Feature-Oriented Software Development
- * Copyright (C) 2005-2019 FeatureIDE team, University of Magdeburg, Germany
- *
- * This file is part of FeatureIDE.
- *
- * FeatureIDE is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * FeatureIDE is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with FeatureIDE. If not, see .
- *
- * See http://featureide.cs.ovgu.de/ for further information.
- */
+// Generated from Velvet.g4 by ANTLR 4.13.2
+
package de.ovgu.featureide.fm.core.io.velvet;
-import org.antlr.runtime.BaseRecognizer;
-import org.antlr.runtime.BitSet;
-import org.antlr.runtime.DFA;
-import org.antlr.runtime.EarlyExitException;
-import org.antlr.runtime.MismatchedSetException;
-import org.antlr.runtime.NoViableAltException;
-import org.antlr.runtime.Parser;
-import org.antlr.runtime.ParserRuleReturnScope;
-import org.antlr.runtime.RecognitionException;
-import org.antlr.runtime.RecognizerSharedState;
-import org.antlr.runtime.Token;
-import org.antlr.runtime.TokenStream;
-import org.antlr.runtime.tree.CommonTreeAdaptor;
-import org.antlr.runtime.tree.RewriteEarlyExitException;
-import org.antlr.runtime.tree.RewriteRuleSubtreeStream;
-import org.antlr.runtime.tree.RewriteRuleTokenStream;
-import org.antlr.runtime.tree.Tree;
-import org.antlr.runtime.tree.TreeAdaptor;
-
-import de.ovgu.featureide.fm.core.Logger;
-
-@SuppressWarnings({ "all", "warnings", "unchecked" })
+import de.ovgu.featureide.fm.core.FMCorePlugin;
+import org.antlr.v4.runtime.atn.*;
+import org.antlr.v4.runtime.dfa.DFA;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.misc.*;
+import org.antlr.v4.runtime.tree.*;
+import java.util.List;
+import java.util.Iterator;
+import java.util.ArrayList;
+
+@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"})
public class VelvetParser extends Parser {
-
- public static final String[] tokenNames = new String[] { "", "", "", "", "ABSTRACT", "ACONSTR", "ATTR", "ATTR_OP_EQUALS",
- "ATTR_OP_GREATER", "ATTR_OP_GREATER_EQ", "ATTR_OP_LESS", "ATTR_OP_LESS_EQ", "ATTR_OP_NOT_EQUALS", "BASEEXT", "BOOLEAN", "CINTERFACE", "COLON", "COMMA",
- "CONCEPT", "CONSTR", "CONSTRAINT", "DEF", "DESCRIPTION", "EMPTY", "END_C", "END_R", "EQ", "ESC_SEQ", "EXPONENT", "FEATURE", "FLOAT", "GROUP",
- "HEX_DIGIT", "ID", "IDPath", "IMPORT", "IMPORTINSTANCE", "IMPORTINTERFACE", "INT", "MANDATORY", "MINUS", "ML_COMMENT", "OCTAL_ESC", "ONEOF", "OPERAND",
- "OP_AND", "OP_EQUIVALENT", "OP_IMPLIES", "OP_NOT", "OP_OR", "OP_XOR", "PLUS", "SEMI", "SL_COMMENT", "SOMEOF", "START_C", "START_R", "STRING", "UNARYOP",
- "UNICODE_ESC", "USE", "VAR_BOOL", "VAR_FLOAT", "VAR_INT", "VAR_STRING", "WS" };
-
- public static final int EOF = -1;
- public static final int ABSTRACT = 4;
- public static final int ACONSTR = 5;
- public static final int ATTR = 6;
- public static final int ATTR_OP_EQUALS = 7;
- public static final int ATTR_OP_GREATER = 8;
- public static final int ATTR_OP_GREATER_EQ = 9;
- public static final int ATTR_OP_LESS = 10;
- public static final int ATTR_OP_LESS_EQ = 11;
- public static final int ATTR_OP_NOT_EQUALS = 12;
- public static final int BASEEXT = 13;
- public static final int BOOLEAN = 14;
- public static final int CINTERFACE = 15;
- public static final int COLON = 16;
- public static final int COMMA = 17;
- public static final int CONCEPT = 18;
- public static final int CONSTR = 19;
- public static final int CONSTRAINT = 20;
- public static final int DEF = 21;
- public static final int DESCRIPTION = 22;
- public static final int EMPTY = 23;
- public static final int END_C = 24;
- public static final int END_R = 25;
- public static final int EQ = 26;
- public static final int ESC_SEQ = 27;
- public static final int EXPONENT = 28;
- public static final int FEATURE = 29;
- public static final int FLOAT = 30;
- public static final int GROUP = 31;
- public static final int HEX_DIGIT = 32;
- public static final int ID = 33;
- public static final int IDPath = 34;
- public static final int IMPORT = 35;
- public static final int IMPORTINSTANCE = 36;
- public static final int IMPORTINTERFACE = 37;
- public static final int INT = 38;
- public static final int MANDATORY = 39;
- public static final int MINUS = 40;
- public static final int ML_COMMENT = 41;
- public static final int OCTAL_ESC = 42;
- public static final int ONEOF = 43;
- public static final int OPERAND = 44;
- public static final int OP_AND = 45;
- public static final int OP_EQUIVALENT = 46;
- public static final int OP_IMPLIES = 47;
- public static final int OP_NOT = 48;
- public static final int OP_OR = 49;
- public static final int OP_XOR = 50;
- public static final int PLUS = 51;
- public static final int SEMI = 52;
- public static final int SL_COMMENT = 53;
- public static final int SOMEOF = 54;
- public static final int START_C = 55;
- public static final int START_R = 56;
- public static final int STRING = 57;
- public static final int UNARYOP = 58;
- public static final int UNICODE_ESC = 59;
- public static final int USE = 60;
- public static final int VAR_BOOL = 61;
- public static final int VAR_FLOAT = 62;
- public static final int VAR_INT = 63;
- public static final int VAR_STRING = 64;
- public static final int WS = 65;
-
- // delegates
- public Parser[] getDelegates() {
- return new Parser[] {};
- }
-
- // delegators
-
- public VelvetParser(TokenStream input) {
- this(input, new RecognizerSharedState());
+ static { RuntimeMetaData.checkVersion("4.13.2", RuntimeMetaData.VERSION); }
+
+ protected static final DFA[] _decisionToDFA;
+ protected static final PredictionContextCache _sharedContextCache =
+ new PredictionContextCache();
+ public static final int
+ IMPORT=1, MANDATORY=2, ABSTRACT=3, SOMEOF=4, ONEOF=5, CONCEPT=6, CINTERFACE=7,
+ CONSTRAINT=8, FEATURE=9, USE=10, IMPORTINSTANCE=11, IMPORTINTERFACE=12,
+ DESCRIPTION=13, VAR_INT=14, VAR_FLOAT=15, VAR_STRING=16, VAR_BOOL=17,
+ SEMI=18, START_C=19, END_C=20, START_R=21, END_R=22, EQ=23, COMMA=24,
+ COLON=25, PLUS=26, MINUS=27, OP_NOT=28, OP_AND=29, OP_OR=30, OP_XOR=31,
+ OP_IMPLIES=32, OP_EQUIVALENT=33, ATTR_OP_EQUALS=34, ATTR_OP_NOT_EQUALS=35,
+ ATTR_OP_GREATER=36, ATTR_OP_LESS=37, ATTR_OP_GREATER_EQ=38, ATTR_OP_LESS_EQ=39,
+ EMPTY=40, CONSTR=41, ACONSTR=42, BASEEXT=43, DEF=44, GROUP=45, ATTR=46,
+ UNARYOP=47, OPERAND=48, BOOLEAN=49, ID=50, IDPath=51, INT=52, FLOAT=53,
+ STRING=54, WS=55, SL_COMMENT=56, ML_COMMENT=57;
+ public static final int
+ RULE_velvetModel = 0, RULE_imp = 1, RULE_concept = 2, RULE_cinterface = 3,
+ RULE_conceptBaseExt = 4, RULE_instanceImports = 5, RULE_interfaceImports = 6,
+ RULE_name = 7, RULE_definitions = 8, RULE_definition = 9, RULE_nonFeatureDefinition = 10,
+ RULE_use = 11, RULE_feature = 12, RULE_featureGroup = 13, RULE_groupType = 14,
+ RULE_description = 15, RULE_constraint = 16, RULE_constraintDefinition = 17,
+ RULE_constraintOperand = 18, RULE_attribute = 19, RULE_attributeConstraint = 20,
+ RULE_attribNumExpr = 21, RULE_attribOperator = 22, RULE_attribNumInstance = 23,
+ RULE_intAttribute = 24, RULE_floatAttribute = 25, RULE_stringAttribute = 26,
+ RULE_boolAttribute = 27, RULE_unaryOp = 28, RULE_binaryOp = 29, RULE_attribRelation = 30;
+ private static String[] makeRuleNames() {
+ return new String[] {
+ "velvetModel", "imp", "concept", "cinterface", "conceptBaseExt", "instanceImports",
+ "interfaceImports", "name", "definitions", "definition", "nonFeatureDefinition",
+ "use", "feature", "featureGroup", "groupType", "description", "constraint",
+ "constraintDefinition", "constraintOperand", "attribute", "attributeConstraint",
+ "attribNumExpr", "attribOperator", "attribNumInstance", "intAttribute",
+ "floatAttribute", "stringAttribute", "boolAttribute", "unaryOp", "binaryOp",
+ "attribRelation"
+ };
}
-
- public VelvetParser(TokenStream input, RecognizerSharedState state) {
- super(input, state);
+ public static final String[] ruleNames = makeRuleNames();
+
+ private static String[] makeLiteralNames() {
+ return new String[] {
+ null, "'import'", "'mandatory'", "'abstract'", "'someOf'", "'oneOf'",
+ "'concept'", "'cinterface'", "'constraint'", "'feature'", "'use'", "'instance'",
+ "'interface'", "'description'", "'int'", "'float'", "'string'", "'bool'",
+ "';'", "'{'", "'}'", "'('", "')'", "'='", "','", "':'", "'+'", "'-'",
+ "'!'", "'&&'", "'||'", "'xor'", "'->'", "'<->'", "'=='", "'!='", "'>'",
+ "'<'", "'>='", "'<='", "'EMPTY'", "'CONSTR'", "'ACONSTR'", "'BASEEXT'",
+ "'DEF'", "'GROUP'", "'ATTR'", "'UNARYOP'", "'OPERAND'"
+ };
}
-
- protected TreeAdaptor adaptor = new CommonTreeAdaptor();
-
- public void setTreeAdaptor(TreeAdaptor adaptor) {
- this.adaptor = adaptor;
+ private static final String[] _LITERAL_NAMES = makeLiteralNames();
+ private static String[] makeSymbolicNames() {
+ return new String[] {
+ null, "IMPORT", "MANDATORY", "ABSTRACT", "SOMEOF", "ONEOF", "CONCEPT",
+ "CINTERFACE", "CONSTRAINT", "FEATURE", "USE", "IMPORTINSTANCE", "IMPORTINTERFACE",
+ "DESCRIPTION", "VAR_INT", "VAR_FLOAT", "VAR_STRING", "VAR_BOOL", "SEMI",
+ "START_C", "END_C", "START_R", "END_R", "EQ", "COMMA", "COLON", "PLUS",
+ "MINUS", "OP_NOT", "OP_AND", "OP_OR", "OP_XOR", "OP_IMPLIES", "OP_EQUIVALENT",
+ "ATTR_OP_EQUALS", "ATTR_OP_NOT_EQUALS", "ATTR_OP_GREATER", "ATTR_OP_LESS",
+ "ATTR_OP_GREATER_EQ", "ATTR_OP_LESS_EQ", "EMPTY", "CONSTR", "ACONSTR",
+ "BASEEXT", "DEF", "GROUP", "ATTR", "UNARYOP", "OPERAND", "BOOLEAN", "ID",
+ "IDPath", "INT", "FLOAT", "STRING", "WS", "SL_COMMENT", "ML_COMMENT"
+ };
}
+ private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
+ public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
+
+ /**
+ * @deprecated Use {@link #VOCABULARY} instead.
+ */
+ @Deprecated
+ public static final String[] tokenNames;
+ static {
+ tokenNames = new String[_SYMBOLIC_NAMES.length];
+ for (int i = 0; i < tokenNames.length; i++) {
+ tokenNames[i] = VOCABULARY.getLiteralName(i);
+ if (tokenNames[i] == null) {
+ tokenNames[i] = VOCABULARY.getSymbolicName(i);
+ }
- public TreeAdaptor getTreeAdaptor() {
- return adaptor;
+ if (tokenNames[i] == null) {
+ tokenNames[i] = "";
+ }
+ }
}
@Override
+ @Deprecated
public String[] getTokenNames() {
- return VelvetParser.tokenNames;
+ return tokenNames;
}
@Override
- public String getGrammarFileName() {
- return "Velvet.g";
+
+ public Vocabulary getVocabulary() {
+ return VOCABULARY;
}
@Override
- public void emitErrorMessage(String msg) {
- Logger.logError(new Exception(msg));
- }
+ public String getGrammarFileName() { return "Velvet.g4"; }
@Override
- public void reportError(RecognitionException e) {
- throw new InternalSyntaxException(e);
- }
+ public String[] getRuleNames() { return ruleNames; }
- public class InternalSyntaxException extends RuntimeException {
+ @Override
+ public String getSerializedATN() { return _serializedATN; }
- private final RecognitionException e;
+ @Override
+ public ATN getATN() { return _ATN; }
- public InternalSyntaxException(RecognitionException e) {
- this.e = e;
- }
- public RecognitionException getException() {
+ public class InternalSyntaxException extends RuntimeException{
+ private final RecognitionException e;
+ public InternalSyntaxException(RecognitionException e){
+ this.e = e;
+ }
+
+ public RecognitionException getException(){
return e;
}
}
- public static class velvetModel_return extends ParserRuleReturnScope {
-
- Tree tree;
+ public VelvetParser(TokenStream input) {
+ super(input);
+ _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
+ }
+ @SuppressWarnings("CheckReturnValue")
+ public static class VelvetModelContext extends ParserRuleContext {
+ public TerminalNode EOF() { return getToken(VelvetParser.EOF, 0); }
+ public ConceptContext concept() {
+ return getRuleContext(ConceptContext.class,0);
+ }
+ public CinterfaceContext cinterface() {
+ return getRuleContext(CinterfaceContext.class,0);
+ }
+ public ImpContext imp() {
+ return getRuleContext(ImpContext.class,0);
+ }
+ public VelvetModelContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_velvetModel; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterVelvetModel(this);
}
- };
-
- // $ANTLR start "velvetModel"
- // Velvet.g:93:1: velvetModel : ( imp )? ( concept | cinterface ) EOF ;
- public final VelvetParser.velvetModel_return velvetModel() throws RecognitionException {
- final VelvetParser.velvetModel_return retval = new VelvetParser.velvetModel_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token EOF4 = null;
- VelvetParser.imp_return imp1 = null;
-
- VelvetParser.concept_return concept2 = null;
-
- VelvetParser.cinterface_return cinterface3 = null;
-
- Tree EOF4_tree = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitVelvetModel(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitVelvetModel(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public final VelvetModelContext velvetModel() throws RecognitionException {
+ VelvetModelContext _localctx = new VelvetModelContext(_ctx, getState());
+ enterRule(_localctx, 0, RULE_velvetModel);
+ int _la;
try {
- // Velvet.g:94:2: ( ( imp )? ( concept | cinterface ) EOF )
- // Velvet.g:94:4: ( imp )? ( concept | cinterface ) EOF
+ enterOuterAlt(_localctx, 1);
{
- root_0 = (Tree) adaptor.nil();
-
- // Velvet.g:94:4: ( imp )?
- int alt1 = 2;
- final int LA1_0 = input.LA(1);
-
- if ((LA1_0 == IMPORT)) {
- alt1 = 1;
- }
- switch (alt1) {
- case 1:
- // Velvet.g:94:4: imp
+ setState(63);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==IMPORT) {
{
- pushFollow(FOLLOW_imp_in_velvetModel472);
- imp1 = imp();
-
- state._fsp--;
-
- adaptor.addChild(root_0, imp1.getTree());
-
+ setState(62);
+ imp();
}
- break;
-
- }
-
- // Velvet.g:94:9: ( concept | cinterface )
- int alt2 = 2;
- final int LA2_0 = input.LA(1);
-
- if ((LA2_0 == CONCEPT)) {
- alt2 = 1;
- } else if ((LA2_0 == CINTERFACE)) {
- alt2 = 2;
- } else {
- final NoViableAltException nvae = new NoViableAltException("", 2, 0, input);
-
- throw nvae;
+ }
- }
- switch (alt2) {
- case 1:
- // Velvet.g:94:10: concept
+ setState(67);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case CONCEPT:
{
- pushFollow(FOLLOW_concept_in_velvetModel476);
- concept2 = concept();
-
- state._fsp--;
-
- adaptor.addChild(root_0, concept2.getTree());
-
+ setState(65);
+ concept();
}
- break;
- case 2:
- // Velvet.g:94:18: cinterface
+ break;
+ case CINTERFACE:
{
- pushFollow(FOLLOW_cinterface_in_velvetModel478);
- cinterface3 = cinterface();
-
- state._fsp--;
-
- adaptor.addChild(root_0, cinterface3.getTree());
-
- }
- break;
-
+ setState(66);
+ cinterface();
}
-
- EOF4 = (Token) match(input, EOF, FOLLOW_EOF_in_velvetModel481);
- EOF4_tree = (Tree) adaptor.create(EOF4);
- adaptor.addChild(root_0, EOF4_tree);
-
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(69);
+ match(EOF);
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "velvetModel"
-
- public static class imp_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class ImpContext extends ParserRuleContext {
+ public List IMPORT() { return getTokens(VelvetParser.IMPORT); }
+ public TerminalNode IMPORT(int i) {
+ return getToken(VelvetParser.IMPORT, i);
+ }
+ public List name() {
+ return getRuleContexts(NameContext.class);
+ }
+ public NameContext name(int i) {
+ return getRuleContext(NameContext.class,i);
+ }
+ public List SEMI() { return getTokens(VelvetParser.SEMI); }
+ public TerminalNode SEMI(int i) {
+ return getToken(VelvetParser.SEMI, i);
+ }
+ public ImpContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_imp; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterImp(this);
}
- };
-
- // $ANTLR start "imp"
- // Velvet.g:97:1: imp : ( IMPORT name SEMI )+ -> ^( IMPORT ( name )+ ) ;
- public final VelvetParser.imp_return imp() throws RecognitionException {
- final VelvetParser.imp_return retval = new VelvetParser.imp_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token IMPORT5 = null;
- Token SEMI7 = null;
- VelvetParser.name_return name6 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitImp(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitImp(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree IMPORT5_tree = null;
- final Tree SEMI7_tree = null;
- final RewriteRuleTokenStream stream_IMPORT = new RewriteRuleTokenStream(adaptor, "token IMPORT");
- final RewriteRuleTokenStream stream_SEMI = new RewriteRuleTokenStream(adaptor, "token SEMI");
- final RewriteRuleSubtreeStream stream_name = new RewriteRuleSubtreeStream(adaptor, "rule name");
+ public final ImpContext imp() throws RecognitionException {
+ ImpContext _localctx = new ImpContext(_ctx, getState());
+ enterRule(_localctx, 2, RULE_imp);
+ int _la;
try {
- // Velvet.g:98:2: ( ( IMPORT name SEMI )+ -> ^( IMPORT ( name )+ ) )
- // Velvet.g:98:4: ( IMPORT name SEMI )+
+ enterOuterAlt(_localctx, 1);
{
- // Velvet.g:98:4: ( IMPORT name SEMI )+
- int cnt3 = 0;
- loop3: do {
- int alt3 = 2;
- final int LA3_0 = input.LA(1);
-
- if ((LA3_0 == IMPORT)) {
- alt3 = 1;
- }
-
- switch (alt3) {
- case 1:
- // Velvet.g:98:5: IMPORT name SEMI
- {
- IMPORT5 = (Token) match(input, IMPORT, FOLLOW_IMPORT_in_imp493);
- stream_IMPORT.add(IMPORT5);
-
- pushFollow(FOLLOW_name_in_imp495);
- name6 = name();
-
- state._fsp--;
-
- stream_name.add(name6.getTree());
-
- SEMI7 = (Token) match(input, SEMI, FOLLOW_SEMI_in_imp497);
- stream_SEMI.add(SEMI7);
-
- }
- break;
-
- default:
- if (cnt3 >= 1) {
- break loop3;
- }
- final EarlyExitException eee = new EarlyExitException(3, input);
- throw eee;
- }
- cnt3++;
- } while (true);
-
- // AST REWRITE
- // elements: IMPORT, name
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 99:2: -> ^( IMPORT ( name )+ )
+ setState(75);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
{
- // Velvet.g:99:5: ^( IMPORT ( name )+ )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(stream_IMPORT.nextNode(), root_1);
-
- if (!(stream_name.hasNext())) {
- throw new RewriteEarlyExitException();
- }
- while (stream_name.hasNext()) {
- adaptor.addChild(root_1, stream_name.nextTree());
-
- }
- stream_name.reset();
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- retval.tree = root_0;
-
+ {
+ setState(71);
+ match(IMPORT);
+ setState(72);
+ name();
+ setState(73);
+ match(SEMI);
+ }
+ }
+ setState(77);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( _la==IMPORT );
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "imp"
-
- public static class concept_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class ConceptContext extends ParserRuleContext {
+ public TerminalNode CONCEPT() { return getToken(VelvetParser.CONCEPT, 0); }
+ public TerminalNode ID() { return getToken(VelvetParser.ID, 0); }
+ public TerminalNode COLON() { return getToken(VelvetParser.COLON, 0); }
+ public ConceptBaseExtContext conceptBaseExt() {
+ return getRuleContext(ConceptBaseExtContext.class,0);
+ }
+ public InstanceImportsContext instanceImports() {
+ return getRuleContext(InstanceImportsContext.class,0);
+ }
+ public InterfaceImportsContext interfaceImports() {
+ return getRuleContext(InterfaceImportsContext.class,0);
+ }
+ public DefinitionsContext definitions() {
+ return getRuleContext(DefinitionsContext.class,0);
+ }
+ public ConceptContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_concept; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterConcept(this);
}
- };
-
- // $ANTLR start "concept"
- // Velvet.g:102:1: concept : CONCEPT ID ( COLON conceptBaseExt )? ( instanceImports interfaceImports | interfaceImports instanceImports | interfaceImports |
- // instanceImports )? ( definitions )? -> ^( CONCEPT ID ( conceptBaseExt )? ( instanceImports )? ( interfaceImports )? ( definitions )? ) ;
- public final VelvetParser.concept_return concept() throws RecognitionException {
- final VelvetParser.concept_return retval = new VelvetParser.concept_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token CONCEPT8 = null;
- Token ID9 = null;
- Token COLON10 = null;
- VelvetParser.conceptBaseExt_return conceptBaseExt11 = null;
-
- VelvetParser.instanceImports_return instanceImports12 = null;
-
- VelvetParser.interfaceImports_return interfaceImports13 = null;
-
- VelvetParser.interfaceImports_return interfaceImports14 = null;
-
- VelvetParser.instanceImports_return instanceImports15 = null;
-
- VelvetParser.interfaceImports_return interfaceImports16 = null;
-
- VelvetParser.instanceImports_return instanceImports17 = null;
-
- VelvetParser.definitions_return definitions18 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitConcept(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitConcept(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree CONCEPT8_tree = null;
- final Tree ID9_tree = null;
- final Tree COLON10_tree = null;
- final RewriteRuleTokenStream stream_COLON = new RewriteRuleTokenStream(adaptor, "token COLON");
- final RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor, "token ID");
- final RewriteRuleTokenStream stream_CONCEPT = new RewriteRuleTokenStream(adaptor, "token CONCEPT");
- final RewriteRuleSubtreeStream stream_conceptBaseExt = new RewriteRuleSubtreeStream(adaptor, "rule conceptBaseExt");
- final RewriteRuleSubtreeStream stream_instanceImports = new RewriteRuleSubtreeStream(adaptor, "rule instanceImports");
- final RewriteRuleSubtreeStream stream_interfaceImports = new RewriteRuleSubtreeStream(adaptor, "rule interfaceImports");
- final RewriteRuleSubtreeStream stream_definitions = new RewriteRuleSubtreeStream(adaptor, "rule definitions");
+ public final ConceptContext concept() throws RecognitionException {
+ ConceptContext _localctx = new ConceptContext(_ctx, getState());
+ enterRule(_localctx, 4, RULE_concept);
+ int _la;
try {
- // Velvet.g:103:2: ( CONCEPT ID ( COLON conceptBaseExt )? ( instanceImports interfaceImports | interfaceImports instanceImports | interfaceImports |
- // instanceImports )? ( definitions )? -> ^( CONCEPT ID ( conceptBaseExt )? ( instanceImports )? ( interfaceImports )? ( definitions )? ) )
- // Velvet.g:103:4: CONCEPT ID ( COLON conceptBaseExt )? ( instanceImports interfaceImports | interfaceImports instanceImports | interfaceImports |
- // instanceImports )? ( definitions )?
+ enterOuterAlt(_localctx, 1);
{
- CONCEPT8 = (Token) match(input, CONCEPT, FOLLOW_CONCEPT_in_concept521);
- stream_CONCEPT.add(CONCEPT8);
-
- ID9 = (Token) match(input, ID, FOLLOW_ID_in_concept523);
- stream_ID.add(ID9);
-
- // Velvet.g:104:3: ( COLON conceptBaseExt )?
- int alt4 = 2;
- final int LA4_0 = input.LA(1);
-
- if ((LA4_0 == COLON)) {
- alt4 = 1;
- }
- switch (alt4) {
- case 1:
- // Velvet.g:104:4: COLON conceptBaseExt
+ setState(79);
+ match(CONCEPT);
+ setState(80);
+ match(ID);
+ setState(83);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==COLON) {
{
- COLON10 = (Token) match(input, COLON, FOLLOW_COLON_in_concept530);
- stream_COLON.add(COLON10);
-
- pushFollow(FOLLOW_conceptBaseExt_in_concept532);
- conceptBaseExt11 = conceptBaseExt();
-
- state._fsp--;
-
- stream_conceptBaseExt.add(conceptBaseExt11.getTree());
-
- }
- break;
-
+ setState(81);
+ match(COLON);
+ setState(82);
+ conceptBaseExt();
}
+ }
- // Velvet.g:104:27: ( instanceImports interfaceImports | interfaceImports instanceImports | interfaceImports | instanceImports )?
- int alt5 = 5;
- alt5 = dfa5.predict(input);
- switch (alt5) {
- case 1:
- // Velvet.g:104:28: instanceImports interfaceImports
+ setState(93);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
+ case 1:
{
- pushFollow(FOLLOW_instanceImports_in_concept537);
- instanceImports12 = instanceImports();
-
- state._fsp--;
-
- stream_instanceImports.add(instanceImports12.getTree());
-
- pushFollow(FOLLOW_interfaceImports_in_concept539);
- interfaceImports13 = interfaceImports();
-
- state._fsp--;
-
- stream_interfaceImports.add(interfaceImports13.getTree());
-
+ setState(85);
+ instanceImports();
+ setState(86);
+ interfaceImports();
}
- break;
- case 2:
- // Velvet.g:104:63: interfaceImports instanceImports
+ break;
+ case 2:
{
- pushFollow(FOLLOW_interfaceImports_in_concept543);
- interfaceImports14 = interfaceImports();
-
- state._fsp--;
-
- stream_interfaceImports.add(interfaceImports14.getTree());
-
- pushFollow(FOLLOW_instanceImports_in_concept545);
- instanceImports15 = instanceImports();
-
- state._fsp--;
-
- stream_instanceImports.add(instanceImports15.getTree());
-
+ setState(88);
+ interfaceImports();
+ setState(89);
+ instanceImports();
}
- break;
- case 3:
- // Velvet.g:104:98: interfaceImports
+ break;
+ case 3:
{
- pushFollow(FOLLOW_interfaceImports_in_concept549);
- interfaceImports16 = interfaceImports();
-
- state._fsp--;
-
- stream_interfaceImports.add(interfaceImports16.getTree());
-
+ setState(91);
+ interfaceImports();
}
- break;
- case 4:
- // Velvet.g:104:117: instanceImports
+ break;
+ case 4:
{
- pushFollow(FOLLOW_instanceImports_in_concept553);
- instanceImports17 = instanceImports();
-
- state._fsp--;
-
- stream_instanceImports.add(instanceImports17.getTree());
-
+ setState(92);
+ instanceImports();
}
- break;
-
- }
-
- // Velvet.g:105:3: ( definitions )?
- int alt6 = 2;
- final int LA6_0 = input.LA(1);
-
- if ((LA6_0 == START_C)) {
- alt6 = 1;
- }
- switch (alt6) {
- case 1:
- // Velvet.g:105:3: definitions
+ break;
+ }
+ setState(96);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==START_C) {
{
- pushFollow(FOLLOW_definitions_in_concept560);
- definitions18 = definitions();
-
- state._fsp--;
-
- stream_definitions.add(definitions18.getTree());
-
- }
- break;
-
+ setState(95);
+ definitions();
}
+ }
- // AST REWRITE
- // elements: ID, definitions, interfaceImports, instanceImports, CONCEPT, conceptBaseExt
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 106:2: -> ^( CONCEPT ID ( conceptBaseExt )? ( instanceImports )? ( interfaceImports )? ( definitions )? )
- {
- // Velvet.g:106:5: ^( CONCEPT ID ( conceptBaseExt )? ( instanceImports )? ( interfaceImports )? ( definitions )? )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(stream_CONCEPT.nextNode(), root_1);
-
- adaptor.addChild(root_1, stream_ID.nextNode());
-
- // Velvet.g:106:18: ( conceptBaseExt )?
- if (stream_conceptBaseExt.hasNext()) {
- adaptor.addChild(root_1, stream_conceptBaseExt.nextTree());
-
- }
- stream_conceptBaseExt.reset();
-
- // Velvet.g:106:34: ( instanceImports )?
- if (stream_instanceImports.hasNext()) {
- adaptor.addChild(root_1, stream_instanceImports.nextTree());
-
- }
- stream_instanceImports.reset();
-
- // Velvet.g:106:51: ( interfaceImports )?
- if (stream_interfaceImports.hasNext()) {
- adaptor.addChild(root_1, stream_interfaceImports.nextTree());
-
- }
- stream_interfaceImports.reset();
-
- // Velvet.g:106:69: ( definitions )?
- if (stream_definitions.hasNext()) {
- adaptor.addChild(root_1, stream_definitions.nextTree());
-
- }
- stream_definitions.reset();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
- adaptor.addChild(root_0, root_1);
- }
+ @SuppressWarnings("CheckReturnValue")
+ public static class CinterfaceContext extends ParserRuleContext {
+ public TerminalNode CINTERFACE() { return getToken(VelvetParser.CINTERFACE, 0); }
+ public TerminalNode ID() { return getToken(VelvetParser.ID, 0); }
+ public DefinitionsContext definitions() {
+ return getRuleContext(DefinitionsContext.class,0);
+ }
+ public TerminalNode COLON() { return getToken(VelvetParser.COLON, 0); }
+ public ConceptBaseExtContext conceptBaseExt() {
+ return getRuleContext(ConceptBaseExtContext.class,0);
+ }
+ public CinterfaceContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_cinterface; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterCinterface(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitCinterface(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitCinterface(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public final CinterfaceContext cinterface() throws RecognitionException {
+ CinterfaceContext _localctx = new CinterfaceContext(_ctx, getState());
+ enterRule(_localctx, 6, RULE_cinterface);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(98);
+ match(CINTERFACE);
+ setState(99);
+ match(ID);
+ setState(102);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==COLON) {
+ {
+ setState(100);
+ match(COLON);
+ setState(101);
+ conceptBaseExt();
}
-
- retval.tree = root_0;
-
}
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
+ setState(104);
+ definitions();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
}
-
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "concept"
-
- public static class cinterface_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class ConceptBaseExtContext extends ParserRuleContext {
+ public List ID() { return getTokens(VelvetParser.ID); }
+ public TerminalNode ID(int i) {
+ return getToken(VelvetParser.ID, i);
+ }
+ public List COMMA() { return getTokens(VelvetParser.COMMA); }
+ public TerminalNode COMMA(int i) {
+ return getToken(VelvetParser.COMMA, i);
+ }
+ public ConceptBaseExtContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_conceptBaseExt; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterConceptBaseExt(this);
}
- };
-
- // $ANTLR start "cinterface"
- // Velvet.g:109:1: cinterface : CINTERFACE ID ( COLON conceptBaseExt )? definitions -> ^( CINTERFACE ID ( conceptBaseExt )? definitions ) ;
- public final VelvetParser.cinterface_return cinterface() throws RecognitionException {
- final VelvetParser.cinterface_return retval = new VelvetParser.cinterface_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token CINTERFACE19 = null;
- Token ID20 = null;
- Token COLON21 = null;
- VelvetParser.conceptBaseExt_return conceptBaseExt22 = null;
-
- VelvetParser.definitions_return definitions23 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitConceptBaseExt(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitConceptBaseExt(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree CINTERFACE19_tree = null;
- final Tree ID20_tree = null;
- final Tree COLON21_tree = null;
- final RewriteRuleTokenStream stream_COLON = new RewriteRuleTokenStream(adaptor, "token COLON");
- final RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor, "token ID");
- final RewriteRuleTokenStream stream_CINTERFACE = new RewriteRuleTokenStream(adaptor, "token CINTERFACE");
- final RewriteRuleSubtreeStream stream_conceptBaseExt = new RewriteRuleSubtreeStream(adaptor, "rule conceptBaseExt");
- final RewriteRuleSubtreeStream stream_definitions = new RewriteRuleSubtreeStream(adaptor, "rule definitions");
+ public final ConceptBaseExtContext conceptBaseExt() throws RecognitionException {
+ ConceptBaseExtContext _localctx = new ConceptBaseExtContext(_ctx, getState());
+ enterRule(_localctx, 8, RULE_conceptBaseExt);
+ int _la;
try {
- // Velvet.g:109:12: ( CINTERFACE ID ( COLON conceptBaseExt )? definitions -> ^( CINTERFACE ID ( conceptBaseExt )? definitions ) )
- // Velvet.g:109:14: CINTERFACE ID ( COLON conceptBaseExt )? definitions
+ enterOuterAlt(_localctx, 1);
{
- CINTERFACE19 = (Token) match(input, CINTERFACE, FOLLOW_CINTERFACE_in_cinterface593);
- stream_CINTERFACE.add(CINTERFACE19);
-
- ID20 = (Token) match(input, ID, FOLLOW_ID_in_cinterface595);
- stream_ID.add(ID20);
-
- // Velvet.g:109:29: ( COLON conceptBaseExt )?
- int alt7 = 2;
- final int LA7_0 = input.LA(1);
-
- if ((LA7_0 == COLON)) {
- alt7 = 1;
- }
- switch (alt7) {
- case 1:
- // Velvet.g:109:30: COLON conceptBaseExt
+ setState(106);
+ match(ID);
+ setState(111);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==COMMA) {
{
- COLON21 = (Token) match(input, COLON, FOLLOW_COLON_in_cinterface599);
- stream_COLON.add(COLON21);
-
- pushFollow(FOLLOW_conceptBaseExt_in_cinterface601);
- conceptBaseExt22 = conceptBaseExt();
-
- state._fsp--;
-
- stream_conceptBaseExt.add(conceptBaseExt22.getTree());
-
+ {
+ setState(107);
+ match(COMMA);
+ setState(108);
+ match(ID);
}
- break;
-
}
-
- pushFollow(FOLLOW_definitions_in_cinterface605);
- definitions23 = definitions();
-
- state._fsp--;
-
- stream_definitions.add(definitions23.getTree());
-
- // AST REWRITE
- // elements: conceptBaseExt, ID, definitions, CINTERFACE
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 110:2: -> ^( CINTERFACE ID ( conceptBaseExt )? definitions )
- {
- // Velvet.g:110:5: ^( CINTERFACE ID ( conceptBaseExt )? definitions )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(stream_CINTERFACE.nextNode(), root_1);
-
- adaptor.addChild(root_1, stream_ID.nextNode());
-
- // Velvet.g:110:21: ( conceptBaseExt )?
- if (stream_conceptBaseExt.hasNext()) {
- adaptor.addChild(root_1, stream_conceptBaseExt.nextTree());
-
- }
- stream_conceptBaseExt.reset();
-
- adaptor.addChild(root_1, stream_definitions.nextTree());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- retval.tree = root_0;
-
+ setState(113);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "cinterface"
-
- public static class conceptBaseExt_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class InstanceImportsContext extends ParserRuleContext {
+ public TerminalNode IMPORTINSTANCE() { return getToken(VelvetParser.IMPORTINSTANCE, 0); }
+ public List ID() { return getTokens(VelvetParser.ID); }
+ public TerminalNode ID(int i) {
+ return getToken(VelvetParser.ID, i);
+ }
+ public List name() {
+ return getRuleContexts(NameContext.class);
+ }
+ public NameContext name(int i) {
+ return getRuleContext(NameContext.class,i);
+ }
+ public List COMMA() { return getTokens(VelvetParser.COMMA); }
+ public TerminalNode COMMA(int i) {
+ return getToken(VelvetParser.COMMA, i);
+ }
+ public InstanceImportsContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_instanceImports; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterInstanceImports(this);
}
- };
-
- // $ANTLR start "conceptBaseExt"
- // Velvet.g:113:1: conceptBaseExt : ID ( COMMA ID )* -> ^( BASEEXT ( ID )+ ) ;
- public final VelvetParser.conceptBaseExt_return conceptBaseExt() throws RecognitionException {
- final VelvetParser.conceptBaseExt_return retval = new VelvetParser.conceptBaseExt_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token ID24 = null;
- Token COMMA25 = null;
- Token ID26 = null;
-
- final Tree ID24_tree = null;
- final Tree COMMA25_tree = null;
- final Tree ID26_tree = null;
- final RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor, "token ID");
- final RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitInstanceImports(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitInstanceImports(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public final InstanceImportsContext instanceImports() throws RecognitionException {
+ InstanceImportsContext _localctx = new InstanceImportsContext(_ctx, getState());
+ enterRule(_localctx, 10, RULE_instanceImports);
+ int _la;
try {
- // Velvet.g:114:2: ( ID ( COMMA ID )* -> ^( BASEEXT ( ID )+ ) )
- // Velvet.g:114:4: ID ( COMMA ID )*
+ enterOuterAlt(_localctx, 1);
{
- ID24 = (Token) match(input, ID, FOLLOW_ID_in_conceptBaseExt632);
- stream_ID.add(ID24);
-
- // Velvet.g:114:7: ( COMMA ID )*
- loop8: do {
- int alt8 = 2;
- final int LA8_0 = input.LA(1);
-
- if ((LA8_0 == COMMA)) {
- alt8 = 1;
- }
-
- switch (alt8) {
- case 1:
- // Velvet.g:114:8: COMMA ID
- {
- COMMA25 = (Token) match(input, COMMA, FOLLOW_COMMA_in_conceptBaseExt635);
- stream_COMMA.add(COMMA25);
-
- ID26 = (Token) match(input, ID, FOLLOW_ID_in_conceptBaseExt637);
- stream_ID.add(ID26);
-
- }
- break;
-
- default:
- break loop8;
- }
- } while (true);
-
- // AST REWRITE
- // elements: ID
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 115:2: -> ^( BASEEXT ( ID )+ )
+ setState(114);
+ match(IMPORTINSTANCE);
+ setState(115);
+ match(ID);
+ setState(116);
+ name();
+ setState(122);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==COMMA) {
{
- // Velvet.g:115:5: ^( BASEEXT ( ID )+ )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(adaptor.create(BASEEXT, "BASEEXT"), root_1);
-
- if (!(stream_ID.hasNext())) {
- throw new RewriteEarlyExitException();
- }
- while (stream_ID.hasNext()) {
- adaptor.addChild(root_1, stream_ID.nextNode());
-
- }
- stream_ID.reset();
-
- adaptor.addChild(root_0, root_1);
- }
-
+ {
+ setState(117);
+ match(COMMA);
+ setState(118);
+ match(ID);
+ setState(119);
+ name();
}
-
- retval.tree = root_0;
-
+ }
+ setState(124);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "conceptBaseExt"
-
- public static class instanceImports_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class InterfaceImportsContext extends ParserRuleContext {
+ public TerminalNode IMPORTINTERFACE() { return getToken(VelvetParser.IMPORTINTERFACE, 0); }
+ public List ID() { return getTokens(VelvetParser.ID); }
+ public TerminalNode ID(int i) {
+ return getToken(VelvetParser.ID, i);
+ }
+ public List name() {
+ return getRuleContexts(NameContext.class);
+ }
+ public NameContext name(int i) {
+ return getRuleContext(NameContext.class,i);
+ }
+ public List COMMA() { return getTokens(VelvetParser.COMMA); }
+ public TerminalNode COMMA(int i) {
+ return getToken(VelvetParser.COMMA, i);
+ }
+ public InterfaceImportsContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_interfaceImports; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterInterfaceImports(this);
}
- };
-
- // $ANTLR start "instanceImports"
- // Velvet.g:118:1: instanceImports : IMPORTINSTANCE ID name ( COMMA ID name )* -> ^( IMPORTINSTANCE ( ID name )+ ) ;
- public final VelvetParser.instanceImports_return instanceImports() throws RecognitionException {
- final VelvetParser.instanceImports_return retval = new VelvetParser.instanceImports_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token IMPORTINSTANCE27 = null;
- Token ID28 = null;
- Token COMMA30 = null;
- Token ID31 = null;
- VelvetParser.name_return name29 = null;
-
- VelvetParser.name_return name32 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitInterfaceImports(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitInterfaceImports(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree IMPORTINSTANCE27_tree = null;
- final Tree ID28_tree = null;
- final Tree COMMA30_tree = null;
- final Tree ID31_tree = null;
- final RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor, "token ID");
- final RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
- final RewriteRuleTokenStream stream_IMPORTINSTANCE = new RewriteRuleTokenStream(adaptor, "token IMPORTINSTANCE");
- final RewriteRuleSubtreeStream stream_name = new RewriteRuleSubtreeStream(adaptor, "rule name");
+ public final InterfaceImportsContext interfaceImports() throws RecognitionException {
+ InterfaceImportsContext _localctx = new InterfaceImportsContext(_ctx, getState());
+ enterRule(_localctx, 12, RULE_interfaceImports);
+ int _la;
try {
- // Velvet.g:119:2: ( IMPORTINSTANCE ID name ( COMMA ID name )* -> ^( IMPORTINSTANCE ( ID name )+ ) )
- // Velvet.g:119:4: IMPORTINSTANCE ID name ( COMMA ID name )*
+ enterOuterAlt(_localctx, 1);
{
- IMPORTINSTANCE27 = (Token) match(input, IMPORTINSTANCE, FOLLOW_IMPORTINSTANCE_in_instanceImports662);
- stream_IMPORTINSTANCE.add(IMPORTINSTANCE27);
-
- ID28 = (Token) match(input, ID, FOLLOW_ID_in_instanceImports664);
- stream_ID.add(ID28);
-
- pushFollow(FOLLOW_name_in_instanceImports666);
- name29 = name();
-
- state._fsp--;
-
- stream_name.add(name29.getTree());
-
- // Velvet.g:119:27: ( COMMA ID name )*
- loop9: do {
- int alt9 = 2;
- final int LA9_0 = input.LA(1);
-
- if ((LA9_0 == COMMA)) {
- alt9 = 1;
- }
-
- switch (alt9) {
- case 1:
- // Velvet.g:119:28: COMMA ID name
- {
- COMMA30 = (Token) match(input, COMMA, FOLLOW_COMMA_in_instanceImports669);
- stream_COMMA.add(COMMA30);
-
- ID31 = (Token) match(input, ID, FOLLOW_ID_in_instanceImports671);
- stream_ID.add(ID31);
-
- pushFollow(FOLLOW_name_in_instanceImports673);
- name32 = name();
-
- state._fsp--;
-
- stream_name.add(name32.getTree());
-
- }
- break;
-
- default:
- break loop9;
- }
- } while (true);
-
- // AST REWRITE
- // elements: ID, name, IMPORTINSTANCE
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 120:2: -> ^( IMPORTINSTANCE ( ID name )+ )
+ setState(125);
+ match(IMPORTINTERFACE);
+ setState(126);
+ match(ID);
+ setState(127);
+ name();
+ setState(133);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==COMMA) {
{
- // Velvet.g:120:5: ^( IMPORTINSTANCE ( ID name )+ )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(stream_IMPORTINSTANCE.nextNode(), root_1);
-
- if (!(stream_ID.hasNext() || stream_name.hasNext())) {
- throw new RewriteEarlyExitException();
- }
- while (stream_ID.hasNext() || stream_name.hasNext()) {
- adaptor.addChild(root_1, stream_ID.nextNode());
-
- adaptor.addChild(root_1, stream_name.nextTree());
-
- }
- stream_ID.reset();
- stream_name.reset();
-
- adaptor.addChild(root_0, root_1);
- }
-
+ {
+ setState(128);
+ match(COMMA);
+ setState(129);
+ match(ID);
+ setState(130);
+ name();
}
-
- retval.tree = root_0;
-
+ }
+ setState(135);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "instanceImports"
-
- public static class interfaceImports_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class NameContext extends ParserRuleContext {
+ public TerminalNode ID() { return getToken(VelvetParser.ID, 0); }
+ public TerminalNode IDPath() { return getToken(VelvetParser.IDPath, 0); }
+ public NameContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_name; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterName(this);
}
- };
-
- // $ANTLR start "interfaceImports"
- // Velvet.g:123:1: interfaceImports : IMPORTINTERFACE ID name ( COMMA ID name )* -> ^( IMPORTINTERFACE ( ID name )+ ) ;
- public final VelvetParser.interfaceImports_return interfaceImports() throws RecognitionException {
- final VelvetParser.interfaceImports_return retval = new VelvetParser.interfaceImports_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token IMPORTINTERFACE33 = null;
- Token ID34 = null;
- Token COMMA36 = null;
- Token ID37 = null;
- VelvetParser.name_return name35 = null;
-
- VelvetParser.name_return name38 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitName(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitName(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree IMPORTINTERFACE33_tree = null;
- final Tree ID34_tree = null;
- final Tree COMMA36_tree = null;
- final Tree ID37_tree = null;
- final RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor, "token ID");
- final RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
- final RewriteRuleTokenStream stream_IMPORTINTERFACE = new RewriteRuleTokenStream(adaptor, "token IMPORTINTERFACE");
- final RewriteRuleSubtreeStream stream_name = new RewriteRuleSubtreeStream(adaptor, "rule name");
+ public final NameContext name() throws RecognitionException {
+ NameContext _localctx = new NameContext(_ctx, getState());
+ enterRule(_localctx, 14, RULE_name);
+ int _la;
try {
- // Velvet.g:124:2: ( IMPORTINTERFACE ID name ( COMMA ID name )* -> ^( IMPORTINTERFACE ( ID name )+ ) )
- // Velvet.g:124:4: IMPORTINTERFACE ID name ( COMMA ID name )*
+ enterOuterAlt(_localctx, 1);
{
- IMPORTINTERFACE33 = (Token) match(input, IMPORTINTERFACE, FOLLOW_IMPORTINTERFACE_in_interfaceImports702);
- stream_IMPORTINTERFACE.add(IMPORTINTERFACE33);
-
- ID34 = (Token) match(input, ID, FOLLOW_ID_in_interfaceImports704);
- stream_ID.add(ID34);
-
- pushFollow(FOLLOW_name_in_interfaceImports706);
- name35 = name();
-
- state._fsp--;
-
- stream_name.add(name35.getTree());
-
- // Velvet.g:124:28: ( COMMA ID name )*
- loop10: do {
- int alt10 = 2;
- final int LA10_0 = input.LA(1);
-
- if ((LA10_0 == COMMA)) {
- alt10 = 1;
- }
-
- switch (alt10) {
- case 1:
- // Velvet.g:124:29: COMMA ID name
- {
- COMMA36 = (Token) match(input, COMMA, FOLLOW_COMMA_in_interfaceImports709);
- stream_COMMA.add(COMMA36);
-
- ID37 = (Token) match(input, ID, FOLLOW_ID_in_interfaceImports711);
- stream_ID.add(ID37);
-
- pushFollow(FOLLOW_name_in_interfaceImports713);
- name38 = name();
-
- state._fsp--;
-
- stream_name.add(name38.getTree());
-
- }
- break;
-
- default:
- break loop10;
- }
- } while (true);
-
- // AST REWRITE
- // elements: IMPORTINTERFACE, name, ID
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 125:2: -> ^( IMPORTINTERFACE ( ID name )+ )
- {
- // Velvet.g:125:5: ^( IMPORTINTERFACE ( ID name )+ )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(stream_IMPORTINTERFACE.nextNode(), root_1);
-
- if (!(stream_name.hasNext() || stream_ID.hasNext())) {
- throw new RewriteEarlyExitException();
- }
- while (stream_name.hasNext() || stream_ID.hasNext()) {
- adaptor.addChild(root_1, stream_ID.nextNode());
-
- adaptor.addChild(root_1, stream_name.nextTree());
-
- }
- stream_name.reset();
- stream_ID.reset();
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- retval.tree = root_0;
-
+ setState(136);
+ _la = _input.LA(1);
+ if ( !(_la==ID || _la==IDPath) ) {
+ _errHandler.recoverInline(this);
+ }
+ else {
+ if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
+ _errHandler.reportMatch(this);
+ consume();
+ }
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "interfaceImports"
-
- public static class name_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class DefinitionsContext extends ParserRuleContext {
+ public TerminalNode START_C() { return getToken(VelvetParser.START_C, 0); }
+ public DefinitionContext definition() {
+ return getRuleContext(DefinitionContext.class,0);
+ }
+ public TerminalNode END_C() { return getToken(VelvetParser.END_C, 0); }
+ public DefinitionsContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_definitions; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterDefinitions(this);
}
- };
-
- // $ANTLR start "name"
- // Velvet.g:128:1: name : ( ID | IDPath );
- public final VelvetParser.name_return name() throws RecognitionException {
- final VelvetParser.name_return retval = new VelvetParser.name_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token set39 = null;
-
- final Tree set39_tree = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitDefinitions(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitDefinitions(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public final DefinitionsContext definitions() throws RecognitionException {
+ DefinitionsContext _localctx = new DefinitionsContext(_ctx, getState());
+ enterRule(_localctx, 16, RULE_definitions);
try {
- // Velvet.g:128:5: ( ID | IDPath )
- // Velvet.g:
+ enterOuterAlt(_localctx, 1);
{
- root_0 = (Tree) adaptor.nil();
-
- set39 = input.LT(1);
-
- if (((input.LA(1) >= ID) && (input.LA(1) <= IDPath))) {
- input.consume();
- adaptor.addChild(root_0, adaptor.create(set39));
- state.errorRecovery = false;
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- throw mse;
- }
-
+ setState(138);
+ match(START_C);
+ setState(139);
+ definition();
+ setState(140);
+ match(END_C);
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "name"
-
- public static class definitions_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class DefinitionContext extends ParserRuleContext {
+ public List nonFeatureDefinition() {
+ return getRuleContexts(NonFeatureDefinitionContext.class);
+ }
+ public NonFeatureDefinitionContext nonFeatureDefinition(int i) {
+ return getRuleContext(NonFeatureDefinitionContext.class,i);
+ }
+ public FeatureGroupContext featureGroup() {
+ return getRuleContext(FeatureGroupContext.class,0);
+ }
+ public List feature() {
+ return getRuleContexts(FeatureContext.class);
+ }
+ public FeatureContext feature(int i) {
+ return getRuleContext(FeatureContext.class,i);
+ }
+ public DefinitionContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_definition; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterDefinition(this);
}
- };
-
- // $ANTLR start "definitions"
- // Velvet.g:132:1: definitions : START_C definition END_C -> ^( DEF ( definition )? EMPTY ) ;
- public final VelvetParser.definitions_return definitions() throws RecognitionException {
- final VelvetParser.definitions_return retval = new VelvetParser.definitions_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token START_C40 = null;
- Token END_C42 = null;
- VelvetParser.definition_return definition41 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitDefinition(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitDefinition(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree START_C40_tree = null;
- final Tree END_C42_tree = null;
- final RewriteRuleTokenStream stream_END_C = new RewriteRuleTokenStream(adaptor, "token END_C");
- final RewriteRuleTokenStream stream_START_C = new RewriteRuleTokenStream(adaptor, "token START_C");
- final RewriteRuleSubtreeStream stream_definition = new RewriteRuleSubtreeStream(adaptor, "rule definition");
+ public final DefinitionContext definition() throws RecognitionException {
+ DefinitionContext _localctx = new DefinitionContext(_ctx, getState());
+ enterRule(_localctx, 18, RULE_definition);
+ int _la;
try {
- // Velvet.g:133:2: ( START_C definition END_C -> ^( DEF ( definition )? EMPTY ) )
- // Velvet.g:133:4: START_C definition END_C
+ enterOuterAlt(_localctx, 1);
{
- START_C40 = (Token) match(input, START_C, FOLLOW_START_C_in_definitions757);
- stream_START_C.add(START_C40);
-
- pushFollow(FOLLOW_definition_in_definitions759);
- definition41 = definition();
-
- state._fsp--;
-
- stream_definition.add(definition41.getTree());
-
- END_C42 = (Token) match(input, END_C, FOLLOW_END_C_in_definitions761);
- stream_END_C.add(END_C42);
-
- // AST REWRITE
- // elements: definition
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 134:2: -> ^( DEF ( definition )? EMPTY )
+ setState(145);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 255232L) != 0)) {
{
- // Velvet.g:134:5: ^( DEF ( definition )? EMPTY )
+ {
+ setState(142);
+ nonFeatureDefinition();
+ }
+ }
+ setState(147);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(163);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case SOMEOF:
+ case ONEOF:
+ {
+ {
+ setState(148);
+ featureGroup();
+ setState(152);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 255232L) != 0)) {
{
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(adaptor.create(DEF, "DEF"), root_1);
-
- // Velvet.g:134:11: ( definition )?
- if (stream_definition.hasNext()) {
- adaptor.addChild(root_1, stream_definition.nextTree());
-
+ {
+ setState(149);
+ nonFeatureDefinition();
+ }
+ }
+ setState(154);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ }
+ }
+ break;
+ case MANDATORY:
+ case ABSTRACT:
+ case FEATURE:
+ {
+ {
+ setState(155);
+ feature();
+ setState(160);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 255756L) != 0)) {
+ {
+ setState(158);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case MANDATORY:
+ case ABSTRACT:
+ case FEATURE:
+ {
+ setState(156);
+ feature();
}
- stream_definition.reset();
-
- adaptor.addChild(root_1, adaptor.create(EMPTY, "EMPTY"));
-
- adaptor.addChild(root_0, root_1);
+ break;
+ case CONSTRAINT:
+ case USE:
+ case DESCRIPTION:
+ case VAR_INT:
+ case VAR_FLOAT:
+ case VAR_STRING:
+ case VAR_BOOL:
+ {
+ setState(157);
+ nonFeatureDefinition();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
}
-
+ }
+ setState(162);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
}
-
- retval.tree = root_0;
-
- }
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
+ }
+ }
+ break;
+ case END_C:
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
}
-
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "definitions"
-
- public static class definition_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class NonFeatureDefinitionContext extends ParserRuleContext {
+ public ConstraintContext constraint() {
+ return getRuleContext(ConstraintContext.class,0);
+ }
+ public UseContext use() {
+ return getRuleContext(UseContext.class,0);
+ }
+ public AttributeContext attribute() {
+ return getRuleContext(AttributeContext.class,0);
+ }
+ public DescriptionContext description() {
+ return getRuleContext(DescriptionContext.class,0);
+ }
+ public NonFeatureDefinitionContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_nonFeatureDefinition; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterNonFeatureDefinition(this);
}
- };
-
- // $ANTLR start "definition"
- // Velvet.g:137:1: definition : ( nonFeatureDefinition )* ( ( featureGroup ( nonFeatureDefinition )* ) | ( feature ( feature | nonFeatureDefinition )* ) )?
- // ;
- public final VelvetParser.definition_return definition() throws RecognitionException {
- final VelvetParser.definition_return retval = new VelvetParser.definition_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- VelvetParser.nonFeatureDefinition_return nonFeatureDefinition43 = null;
-
- VelvetParser.featureGroup_return featureGroup44 = null;
-
- VelvetParser.nonFeatureDefinition_return nonFeatureDefinition45 = null;
-
- VelvetParser.feature_return feature46 = null;
-
- VelvetParser.feature_return feature47 = null;
-
- VelvetParser.nonFeatureDefinition_return nonFeatureDefinition48 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitNonFeatureDefinition(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitNonFeatureDefinition(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public final NonFeatureDefinitionContext nonFeatureDefinition() throws RecognitionException {
+ NonFeatureDefinitionContext _localctx = new NonFeatureDefinitionContext(_ctx, getState());
+ enterRule(_localctx, 20, RULE_nonFeatureDefinition);
try {
- // Velvet.g:138:2: ( ( nonFeatureDefinition )* ( ( featureGroup ( nonFeatureDefinition )* ) | ( feature ( feature | nonFeatureDefinition )* ) )? )
- // Velvet.g:138:4: ( nonFeatureDefinition )* ( ( featureGroup ( nonFeatureDefinition )* ) | ( feature ( feature | nonFeatureDefinition )* ) )?
- {
- root_0 = (Tree) adaptor.nil();
-
- // Velvet.g:138:4: ( nonFeatureDefinition )*
- loop11: do {
- int alt11 = 2;
- final int LA11_0 = input.LA(1);
-
- if (((LA11_0 == CONSTRAINT) || (LA11_0 == DESCRIPTION) || ((LA11_0 >= USE) && (LA11_0 <= VAR_STRING)))) {
- alt11 = 1;
- }
-
- switch (alt11) {
- case 1:
- // Velvet.g:138:4: nonFeatureDefinition
- {
- pushFollow(FOLLOW_nonFeatureDefinition_in_definition785);
- nonFeatureDefinition43 = nonFeatureDefinition();
-
- state._fsp--;
-
- adaptor.addChild(root_0, nonFeatureDefinition43.getTree());
-
- }
- break;
-
- default:
- break loop11;
- }
- } while (true);
-
- // Velvet.g:138:26: ( ( featureGroup ( nonFeatureDefinition )* ) | ( feature ( feature | nonFeatureDefinition )* ) )?
- int alt14 = 3;
- final int LA14_0 = input.LA(1);
-
- if (((LA14_0 == ONEOF) || (LA14_0 == SOMEOF))) {
- alt14 = 1;
- } else if (((LA14_0 == ABSTRACT) || (LA14_0 == FEATURE) || (LA14_0 == MANDATORY))) {
- alt14 = 2;
+ setState(169);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case CONSTRAINT:
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(165);
+ constraint();
}
- switch (alt14) {
- case 1:
- // Velvet.g:139:3: ( featureGroup ( nonFeatureDefinition )* )
+ break;
+ case USE:
+ enterOuterAlt(_localctx, 2);
{
- // Velvet.g:139:3: ( featureGroup ( nonFeatureDefinition )* )
- // Velvet.g:139:4: featureGroup ( nonFeatureDefinition )*
- {
- pushFollow(FOLLOW_featureGroup_in_definition793);
- featureGroup44 = featureGroup();
-
- state._fsp--;
-
- adaptor.addChild(root_0, featureGroup44.getTree());
-
- // Velvet.g:139:17: ( nonFeatureDefinition )*
- loop12: do {
- int alt12 = 2;
- final int LA12_0 = input.LA(1);
-
- if (((LA12_0 == CONSTRAINT) || (LA12_0 == DESCRIPTION) || ((LA12_0 >= USE) && (LA12_0 <= VAR_STRING)))) {
- alt12 = 1;
- }
-
- switch (alt12) {
- case 1:
- // Velvet.g:139:17: nonFeatureDefinition
- {
- pushFollow(FOLLOW_nonFeatureDefinition_in_definition795);
- nonFeatureDefinition45 = nonFeatureDefinition();
-
- state._fsp--;
-
- adaptor.addChild(root_0, nonFeatureDefinition45.getTree());
-
- }
- break;
-
- default:
- break loop12;
- }
- } while (true);
-
- }
-
+ setState(166);
+ use();
}
- break;
- case 2:
- // Velvet.g:139:42: ( feature ( feature | nonFeatureDefinition )* )
+ break;
+ case VAR_INT:
+ case VAR_FLOAT:
+ case VAR_STRING:
+ case VAR_BOOL:
+ enterOuterAlt(_localctx, 3);
{
- // Velvet.g:139:42: ( feature ( feature | nonFeatureDefinition )* )
- // Velvet.g:139:43: feature ( feature | nonFeatureDefinition )*
- {
- pushFollow(FOLLOW_feature_in_definition802);
- feature46 = feature();
-
- state._fsp--;
-
- adaptor.addChild(root_0, feature46.getTree());
-
- // Velvet.g:139:51: ( feature | nonFeatureDefinition )*
- loop13: do {
- int alt13 = 3;
- final int LA13_0 = input.LA(1);
-
- if (((LA13_0 == ABSTRACT) || (LA13_0 == FEATURE) || (LA13_0 == MANDATORY))) {
- alt13 = 1;
- } else if (((LA13_0 == CONSTRAINT) || (LA13_0 == DESCRIPTION) || ((LA13_0 >= USE) && (LA13_0 <= VAR_STRING)))) {
- alt13 = 2;
- }
-
- switch (alt13) {
- case 1:
- // Velvet.g:139:52: feature
- {
- pushFollow(FOLLOW_feature_in_definition805);
- feature47 = feature();
-
- state._fsp--;
-
- adaptor.addChild(root_0, feature47.getTree());
-
- }
- break;
- case 2:
- // Velvet.g:139:62: nonFeatureDefinition
- {
- pushFollow(FOLLOW_nonFeatureDefinition_in_definition809);
- nonFeatureDefinition48 = nonFeatureDefinition();
-
- state._fsp--;
-
- adaptor.addChild(root_0, nonFeatureDefinition48.getTree());
-
- }
- break;
-
- default:
- break loop13;
- }
- } while (true);
-
- }
-
+ setState(167);
+ attribute();
}
- break;
-
+ break;
+ case DESCRIPTION:
+ enterOuterAlt(_localctx, 4);
+ {
+ setState(168);
+ description();
}
-
+ break;
+ default:
+ throw new NoViableAltException(this);
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "definition"
-
- public static class nonFeatureDefinition_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class UseContext extends ParserRuleContext {
+ public TerminalNode USE() { return getToken(VelvetParser.USE, 0); }
+ public NameContext name() {
+ return getRuleContext(NameContext.class,0);
+ }
+ public TerminalNode SEMI() { return getToken(VelvetParser.SEMI, 0); }
+ public UseContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_use; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterUse(this);
}
- };
-
- // $ANTLR start "nonFeatureDefinition"
- // Velvet.g:143:1: nonFeatureDefinition : ( constraint | use | attribute | description );
- public final VelvetParser.nonFeatureDefinition_return nonFeatureDefinition() throws RecognitionException {
- final VelvetParser.nonFeatureDefinition_return retval = new VelvetParser.nonFeatureDefinition_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- VelvetParser.constraint_return constraint49 = null;
-
- VelvetParser.use_return use50 = null;
-
- VelvetParser.attribute_return attribute51 = null;
-
- VelvetParser.description_return description52 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitUse(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitUse(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public final UseContext use() throws RecognitionException {
+ UseContext _localctx = new UseContext(_ctx, getState());
+ enterRule(_localctx, 22, RULE_use);
try {
- // Velvet.g:144:2: ( constraint | use | attribute | description )
- int alt15 = 4;
- switch (input.LA(1)) {
- case CONSTRAINT: {
- alt15 = 1;
- }
- break;
- case USE: {
- alt15 = 2;
- }
- break;
- case VAR_BOOL:
- case VAR_FLOAT:
- case VAR_INT:
- case VAR_STRING: {
- alt15 = 3;
- }
- break;
- case DESCRIPTION: {
- alt15 = 4;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(171);
+ match(USE);
+ setState(172);
+ name();
+ setState(173);
+ match(SEMI);
}
- break;
- default:
- final NoViableAltException nvae = new NoViableAltException("", 15, 0, input);
-
- throw nvae;
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
- }
+ @SuppressWarnings("CheckReturnValue")
+ public static class FeatureContext extends ParserRuleContext {
+ public TerminalNode FEATURE() { return getToken(VelvetParser.FEATURE, 0); }
+ public NameContext name() {
+ return getRuleContext(NameContext.class,0);
+ }
+ public DefinitionsContext definitions() {
+ return getRuleContext(DefinitionsContext.class,0);
+ }
+ public TerminalNode SEMI() { return getToken(VelvetParser.SEMI, 0); }
+ public TerminalNode MANDATORY() { return getToken(VelvetParser.MANDATORY, 0); }
+ public TerminalNode ABSTRACT() { return getToken(VelvetParser.ABSTRACT, 0); }
+ public FeatureContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_feature; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterFeature(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitFeature(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitFeature(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- switch (alt15) {
- case 1:
- // Velvet.g:144:4: constraint
+ public final FeatureContext feature() throws RecognitionException {
+ FeatureContext _localctx = new FeatureContext(_ctx, getState());
+ enterRule(_localctx, 24, RULE_feature);
+ try {
+ enterOuterAlt(_localctx, 1);
{
- root_0 = (Tree) adaptor.nil();
-
- pushFollow(FOLLOW_constraint_in_nonFeatureDefinition831);
- constraint49 = constraint();
-
- state._fsp--;
-
- adaptor.addChild(root_0, constraint49.getTree());
-
- }
+ setState(181);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) {
+ case 1:
+ {
+ setState(175);
+ match(MANDATORY);
+ setState(176);
+ match(ABSTRACT);
+ }
break;
case 2:
- // Velvet.g:145:4: use
- {
- root_0 = (Tree) adaptor.nil();
-
- pushFollow(FOLLOW_use_in_nonFeatureDefinition836);
- use50 = use();
-
- state._fsp--;
-
- adaptor.addChild(root_0, use50.getTree());
-
- }
+ {
+ setState(177);
+ match(ABSTRACT);
+ setState(178);
+ match(MANDATORY);
+ }
break;
case 3:
- // Velvet.g:146:4: attribute
- {
- root_0 = (Tree) adaptor.nil();
-
- pushFollow(FOLLOW_attribute_in_nonFeatureDefinition841);
- attribute51 = attribute();
-
- state._fsp--;
-
- adaptor.addChild(root_0, attribute51.getTree());
-
- }
+ {
+ setState(179);
+ match(MANDATORY);
+ }
break;
case 4:
- // Velvet.g:147:4: description
- {
- root_0 = (Tree) adaptor.nil();
-
- pushFollow(FOLLOW_description_in_nonFeatureDefinition847);
- description52 = description();
-
- state._fsp--;
-
- adaptor.addChild(root_0, description52.getTree());
-
+ {
+ setState(180);
+ match(ABSTRACT);
+ }
+ break;
}
+ setState(183);
+ match(FEATURE);
+ setState(184);
+ name();
+ setState(187);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case START_C:
+ {
+ setState(185);
+ definitions();
+ }
break;
-
+ case SEMI:
+ {
+ setState(186);
+ match(SEMI);
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
}
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "nonFeatureDefinition"
-
- public static class use_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class FeatureGroupContext extends ParserRuleContext {
+ public GroupTypeContext groupType() {
+ return getRuleContext(GroupTypeContext.class,0);
+ }
+ public TerminalNode START_C() { return getToken(VelvetParser.START_C, 0); }
+ public TerminalNode END_C() { return getToken(VelvetParser.END_C, 0); }
+ public List feature() {
+ return getRuleContexts(FeatureContext.class);
+ }
+ public FeatureContext feature(int i) {
+ return getRuleContext(FeatureContext.class,i);
+ }
+ public FeatureGroupContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_featureGroup; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterFeatureGroup(this);
}
- };
-
- // $ANTLR start "use"
- // Velvet.g:150:1: use : USE name SEMI -> ^( USE name ) ;
- public final VelvetParser.use_return use() throws RecognitionException {
- final VelvetParser.use_return retval = new VelvetParser.use_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token USE53 = null;
- Token SEMI55 = null;
- VelvetParser.name_return name54 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitFeatureGroup(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitFeatureGroup(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree USE53_tree = null;
- final Tree SEMI55_tree = null;
- final RewriteRuleTokenStream stream_USE = new RewriteRuleTokenStream(adaptor, "token USE");
- final RewriteRuleTokenStream stream_SEMI = new RewriteRuleTokenStream(adaptor, "token SEMI");
- final RewriteRuleSubtreeStream stream_name = new RewriteRuleSubtreeStream(adaptor, "rule name");
+ public final FeatureGroupContext featureGroup() throws RecognitionException {
+ FeatureGroupContext _localctx = new FeatureGroupContext(_ctx, getState());
+ enterRule(_localctx, 26, RULE_featureGroup);
+ int _la;
try {
- // Velvet.g:150:5: ( USE name SEMI -> ^( USE name ) )
- // Velvet.g:150:7: USE name SEMI
+ enterOuterAlt(_localctx, 1);
{
- USE53 = (Token) match(input, USE, FOLLOW_USE_in_use858);
- stream_USE.add(USE53);
-
- pushFollow(FOLLOW_name_in_use860);
- name54 = name();
-
- state._fsp--;
-
- stream_name.add(name54.getTree());
-
- SEMI55 = (Token) match(input, SEMI, FOLLOW_SEMI_in_use862);
- stream_SEMI.add(SEMI55);
-
- // AST REWRITE
- // elements: name, USE
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 151:2: -> ^( USE name )
+ setState(189);
+ groupType();
+ setState(190);
+ match(START_C);
+ setState(192);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
{
- // Velvet.g:151:5: ^( USE name )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(stream_USE.nextNode(), root_1);
-
- adaptor.addChild(root_1, stream_name.nextTree());
-
- adaptor.addChild(root_0, root_1);
- }
-
+ {
+ setState(191);
+ feature();
}
-
- retval.tree = root_0;
-
+ }
+ setState(194);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 524L) != 0) );
+ setState(196);
+ match(END_C);
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "use"
-
- public static class feature_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class GroupTypeContext extends ParserRuleContext {
+ public TerminalNode SOMEOF() { return getToken(VelvetParser.SOMEOF, 0); }
+ public TerminalNode ONEOF() { return getToken(VelvetParser.ONEOF, 0); }
+ public GroupTypeContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_groupType; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterGroupType(this);
}
- };
-
- // $ANTLR start "feature"
- // Velvet.g:154:1: feature : ( MANDATORY ABSTRACT | ABSTRACT MANDATORY | MANDATORY | ABSTRACT )? FEATURE name ( definitions | SEMI ) -> ^( FEATURE name (
- // MANDATORY )? ( ABSTRACT )? ( definitions )? ) ;
- public final VelvetParser.feature_return feature() throws RecognitionException {
- final VelvetParser.feature_return retval = new VelvetParser.feature_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitGroupType(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitGroupType(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- Token MANDATORY56 = null;
- Token ABSTRACT57 = null;
- Token ABSTRACT58 = null;
- Token MANDATORY59 = null;
- Token MANDATORY60 = null;
- Token ABSTRACT61 = null;
- Token FEATURE62 = null;
- Token SEMI65 = null;
- VelvetParser.name_return name63 = null;
+ public final GroupTypeContext groupType() throws RecognitionException {
+ GroupTypeContext _localctx = new GroupTypeContext(_ctx, getState());
+ enterRule(_localctx, 28, RULE_groupType);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(198);
+ _la = _input.LA(1);
+ if ( !(_la==SOMEOF || _la==ONEOF) ) {
+ _errHandler.recoverInline(this);
+ }
+ else {
+ if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
+ _errHandler.reportMatch(this);
+ consume();
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
- VelvetParser.definitions_return definitions64 = null;
+ @SuppressWarnings("CheckReturnValue")
+ public static class DescriptionContext extends ParserRuleContext {
+ public TerminalNode DESCRIPTION() { return getToken(VelvetParser.DESCRIPTION, 0); }
+ public TerminalNode STRING() { return getToken(VelvetParser.STRING, 0); }
+ public TerminalNode SEMI() { return getToken(VelvetParser.SEMI, 0); }
+ public DescriptionContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_description; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterDescription(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitDescription(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitDescription(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree MANDATORY56_tree = null;
- final Tree ABSTRACT57_tree = null;
- final Tree ABSTRACT58_tree = null;
- final Tree MANDATORY59_tree = null;
- final Tree MANDATORY60_tree = null;
- final Tree ABSTRACT61_tree = null;
- final Tree FEATURE62_tree = null;
- final Tree SEMI65_tree = null;
- final RewriteRuleTokenStream stream_ABSTRACT = new RewriteRuleTokenStream(adaptor, "token ABSTRACT");
- final RewriteRuleTokenStream stream_MANDATORY = new RewriteRuleTokenStream(adaptor, "token MANDATORY");
- final RewriteRuleTokenStream stream_SEMI = new RewriteRuleTokenStream(adaptor, "token SEMI");
- final RewriteRuleTokenStream stream_FEATURE = new RewriteRuleTokenStream(adaptor, "token FEATURE");
- final RewriteRuleSubtreeStream stream_name = new RewriteRuleSubtreeStream(adaptor, "rule name");
- final RewriteRuleSubtreeStream stream_definitions = new RewriteRuleSubtreeStream(adaptor, "rule definitions");
+ public final DescriptionContext description() throws RecognitionException {
+ DescriptionContext _localctx = new DescriptionContext(_ctx, getState());
+ enterRule(_localctx, 30, RULE_description);
try {
- // Velvet.g:155:2: ( ( MANDATORY ABSTRACT | ABSTRACT MANDATORY | MANDATORY | ABSTRACT )? FEATURE name ( definitions | SEMI ) -> ^( FEATURE name (
- // MANDATORY )? ( ABSTRACT )? ( definitions )? ) )
- // Velvet.g:155:4: ( MANDATORY ABSTRACT | ABSTRACT MANDATORY | MANDATORY | ABSTRACT )? FEATURE name ( definitions | SEMI )
+ enterOuterAlt(_localctx, 1);
{
- // Velvet.g:155:4: ( MANDATORY ABSTRACT | ABSTRACT MANDATORY | MANDATORY | ABSTRACT )?
- int alt16 = 5;
- final int LA16_0 = input.LA(1);
+ setState(200);
+ match(DESCRIPTION);
+ setState(201);
+ match(STRING);
+ setState(202);
+ match(SEMI);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
- if ((LA16_0 == MANDATORY)) {
- final int LA16_1 = input.LA(2);
-
- if ((LA16_1 == ABSTRACT)) {
- alt16 = 1;
- } else if ((LA16_1 == FEATURE)) {
- alt16 = 3;
- }
- } else if ((LA16_0 == ABSTRACT)) {
- final int LA16_2 = input.LA(2);
+ @SuppressWarnings("CheckReturnValue")
+ public static class ConstraintContext extends ParserRuleContext {
+ public TerminalNode CONSTRAINT() { return getToken(VelvetParser.CONSTRAINT, 0); }
+ public TerminalNode SEMI() { return getToken(VelvetParser.SEMI, 0); }
+ public TerminalNode ID() { return getToken(VelvetParser.ID, 0); }
+ public TerminalNode EQ() { return getToken(VelvetParser.EQ, 0); }
+ public ConstraintDefinitionContext constraintDefinition() {
+ return getRuleContext(ConstraintDefinitionContext.class,0);
+ }
+ public AttributeConstraintContext attributeConstraint() {
+ return getRuleContext(AttributeConstraintContext.class,0);
+ }
+ public ConstraintContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_constraint; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterConstraint(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitConstraint(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitConstraint(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- if ((LA16_2 == MANDATORY)) {
- alt16 = 2;
- } else if ((LA16_2 == FEATURE)) {
- alt16 = 4;
- }
- }
- switch (alt16) {
- case 1:
- // Velvet.g:155:5: MANDATORY ABSTRACT
+ public final ConstraintContext constraint() throws RecognitionException {
+ ConstraintContext _localctx = new ConstraintContext(_ctx, getState());
+ enterRule(_localctx, 32, RULE_constraint);
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(204);
+ match(CONSTRAINT);
+ {
+ setState(205);
+ match(ID);
+ setState(206);
+ match(EQ);
+ }
+ setState(210);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) {
+ case 1:
{
- MANDATORY56 = (Token) match(input, MANDATORY, FOLLOW_MANDATORY_in_feature883);
- stream_MANDATORY.add(MANDATORY56);
-
- ABSTRACT57 = (Token) match(input, ABSTRACT, FOLLOW_ABSTRACT_in_feature885);
- stream_ABSTRACT.add(ABSTRACT57);
-
+ setState(208);
+ constraintDefinition();
}
- break;
- case 2:
- // Velvet.g:155:26: ABSTRACT MANDATORY
+ break;
+ case 2:
{
- ABSTRACT58 = (Token) match(input, ABSTRACT, FOLLOW_ABSTRACT_in_feature889);
- stream_ABSTRACT.add(ABSTRACT58);
+ setState(209);
+ attributeConstraint();
+ }
+ break;
+ }
+ setState(212);
+ match(SEMI);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
- MANDATORY59 = (Token) match(input, MANDATORY, FOLLOW_MANDATORY_in_feature891);
- stream_MANDATORY.add(MANDATORY59);
+ @SuppressWarnings("CheckReturnValue")
+ public static class ConstraintDefinitionContext extends ParserRuleContext {
+ public List constraintOperand() {
+ return getRuleContexts(ConstraintOperandContext.class);
+ }
+ public ConstraintOperandContext constraintOperand(int i) {
+ return getRuleContext(ConstraintOperandContext.class,i);
+ }
+ public List binaryOp() {
+ return getRuleContexts(BinaryOpContext.class);
+ }
+ public BinaryOpContext binaryOp(int i) {
+ return getRuleContext(BinaryOpContext.class,i);
+ }
+ public ConstraintDefinitionContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_constraintDefinition; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterConstraintDefinition(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitConstraintDefinition(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitConstraintDefinition(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- }
- break;
- case 3:
- // Velvet.g:155:47: MANDATORY
+ public final ConstraintDefinitionContext constraintDefinition() throws RecognitionException {
+ ConstraintDefinitionContext _localctx = new ConstraintDefinitionContext(_ctx, getState());
+ enterRule(_localctx, 34, RULE_constraintDefinition);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(214);
+ constraintOperand();
+ setState(220);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 16642998272L) != 0)) {
{
- MANDATORY60 = (Token) match(input, MANDATORY, FOLLOW_MANDATORY_in_feature895);
- stream_MANDATORY.add(MANDATORY60);
-
- }
- break;
- case 4:
- // Velvet.g:155:59: ABSTRACT
{
- ABSTRACT61 = (Token) match(input, ABSTRACT, FOLLOW_ABSTRACT_in_feature899);
- stream_ABSTRACT.add(ABSTRACT61);
-
+ setState(215);
+ binaryOp();
+ setState(216);
+ constraintOperand();
}
- break;
-
}
+ setState(222);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
- FEATURE62 = (Token) match(input, FEATURE, FOLLOW_FEATURE_in_feature906);
- stream_FEATURE.add(FEATURE62);
-
- pushFollow(FOLLOW_name_in_feature908);
- name63 = name();
-
- state._fsp--;
-
- stream_name.add(name63.getTree());
-
- // Velvet.g:156:17: ( definitions | SEMI )
- int alt17 = 2;
- final int LA17_0 = input.LA(1);
-
- if ((LA17_0 == START_C)) {
- alt17 = 1;
- } else if ((LA17_0 == SEMI)) {
- alt17 = 2;
- } else {
- final NoViableAltException nvae = new NoViableAltException("", 17, 0, input);
-
- throw nvae;
+ @SuppressWarnings("CheckReturnValue")
+ public static class ConstraintOperandContext extends ParserRuleContext {
+ public TerminalNode START_R() { return getToken(VelvetParser.START_R, 0); }
+ public ConstraintDefinitionContext constraintDefinition() {
+ return getRuleContext(ConstraintDefinitionContext.class,0);
+ }
+ public TerminalNode END_R() { return getToken(VelvetParser.END_R, 0); }
+ public NameContext name() {
+ return getRuleContext(NameContext.class,0);
+ }
+ public List unaryOp() {
+ return getRuleContexts(UnaryOpContext.class);
+ }
+ public UnaryOpContext unaryOp(int i) {
+ return getRuleContext(UnaryOpContext.class,i);
+ }
+ public ConstraintOperandContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_constraintOperand; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterConstraintOperand(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitConstraintOperand(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitConstraintOperand(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- }
- switch (alt17) {
- case 1:
- // Velvet.g:156:18: definitions
+ public final ConstraintOperandContext constraintOperand() throws RecognitionException {
+ ConstraintOperandContext _localctx = new ConstraintOperandContext(_ctx, getState());
+ enterRule(_localctx, 36, RULE_constraintOperand);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(226);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==OP_NOT) {
{
- pushFollow(FOLLOW_definitions_in_feature911);
- definitions64 = definitions();
-
- state._fsp--;
-
- stream_definitions.add(definitions64.getTree());
-
- }
- break;
- case 2:
- // Velvet.g:156:32: SEMI
{
- SEMI65 = (Token) match(input, SEMI, FOLLOW_SEMI_in_feature915);
- stream_SEMI.add(SEMI65);
-
+ setState(223);
+ unaryOp();
}
- break;
-
}
-
- // AST REWRITE
- // elements: definitions, MANDATORY, ABSTRACT, FEATURE, name
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 157:2: -> ^( FEATURE name ( MANDATORY )? ( ABSTRACT )? ( definitions )? )
+ setState(228);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(234);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case START_R:
{
- // Velvet.g:157:5: ^( FEATURE name ( MANDATORY )? ( ABSTRACT )? ( definitions )? )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(stream_FEATURE.nextNode(), root_1);
-
- adaptor.addChild(root_1, stream_name.nextTree());
-
- // Velvet.g:157:20: ( MANDATORY )?
- if (stream_MANDATORY.hasNext()) {
- adaptor.addChild(root_1, stream_MANDATORY.nextNode());
-
- }
- stream_MANDATORY.reset();
-
- // Velvet.g:157:31: ( ABSTRACT )?
- if (stream_ABSTRACT.hasNext()) {
- adaptor.addChild(root_1, stream_ABSTRACT.nextNode());
-
- }
- stream_ABSTRACT.reset();
-
- // Velvet.g:157:41: ( definitions )?
- if (stream_definitions.hasNext()) {
- adaptor.addChild(root_1, stream_definitions.nextTree());
-
- }
- stream_definitions.reset();
-
- adaptor.addChild(root_0, root_1);
- }
-
+ setState(229);
+ match(START_R);
+ setState(230);
+ constraintDefinition();
+ setState(231);
+ match(END_R);
}
-
- retval.tree = root_0;
-
+ break;
+ case ID:
+ case IDPath:
+ {
+ setState(233);
+ name();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "feature"
-
- public static class featureGroup_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class AttributeContext extends ParserRuleContext {
+ public TerminalNode SEMI() { return getToken(VelvetParser.SEMI, 0); }
+ public IntAttributeContext intAttribute() {
+ return getRuleContext(IntAttributeContext.class,0);
+ }
+ public FloatAttributeContext floatAttribute() {
+ return getRuleContext(FloatAttributeContext.class,0);
+ }
+ public StringAttributeContext stringAttribute() {
+ return getRuleContext(StringAttributeContext.class,0);
+ }
+ public BoolAttributeContext boolAttribute() {
+ return getRuleContext(BoolAttributeContext.class,0);
+ }
+ public AttributeContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_attribute; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterAttribute(this);
}
- };
-
- // $ANTLR start "featureGroup"
- // Velvet.g:160:1: featureGroup : groupType START_C ( feature )+ END_C -> ^( GROUP groupType ( feature )+ ) ;
- public final VelvetParser.featureGroup_return featureGroup() throws RecognitionException {
- final VelvetParser.featureGroup_return retval = new VelvetParser.featureGroup_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token START_C67 = null;
- Token END_C69 = null;
- VelvetParser.groupType_return groupType66 = null;
-
- VelvetParser.feature_return feature68 = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitAttribute(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitAttribute(this);
+ else return visitor.visitChildren(this);
+ }
+ }
- final Tree START_C67_tree = null;
- final Tree END_C69_tree = null;
- final RewriteRuleTokenStream stream_END_C = new RewriteRuleTokenStream(adaptor, "token END_C");
- final RewriteRuleTokenStream stream_START_C = new RewriteRuleTokenStream(adaptor, "token START_C");
- final RewriteRuleSubtreeStream stream_groupType = new RewriteRuleSubtreeStream(adaptor, "rule groupType");
- final RewriteRuleSubtreeStream stream_feature = new RewriteRuleSubtreeStream(adaptor, "rule feature");
+ public final AttributeContext attribute() throws RecognitionException {
+ AttributeContext _localctx = new AttributeContext(_ctx, getState());
+ enterRule(_localctx, 38, RULE_attribute);
try {
- // Velvet.g:161:2: ( groupType START_C ( feature )+ END_C -> ^( GROUP groupType ( feature )+ ) )
- // Velvet.g:161:4: groupType START_C ( feature )+ END_C
+ enterOuterAlt(_localctx, 1);
{
- pushFollow(FOLLOW_groupType_in_featureGroup946);
- groupType66 = groupType();
-
- state._fsp--;
-
- stream_groupType.add(groupType66.getTree());
-
- START_C67 = (Token) match(input, START_C, FOLLOW_START_C_in_featureGroup948);
- stream_START_C.add(START_C67);
-
- // Velvet.g:161:22: ( feature )+
- int cnt18 = 0;
- loop18: do {
- int alt18 = 2;
- final int LA18_0 = input.LA(1);
-
- if (((LA18_0 == ABSTRACT) || (LA18_0 == FEATURE) || (LA18_0 == MANDATORY))) {
- alt18 = 1;
- }
-
- switch (alt18) {
- case 1:
- // Velvet.g:161:22: feature
- {
- pushFollow(FOLLOW_feature_in_featureGroup950);
- feature68 = feature();
-
- state._fsp--;
-
- stream_feature.add(feature68.getTree());
-
- }
- break;
-
- default:
- if (cnt18 >= 1) {
- break loop18;
- }
- final EarlyExitException eee = new EarlyExitException(18, input);
- throw eee;
- }
- cnt18++;
- } while (true);
-
- END_C69 = (Token) match(input, END_C, FOLLOW_END_C_in_featureGroup953);
- stream_END_C.add(END_C69);
-
- // AST REWRITE
- // elements: feature, groupType
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- // wildcard labels:
- retval.tree = root_0;
- final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
-
- root_0 = (Tree) adaptor.nil();
- // 162:2: -> ^( GROUP groupType ( feature )+ )
+ setState(240);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case VAR_INT:
{
- // Velvet.g:162:5: ^( GROUP groupType ( feature )+ )
- {
- Tree root_1 = (Tree) adaptor.nil();
- root_1 = (Tree) adaptor.becomeRoot(adaptor.create(GROUP, "GROUP"), root_1);
-
- adaptor.addChild(root_1, stream_groupType.nextTree());
-
- if (!(stream_feature.hasNext())) {
- throw new RewriteEarlyExitException();
- }
- while (stream_feature.hasNext()) {
- adaptor.addChild(root_1, stream_feature.nextTree());
-
- }
- stream_feature.reset();
-
- adaptor.addChild(root_0, root_1);
- }
-
+ setState(236);
+ intAttribute();
}
-
- retval.tree = root_0;
-
+ break;
+ case VAR_FLOAT:
+ {
+ setState(237);
+ floatAttribute();
+ }
+ break;
+ case VAR_STRING:
+ {
+ setState(238);
+ stringAttribute();
+ }
+ break;
+ case VAR_BOOL:
+ {
+ setState(239);
+ boolAttribute();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(242);
+ match(SEMI);
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "featureGroup"
-
- public static class groupType_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class AttributeConstraintContext extends ParserRuleContext {
+ public List attribNumExpr() {
+ return getRuleContexts(AttribNumExprContext.class);
+ }
+ public AttribNumExprContext attribNumExpr(int i) {
+ return getRuleContext(AttribNumExprContext.class,i);
+ }
+ public AttribRelationContext attribRelation() {
+ return getRuleContext(AttribRelationContext.class,0);
+ }
+ public AttributeConstraintContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_attributeConstraint; }
@Override
- public Object getTree() {
- return tree;
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).enterAttributeConstraint(this);
}
- };
-
- // $ANTLR start "groupType"
- // Velvet.g:165:1: groupType : ( SOMEOF | ONEOF );
- public final VelvetParser.groupType_return groupType() throws RecognitionException {
- final VelvetParser.groupType_return retval = new VelvetParser.groupType_return();
- retval.start = input.LT(1);
-
- Tree root_0 = null;
-
- Token set70 = null;
-
- final Tree set70_tree = null;
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof VelvetListener ) ((VelvetListener)listener).exitAttributeConstraint(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof VelvetVisitor ) return ((VelvetVisitor extends T>)visitor).visitAttributeConstraint(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public final AttributeConstraintContext attributeConstraint() throws RecognitionException {
+ AttributeConstraintContext _localctx = new AttributeConstraintContext(_ctx, getState());
+ enterRule(_localctx, 40, RULE_attributeConstraint);
try {
- // Velvet.g:166:2: ( SOMEOF | ONEOF )
- // Velvet.g:
+ enterOuterAlt(_localctx, 1);
{
- root_0 = (Tree) adaptor.nil();
-
- set70 = input.LT(1);
-
- if ((input.LA(1) == ONEOF) || (input.LA(1) == SOMEOF)) {
- input.consume();
- adaptor.addChild(root_0, adaptor.create(set70));
- state.errorRecovery = false;
- } else {
- final MismatchedSetException mse = new MismatchedSetException(null, input);
- throw mse;
- }
-
+ setState(244);
+ attribNumExpr();
+ setState(245);
+ attribRelation();
+ setState(246);
+ attribNumExpr();
}
-
- retval.stop = input.LT(-1);
-
- retval.tree = (Tree) adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
- } catch (final RecognitionException re) {
- reportError(re);
- recover(input, re);
- retval.tree = (Tree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
-
}
-
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
finally {
- // do for sure before leaving
+ exitRule();
}
- return retval;
+ return _localctx;
}
- // $ANTLR end "groupType"
-
- public static class description_return extends ParserRuleReturnScope {
-
- Tree tree;
+ @SuppressWarnings("CheckReturnValue")
+ public static class AttribNumExprContext extends ParserRuleContext {
+ public List attribNumInstance() {
+ return getRuleContexts(AttribNumInstanceContext.class);
+ }
+ public AttribNumInstanceContext attribNumInstance(int i) {
+ return getRuleContext(AttribNumInstanceContext.class,i);
+ }
+ public List