added disambiguating semantic predicates to model and grammar

This commit is contained in:
overflowerror 2021-11-23 18:23:32 +01:00
parent ad5a6b33f5
commit 6378a70180
21 changed files with 6407 additions and 5371 deletions

View file

@ -37,6 +37,7 @@ public class XtextParser extends AbstractContentAssistParser {
builder.put(grammarAccess.getParserRuleAccess().getAlternatives_1_0_2(), "rule__ParserRule__Alternatives_1_0_2");
builder.put(grammarAccess.getConditionalBranchAccess().getAlternatives(), "rule__ConditionalBranch__Alternatives");
builder.put(grammarAccess.getAbstractTokenAccess().getAlternatives(), "rule__AbstractToken__Alternatives");
builder.put(grammarAccess.getSemanticPredicateAccess().getAlternatives(), "rule__SemanticPredicate__Alternatives");
builder.put(grammarAccess.getAbstractTokenWithCardinalityAccess().getAlternatives_0(), "rule__AbstractTokenWithCardinality__Alternatives_0");
builder.put(grammarAccess.getAbstractTokenWithCardinalityAccess().getCardinalityAlternatives_1_0(), "rule__AbstractTokenWithCardinality__CardinalityAlternatives_1_0");
builder.put(grammarAccess.getActionAccess().getOperatorAlternatives_2_2_0(), "rule__Action__OperatorAlternatives_2_2_0");
@ -94,6 +95,7 @@ public class XtextParser extends AbstractContentAssistParser {
builder.put(grammarAccess.getGroupAccess().getGroup(), "rule__Group__Group__0");
builder.put(grammarAccess.getGroupAccess().getGroup_1(), "rule__Group__Group_1__0");
builder.put(grammarAccess.getGatedSemanticPredicateAccess().getGroup(), "rule__GatedSemanticPredicate__Group__0");
builder.put(grammarAccess.getDisambiguatingSemanticPredicateAccess().getGroup(), "rule__DisambiguatingSemanticPredicate__Group__0");
builder.put(grammarAccess.getAbstractTokenWithCardinalityAccess().getGroup(), "rule__AbstractTokenWithCardinality__Group__0");
builder.put(grammarAccess.getActionAccess().getGroup(), "rule__Action__Group__0");
builder.put(grammarAccess.getActionAccess().getGroup_2(), "rule__Action__Group_2__0");
@ -185,6 +187,7 @@ public class XtextParser extends AbstractContentAssistParser {
builder.put(grammarAccess.getUnorderedGroupAccess().getElementsAssignment_1_1_1(), "rule__UnorderedGroup__ElementsAssignment_1_1_1");
builder.put(grammarAccess.getGroupAccess().getElementsAssignment_1_1(), "rule__Group__ElementsAssignment_1_1");
builder.put(grammarAccess.getGatedSemanticPredicateAccess().getCodeAssignment_0(), "rule__GatedSemanticPredicate__CodeAssignment_0");
builder.put(grammarAccess.getDisambiguatingSemanticPredicateAccess().getCodeAssignment_0(), "rule__DisambiguatingSemanticPredicate__CodeAssignment_0");
builder.put(grammarAccess.getJavaActionAccess().getCodeAssignment(), "rule__JavaAction__CodeAssignment");
builder.put(grammarAccess.getJavaCodeAccess().getSourceAssignment(), "rule__JavaCode__SourceAssignment");
builder.put(grammarAccess.getAbstractTokenWithCardinalityAccess().getCardinalityAssignment_1(), "rule__AbstractTokenWithCardinality__CardinalityAssignment_1");

View file

@ -482,9 +482,9 @@ ruleSemanticPredicate
}
:
(
{ before(grammarAccess.getSemanticPredicateAccess().getGatedSemanticPredicateParserRuleCall()); }
ruleGatedSemanticPredicate
{ after(grammarAccess.getSemanticPredicateAccess().getGatedSemanticPredicateParserRuleCall()); }
{ before(grammarAccess.getSemanticPredicateAccess().getAlternatives()); }
(rule__SemanticPredicate__Alternatives)
{ after(grammarAccess.getSemanticPredicateAccess().getAlternatives()); }
)
;
finally {
@ -516,6 +516,31 @@ finally {
restoreStackSize(stackSize);
}
// Entry rule entryRuleDisambiguatingSemanticPredicate
entryRuleDisambiguatingSemanticPredicate
:
{ before(grammarAccess.getDisambiguatingSemanticPredicateRule()); }
ruleDisambiguatingSemanticPredicate
{ after(grammarAccess.getDisambiguatingSemanticPredicateRule()); }
EOF
;
// Rule DisambiguatingSemanticPredicate
ruleDisambiguatingSemanticPredicate
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getDisambiguatingSemanticPredicateAccess().getGroup()); }
(rule__DisambiguatingSemanticPredicate__Group__0)
{ after(grammarAccess.getDisambiguatingSemanticPredicateAccess().getGroup()); }
)
;
finally {
restoreStackSize(stackSize);
}
// Entry rule entryRuleJavaAction
entryRuleJavaAction
:
@ -1735,6 +1760,27 @@ finally {
restoreStackSize(stackSize);
}
rule__SemanticPredicate__Alternatives
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getSemanticPredicateAccess().getDisambiguatingSemanticPredicateParserRuleCall_0()); }
ruleDisambiguatingSemanticPredicate
{ after(grammarAccess.getSemanticPredicateAccess().getDisambiguatingSemanticPredicateParserRuleCall_0()); }
)
|
(
{ before(grammarAccess.getSemanticPredicateAccess().getGatedSemanticPredicateParserRuleCall_1()); }
ruleGatedSemanticPredicate
{ after(grammarAccess.getSemanticPredicateAccess().getGatedSemanticPredicateParserRuleCall_1()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__AbstractTokenWithCardinality__Alternatives_0
@init {
int stackSize = keepStackSize();
@ -4905,6 +4951,60 @@ finally {
}
rule__DisambiguatingSemanticPredicate__Group__0
@init {
int stackSize = keepStackSize();
}
:
rule__DisambiguatingSemanticPredicate__Group__0__Impl
rule__DisambiguatingSemanticPredicate__Group__1
;
finally {
restoreStackSize(stackSize);
}
rule__DisambiguatingSemanticPredicate__Group__0__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getDisambiguatingSemanticPredicateAccess().getCodeAssignment_0()); }
(rule__DisambiguatingSemanticPredicate__CodeAssignment_0)
{ after(grammarAccess.getDisambiguatingSemanticPredicateAccess().getCodeAssignment_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__DisambiguatingSemanticPredicate__Group__1
@init {
int stackSize = keepStackSize();
}
:
rule__DisambiguatingSemanticPredicate__Group__1__Impl
;
finally {
restoreStackSize(stackSize);
}
rule__DisambiguatingSemanticPredicate__Group__1__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getDisambiguatingSemanticPredicateAccess().getQuestionMarkKeyword_1()); }
'?'
{ after(grammarAccess.getDisambiguatingSemanticPredicateAccess().getQuestionMarkKeyword_1()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__AbstractTokenWithCardinality__Group__0
@init {
int stackSize = keepStackSize();
@ -9324,6 +9424,21 @@ finally {
restoreStackSize(stackSize);
}
rule__DisambiguatingSemanticPredicate__CodeAssignment_0
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getDisambiguatingSemanticPredicateAccess().getCodeJavaCodeParserRuleCall_0_0()); }
ruleJavaCode
{ after(grammarAccess.getDisambiguatingSemanticPredicateAccess().getCodeJavaCodeParserRuleCall_0_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__JavaAction__CodeAssignment
@init {
int stackSize = keepStackSize();

View file

@ -944,12 +944,12 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_JAVACODESTRING;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10250:21: ( '$$' ( options {greedy=false; } : . )* '$$' )
// InternalXtext.g:10250:23: '$$' ( options {greedy=false; } : . )* '$$'
// InternalXtext.g:10365:21: ( '$$' ( options {greedy=false; } : . )* '$$' )
// InternalXtext.g:10365:23: '$$' ( options {greedy=false; } : . )* '$$'
{
match("$$");
// InternalXtext.g:10250:28: ( options {greedy=false; } : . )*
// InternalXtext.g:10365:28: ( options {greedy=false; } : . )*
loop1:
do {
int alt1=2;
@ -974,7 +974,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt1) {
case 1 :
// InternalXtext.g:10250:56: .
// InternalXtext.g:10365:56: .
{
matchAny();
@ -1004,10 +1004,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10252:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalXtext.g:10252:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
// InternalXtext.g:10367:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalXtext.g:10367:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{
// InternalXtext.g:10252:11: ( '^' )?
// InternalXtext.g:10367:11: ( '^' )?
int alt2=2;
int LA2_0 = input.LA(1);
@ -1016,7 +1016,7 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt2) {
case 1 :
// InternalXtext.g:10252:11: '^'
// InternalXtext.g:10367:11: '^'
{
match('^');
@ -1034,7 +1034,7 @@ public class InternalXtextLexer extends Lexer {
recover(mse);
throw mse;}
// InternalXtext.g:10252:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
// InternalXtext.g:10367:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
loop3:
do {
int alt3=2;
@ -1083,10 +1083,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_INT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10254:10: ( ( '0' .. '9' )+ )
// InternalXtext.g:10254:12: ( '0' .. '9' )+
// InternalXtext.g:10369:10: ( ( '0' .. '9' )+ )
// InternalXtext.g:10369:12: ( '0' .. '9' )+
{
// InternalXtext.g:10254:12: ( '0' .. '9' )+
// InternalXtext.g:10369:12: ( '0' .. '9' )+
int cnt4=0;
loop4:
do {
@ -1100,7 +1100,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt4) {
case 1 :
// InternalXtext.g:10254:13: '0' .. '9'
// InternalXtext.g:10369:13: '0' .. '9'
{
matchRange('0','9');
@ -1132,10 +1132,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_STRING;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10256:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalXtext.g:10256:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
// InternalXtext.g:10371:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalXtext.g:10371:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{
// InternalXtext.g:10256:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
// InternalXtext.g:10371:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
int alt7=2;
int LA7_0 = input.LA(1);
@ -1153,10 +1153,10 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt7) {
case 1 :
// InternalXtext.g:10256:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
// InternalXtext.g:10371:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{
match('\"');
// InternalXtext.g:10256:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
// InternalXtext.g:10371:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
loop5:
do {
int alt5=3;
@ -1172,7 +1172,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt5) {
case 1 :
// InternalXtext.g:10256:21: '\\\\' .
// InternalXtext.g:10371:21: '\\\\' .
{
match('\\');
matchAny();
@ -1180,7 +1180,7 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:10256:28: ~ ( ( '\\\\' | '\"' ) )
// InternalXtext.g:10371:28: ~ ( ( '\\\\' | '\"' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
@ -1205,10 +1205,10 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:10256:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
// InternalXtext.g:10371:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{
match('\'');
// InternalXtext.g:10256:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
// InternalXtext.g:10371:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
loop6:
do {
int alt6=3;
@ -1224,7 +1224,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt6) {
case 1 :
// InternalXtext.g:10256:54: '\\\\' .
// InternalXtext.g:10371:54: '\\\\' .
{
match('\\');
matchAny();
@ -1232,7 +1232,7 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:10256:61: ~ ( ( '\\\\' | '\\'' ) )
// InternalXtext.g:10371:61: ~ ( ( '\\\\' | '\\'' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
@ -1275,12 +1275,12 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ML_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10258:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalXtext.g:10258:19: '/*' ( options {greedy=false; } : . )* '*/'
// InternalXtext.g:10373:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalXtext.g:10373:19: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");
// InternalXtext.g:10258:24: ( options {greedy=false; } : . )*
// InternalXtext.g:10373:24: ( options {greedy=false; } : . )*
loop8:
do {
int alt8=2;
@ -1305,7 +1305,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt8) {
case 1 :
// InternalXtext.g:10258:52: .
// InternalXtext.g:10373:52: .
{
matchAny();
@ -1335,12 +1335,12 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_SL_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10260:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalXtext.g:10260:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
// InternalXtext.g:10375:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalXtext.g:10375:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{
match("//");
// InternalXtext.g:10260:24: (~ ( ( '\\n' | '\\r' ) ) )*
// InternalXtext.g:10375:24: (~ ( ( '\\n' | '\\r' ) ) )*
loop9:
do {
int alt9=2;
@ -1353,7 +1353,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt9) {
case 1 :
// InternalXtext.g:10260:24: ~ ( ( '\\n' | '\\r' ) )
// InternalXtext.g:10375:24: ~ ( ( '\\n' | '\\r' ) )
{
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();
@ -1373,7 +1373,7 @@ public class InternalXtextLexer extends Lexer {
}
} while (true);
// InternalXtext.g:10260:40: ( ( '\\r' )? '\\n' )?
// InternalXtext.g:10375:40: ( ( '\\r' )? '\\n' )?
int alt11=2;
int LA11_0 = input.LA(1);
@ -1382,9 +1382,9 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt11) {
case 1 :
// InternalXtext.g:10260:41: ( '\\r' )? '\\n'
// InternalXtext.g:10375:41: ( '\\r' )? '\\n'
{
// InternalXtext.g:10260:41: ( '\\r' )?
// InternalXtext.g:10375:41: ( '\\r' )?
int alt10=2;
int LA10_0 = input.LA(1);
@ -1393,7 +1393,7 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt10) {
case 1 :
// InternalXtext.g:10260:41: '\\r'
// InternalXtext.g:10375:41: '\\r'
{
match('\r');
@ -1425,10 +1425,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10262:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalXtext.g:10262:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
// InternalXtext.g:10377:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalXtext.g:10377:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{
// InternalXtext.g:10262:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
// InternalXtext.g:10377:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
int cnt12=0;
loop12:
do {
@ -1482,8 +1482,8 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ANY_OTHER;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10264:16: ( . )
// InternalXtext.g:10264:18: .
// InternalXtext.g:10379:16: ( . )
// InternalXtext.g:10379:18: .
{
matchAny();

View file

@ -0,0 +1,17 @@
/**
*/
package org.eclipse.xtext;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Disambiguating Semantic Predicate</b></em>'.
* <!-- end-user-doc -->
*
*
* @see org.eclipse.xtext.XtextPackage#getDisambiguatingSemanticPredicate()
* @model
* @generated
*/
public interface DisambiguatingSemanticPredicate extends AbstractSemanticPredicate {
} // DisambiguatingSemanticPredicate

View file

@ -390,6 +390,15 @@ public interface XtextFactory extends EFactory {
*/
InitBlock createInitBlock();
/**
* Returns a new object of class '<em>Disambiguating Semantic Predicate</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Disambiguating Semantic Predicate</em>'.
* @generated
*/
DisambiguatingSemanticPredicate createDisambiguatingSemanticPredicate();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->

View file

@ -2163,6 +2163,61 @@ public interface XtextPackage extends EPackage {
*/
int INIT_BLOCK_FEATURE_COUNT = 1;
/**
* The meta object id for the '{@link org.eclipse.xtext.impl.DisambiguatingSemanticPredicateImpl <em>Disambiguating Semantic Predicate</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.impl.DisambiguatingSemanticPredicateImpl
* @see org.eclipse.xtext.impl.XtextPackageImpl#getDisambiguatingSemanticPredicate()
* @generated
*/
int DISAMBIGUATING_SEMANTIC_PREDICATE = 41;
/**
* The feature id for the '<em><b>Cardinality</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int DISAMBIGUATING_SEMANTIC_PREDICATE__CARDINALITY = ABSTRACT_SEMANTIC_PREDICATE__CARDINALITY;
/**
* The feature id for the '<em><b>Predicated</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int DISAMBIGUATING_SEMANTIC_PREDICATE__PREDICATED = ABSTRACT_SEMANTIC_PREDICATE__PREDICATED;
/**
* The feature id for the '<em><b>First Set Predicated</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int DISAMBIGUATING_SEMANTIC_PREDICATE__FIRST_SET_PREDICATED = ABSTRACT_SEMANTIC_PREDICATE__FIRST_SET_PREDICATED;
/**
* The feature id for the '<em><b>Code</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int DISAMBIGUATING_SEMANTIC_PREDICATE__CODE = ABSTRACT_SEMANTIC_PREDICATE__CODE;
/**
* The number of structural features of the '<em>Disambiguating Semantic Predicate</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int DISAMBIGUATING_SEMANTIC_PREDICATE_FEATURE_COUNT = ABSTRACT_SEMANTIC_PREDICATE_FEATURE_COUNT + 0;
/**
* Returns the meta object for class '{@link org.eclipse.xtext.Grammar <em>Grammar</em>}'.
* <!-- begin-user-doc -->
@ -3236,6 +3291,16 @@ public interface XtextPackage extends EPackage {
*/
EReference getInitBlock_Code();
/**
* Returns the meta object for class '{@link org.eclipse.xtext.DisambiguatingSemanticPredicate <em>Disambiguating Semantic Predicate</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Disambiguating Semantic Predicate</em>'.
* @see org.eclipse.xtext.DisambiguatingSemanticPredicate
* @generated
*/
EClass getDisambiguatingSemanticPredicate();
/**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
@ -4157,6 +4222,16 @@ public interface XtextPackage extends EPackage {
*/
EReference INIT_BLOCK__CODE = eINSTANCE.getInitBlock_Code();
/**
* The meta object literal for the '{@link org.eclipse.xtext.impl.DisambiguatingSemanticPredicateImpl <em>Disambiguating Semantic Predicate</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.impl.DisambiguatingSemanticPredicateImpl
* @see org.eclipse.xtext.impl.XtextPackageImpl#getDisambiguatingSemanticPredicate()
* @generated
*/
EClass DISAMBIGUATING_SEMANTIC_PREDICATE = eINSTANCE.getDisambiguatingSemanticPredicate();
}
} //XtextPackage

View file

@ -0,0 +1,37 @@
/**
*/
package org.eclipse.xtext.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.xtext.DisambiguatingSemanticPredicate;
import org.eclipse.xtext.XtextPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Disambiguating Semantic Predicate</b></em>'.
* <!-- end-user-doc -->
*
* @generated
*/
public class DisambiguatingSemanticPredicateImpl extends AbstractSemanticPredicateImpl implements DisambiguatingSemanticPredicate {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DisambiguatingSemanticPredicateImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return XtextPackage.Literals.DISAMBIGUATING_SEMANTIC_PREDICATE;
}
} //DisambiguatingSemanticPredicateImpl

View file

@ -96,6 +96,7 @@ public class XtextFactoryImpl extends EFactoryImpl implements XtextFactory {
case XtextPackage.JAVA_CODE: return createJavaCode();
case XtextPackage.JAVA_ACTION: return createJavaAction();
case XtextPackage.INIT_BLOCK: return createInitBlock();
case XtextPackage.DISAMBIGUATING_SEMANTIC_PREDICATE: return createDisambiguatingSemanticPredicate();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@ -543,6 +544,17 @@ public class XtextFactoryImpl extends EFactoryImpl implements XtextFactory {
return initBlock;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public DisambiguatingSemanticPredicate createDisambiguatingSemanticPredicate() {
DisambiguatingSemanticPredicateImpl disambiguatingSemanticPredicate = new DisambiguatingSemanticPredicateImpl();
return disambiguatingSemanticPredicate;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->

View file

@ -25,6 +25,7 @@ import org.eclipse.xtext.CompoundElement;
import org.eclipse.xtext.Condition;
import org.eclipse.xtext.Conjunction;
import org.eclipse.xtext.CrossReference;
import org.eclipse.xtext.DisambiguatingSemanticPredicate;
import org.eclipse.xtext.Disjunction;
import org.eclipse.xtext.EnumLiteralDeclaration;
import org.eclipse.xtext.EnumRule;
@ -347,6 +348,13 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
*/
private EClass initBlockEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass disambiguatingSemanticPredicateEClass = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
@ -1412,6 +1420,16 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
return (EReference)initBlockEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getDisambiguatingSemanticPredicate() {
return disambiguatingSemanticPredicateEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -1580,6 +1598,8 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
initBlockEClass = createEClass(INIT_BLOCK);
createEReference(initBlockEClass, INIT_BLOCK__CODE);
disambiguatingSemanticPredicateEClass = createEClass(DISAMBIGUATING_SEMANTIC_PREDICATE);
}
/**
@ -1643,6 +1663,7 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
abstractSemanticPredicateEClass.getESuperTypes().add(this.getAbstractElement());
gatedSemanticPredicateEClass.getESuperTypes().add(this.getAbstractSemanticPredicate());
javaActionEClass.getESuperTypes().add(this.getAbstractElement());
disambiguatingSemanticPredicateEClass.getESuperTypes().add(this.getAbstractSemanticPredicate());
// Initialize classes and features; add operations and parameters
initEClass(grammarEClass, Grammar.class, "Grammar", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@ -1785,6 +1806,8 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
initEClass(initBlockEClass, InitBlock.class, "InitBlock", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getInitBlock_Code(), this.getJavaCode(), null, "code", null, 0, 1, InitBlock.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(disambiguatingSemanticPredicateEClass, DisambiguatingSemanticPredicate.class, "DisambiguatingSemanticPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
}

View file

@ -232,6 +232,10 @@ public class XtextAdapterFactory extends AdapterFactoryImpl {
return createInitBlockAdapter();
}
@Override
public Adapter caseDisambiguatingSemanticPredicate(DisambiguatingSemanticPredicate object) {
return createDisambiguatingSemanticPredicateAdapter();
}
@Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@ -834,6 +838,20 @@ public class XtextAdapterFactory extends AdapterFactoryImpl {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.DisambiguatingSemanticPredicate <em>Disambiguating Semantic Predicate</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.xtext.DisambiguatingSemanticPredicate
* @generated
*/
public Adapter createDisambiguatingSemanticPredicateAdapter() {
return null;
}
/**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->

View file

@ -351,6 +351,14 @@ public class XtextSwitch<T> extends Switch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
case XtextPackage.DISAMBIGUATING_SEMANTIC_PREDICATE: {
DisambiguatingSemanticPredicate disambiguatingSemanticPredicate = (DisambiguatingSemanticPredicate)theEObject;
T result = caseDisambiguatingSemanticPredicate(disambiguatingSemanticPredicate);
if (result == null) result = caseAbstractSemanticPredicate(disambiguatingSemanticPredicate);
if (result == null) result = caseAbstractElement(disambiguatingSemanticPredicate);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
@ -979,6 +987,21 @@ public class XtextSwitch<T> extends Switch<T> {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Disambiguating Semantic Predicate</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Disambiguating Semantic Predicate</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDisambiguatingSemanticPredicate(DisambiguatingSemanticPredicate object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->

View file

@ -159,4 +159,5 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="code" eType="#//JavaCode"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DisambiguatingSemanticPredicate" eSuperTypes="#//AbstractSemanticPredicate"/>
</ecore:EPackage>

View file

@ -137,5 +137,6 @@
<genClasses ecoreClass="Xtext.ecore#//InitBlock">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Xtext.ecore#//InitBlock/code"/>
</genClasses>
<genClasses ecoreClass="Xtext.ecore#//DisambiguatingSemanticPredicate"/>
</genPackages>
</genmodel:GenModel>

View file

@ -1360,14 +1360,25 @@ ruleSemanticPredicate returns [EObject current=null]
@after {
leaveRule();
}:
{
newCompositeNode(grammarAccess.getSemanticPredicateAccess().getGatedSemanticPredicateParserRuleCall());
}
this_GatedSemanticPredicate_0=ruleGatedSemanticPredicate
{
$current = $this_GatedSemanticPredicate_0.current;
afterParserOrEnumRuleCall();
}
(
{
newCompositeNode(grammarAccess.getSemanticPredicateAccess().getDisambiguatingSemanticPredicateParserRuleCall_0());
}
this_DisambiguatingSemanticPredicate_0=ruleDisambiguatingSemanticPredicate
{
$current = $this_DisambiguatingSemanticPredicate_0.current;
afterParserOrEnumRuleCall();
}
|
{
newCompositeNode(grammarAccess.getSemanticPredicateAccess().getGatedSemanticPredicateParserRuleCall_1());
}
this_GatedSemanticPredicate_1=ruleGatedSemanticPredicate
{
$current = $this_GatedSemanticPredicate_1.current;
afterParserOrEnumRuleCall();
}
)
;
// Entry rule entryRuleGatedSemanticPredicate
@ -1412,6 +1423,48 @@ ruleGatedSemanticPredicate returns [EObject current=null]
)
;
// Entry rule entryRuleDisambiguatingSemanticPredicate
entryRuleDisambiguatingSemanticPredicate returns [EObject current=null]:
{ newCompositeNode(grammarAccess.getDisambiguatingSemanticPredicateRule()); }
iv_ruleDisambiguatingSemanticPredicate=ruleDisambiguatingSemanticPredicate
{ $current=$iv_ruleDisambiguatingSemanticPredicate.current; }
EOF;
// Rule DisambiguatingSemanticPredicate
ruleDisambiguatingSemanticPredicate returns [EObject current=null]
@init {
enterRule();
}
@after {
leaveRule();
}:
(
(
(
{
newCompositeNode(grammarAccess.getDisambiguatingSemanticPredicateAccess().getCodeJavaCodeParserRuleCall_0_0());
}
lv_code_0_0=ruleJavaCode
{
if ($current==null) {
$current = createModelElementForParent(grammarAccess.getDisambiguatingSemanticPredicateRule());
}
set(
$current,
"code",
lv_code_0_0,
"org.eclipse.xtext.Xtext.JavaCode");
afterParserOrEnumRuleCall();
}
)
)
otherlv_1='?'
{
newLeafNode(otherlv_1, grammarAccess.getDisambiguatingSemanticPredicateAccess().getQuestionMarkKeyword_1());
}
)
;
// Entry rule entryRuleJavaAction
entryRuleJavaAction returns [EObject current=null]:
{ newCompositeNode(grammarAccess.getJavaActionRule()); }

View file

@ -944,12 +944,12 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_JAVACODESTRING;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:3973:21: ( '$$' ( options {greedy=false; } : . )* '$$' )
// InternalXtext.g:3973:23: '$$' ( options {greedy=false; } : . )* '$$'
// InternalXtext.g:4026:21: ( '$$' ( options {greedy=false; } : . )* '$$' )
// InternalXtext.g:4026:23: '$$' ( options {greedy=false; } : . )* '$$'
{
match("$$");
// InternalXtext.g:3973:28: ( options {greedy=false; } : . )*
// InternalXtext.g:4026:28: ( options {greedy=false; } : . )*
loop1:
do {
int alt1=2;
@ -974,7 +974,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt1) {
case 1 :
// InternalXtext.g:3973:56: .
// InternalXtext.g:4026:56: .
{
matchAny();
@ -1004,10 +1004,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:3975:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalXtext.g:3975:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
// InternalXtext.g:4028:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalXtext.g:4028:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{
// InternalXtext.g:3975:11: ( '^' )?
// InternalXtext.g:4028:11: ( '^' )?
int alt2=2;
int LA2_0 = input.LA(1);
@ -1016,7 +1016,7 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt2) {
case 1 :
// InternalXtext.g:3975:11: '^'
// InternalXtext.g:4028:11: '^'
{
match('^');
@ -1034,7 +1034,7 @@ public class InternalXtextLexer extends Lexer {
recover(mse);
throw mse;}
// InternalXtext.g:3975:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
// InternalXtext.g:4028:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
loop3:
do {
int alt3=2;
@ -1083,10 +1083,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_INT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:3977:10: ( ( '0' .. '9' )+ )
// InternalXtext.g:3977:12: ( '0' .. '9' )+
// InternalXtext.g:4030:10: ( ( '0' .. '9' )+ )
// InternalXtext.g:4030:12: ( '0' .. '9' )+
{
// InternalXtext.g:3977:12: ( '0' .. '9' )+
// InternalXtext.g:4030:12: ( '0' .. '9' )+
int cnt4=0;
loop4:
do {
@ -1100,7 +1100,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt4) {
case 1 :
// InternalXtext.g:3977:13: '0' .. '9'
// InternalXtext.g:4030:13: '0' .. '9'
{
matchRange('0','9');
@ -1132,10 +1132,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_STRING;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:3979:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalXtext.g:3979:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
// InternalXtext.g:4032:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalXtext.g:4032:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{
// InternalXtext.g:3979:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
// InternalXtext.g:4032:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
int alt7=2;
int LA7_0 = input.LA(1);
@ -1153,10 +1153,10 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt7) {
case 1 :
// InternalXtext.g:3979:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
// InternalXtext.g:4032:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{
match('\"');
// InternalXtext.g:3979:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
// InternalXtext.g:4032:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
loop5:
do {
int alt5=3;
@ -1172,7 +1172,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt5) {
case 1 :
// InternalXtext.g:3979:21: '\\\\' .
// InternalXtext.g:4032:21: '\\\\' .
{
match('\\');
matchAny();
@ -1180,7 +1180,7 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:3979:28: ~ ( ( '\\\\' | '\"' ) )
// InternalXtext.g:4032:28: ~ ( ( '\\\\' | '\"' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
@ -1205,10 +1205,10 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:3979:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
// InternalXtext.g:4032:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{
match('\'');
// InternalXtext.g:3979:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
// InternalXtext.g:4032:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
loop6:
do {
int alt6=3;
@ -1224,7 +1224,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt6) {
case 1 :
// InternalXtext.g:3979:54: '\\\\' .
// InternalXtext.g:4032:54: '\\\\' .
{
match('\\');
matchAny();
@ -1232,7 +1232,7 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:3979:61: ~ ( ( '\\\\' | '\\'' ) )
// InternalXtext.g:4032:61: ~ ( ( '\\\\' | '\\'' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
@ -1275,12 +1275,12 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ML_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:3981:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalXtext.g:3981:19: '/*' ( options {greedy=false; } : . )* '*/'
// InternalXtext.g:4034:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalXtext.g:4034:19: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");
// InternalXtext.g:3981:24: ( options {greedy=false; } : . )*
// InternalXtext.g:4034:24: ( options {greedy=false; } : . )*
loop8:
do {
int alt8=2;
@ -1305,7 +1305,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt8) {
case 1 :
// InternalXtext.g:3981:52: .
// InternalXtext.g:4034:52: .
{
matchAny();
@ -1335,12 +1335,12 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_SL_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:3983:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalXtext.g:3983:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
// InternalXtext.g:4036:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalXtext.g:4036:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{
match("//");
// InternalXtext.g:3983:24: (~ ( ( '\\n' | '\\r' ) ) )*
// InternalXtext.g:4036:24: (~ ( ( '\\n' | '\\r' ) ) )*
loop9:
do {
int alt9=2;
@ -1353,7 +1353,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt9) {
case 1 :
// InternalXtext.g:3983:24: ~ ( ( '\\n' | '\\r' ) )
// InternalXtext.g:4036:24: ~ ( ( '\\n' | '\\r' ) )
{
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();
@ -1373,7 +1373,7 @@ public class InternalXtextLexer extends Lexer {
}
} while (true);
// InternalXtext.g:3983:40: ( ( '\\r' )? '\\n' )?
// InternalXtext.g:4036:40: ( ( '\\r' )? '\\n' )?
int alt11=2;
int LA11_0 = input.LA(1);
@ -1382,9 +1382,9 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt11) {
case 1 :
// InternalXtext.g:3983:41: ( '\\r' )? '\\n'
// InternalXtext.g:4036:41: ( '\\r' )? '\\n'
{
// InternalXtext.g:3983:41: ( '\\r' )?
// InternalXtext.g:4036:41: ( '\\r' )?
int alt10=2;
int LA10_0 = input.LA(1);
@ -1393,7 +1393,7 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt10) {
case 1 :
// InternalXtext.g:3983:41: '\\r'
// InternalXtext.g:4036:41: '\\r'
{
match('\r');
@ -1425,10 +1425,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:3985:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalXtext.g:3985:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
// InternalXtext.g:4038:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalXtext.g:4038:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{
// InternalXtext.g:3985:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
// InternalXtext.g:4038:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
int cnt12=0;
loop12:
do {
@ -1482,8 +1482,8 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ANY_OTHER;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:3987:16: ( . )
// InternalXtext.g:3987:18: .
// InternalXtext.g:4040:16: ( . )
// InternalXtext.g:4040:18: .
{
matchAny();

View file

@ -14,6 +14,7 @@ import org.eclipse.xtext.Assignment;
import org.eclipse.xtext.CharacterRange;
import org.eclipse.xtext.Conjunction;
import org.eclipse.xtext.CrossReference;
import org.eclipse.xtext.DisambiguatingSemanticPredicate;
import org.eclipse.xtext.Disjunction;
import org.eclipse.xtext.EOF;
import org.eclipse.xtext.EnumLiteralDeclaration;
@ -162,6 +163,27 @@ public class XtextSemanticSequencer extends AbstractDelegatingSemanticSequencer
case XtextPackage.CROSS_REFERENCE:
sequence_CrossReference(context, (CrossReference) semanticObject);
return;
case XtextPackage.DISAMBIGUATING_SEMANTIC_PREDICATE:
if (rule == grammarAccess.getAlternativesRule()
|| action == grammarAccess.getAlternativesAccess().getAlternativesElementsAction_1_0()
|| rule == grammarAccess.getConditionalBranchRule()
|| rule == grammarAccess.getUnorderedGroupRule()
|| action == grammarAccess.getUnorderedGroupAccess().getUnorderedGroupElementsAction_1_0()
|| rule == grammarAccess.getGroupRule()
|| action == grammarAccess.getGroupAccess().getGroupElementsAction_1_0()
|| rule == grammarAccess.getAbstractTokenRule()
|| rule == grammarAccess.getAbstractTokenWithCardinalityRule()
|| rule == grammarAccess.getAbstractTerminalRule()
|| rule == grammarAccess.getParenthesizedElementRule()) {
sequence_AbstractTokenWithCardinality_DisambiguatingSemanticPredicate(context, (DisambiguatingSemanticPredicate) semanticObject);
return;
}
else if (rule == grammarAccess.getSemanticPredicateRule()
|| rule == grammarAccess.getDisambiguatingSemanticPredicateRule()) {
sequence_DisambiguatingSemanticPredicate(context, (DisambiguatingSemanticPredicate) semanticObject);
return;
}
else break;
case XtextPackage.DISJUNCTION:
sequence_Disjunction(context, (Disjunction) semanticObject);
return;
@ -540,6 +562,28 @@ public class XtextSemanticSequencer extends AbstractDelegatingSemanticSequencer
}
/**
* Contexts:
* Alternatives returns DisambiguatingSemanticPredicate
* Alternatives.Alternatives_1_0 returns DisambiguatingSemanticPredicate
* ConditionalBranch returns DisambiguatingSemanticPredicate
* UnorderedGroup returns DisambiguatingSemanticPredicate
* UnorderedGroup.UnorderedGroup_1_0 returns DisambiguatingSemanticPredicate
* Group returns DisambiguatingSemanticPredicate
* Group.Group_1_0 returns DisambiguatingSemanticPredicate
* AbstractToken returns DisambiguatingSemanticPredicate
* AbstractTokenWithCardinality returns DisambiguatingSemanticPredicate
* AbstractTerminal returns DisambiguatingSemanticPredicate
* ParenthesizedElement returns DisambiguatingSemanticPredicate
*
* Constraint:
* (code=JavaCode (cardinality='?' | cardinality='*' | cardinality='+')*)
*/
protected void sequence_AbstractTokenWithCardinality_DisambiguatingSemanticPredicate(ISerializationContext context, DisambiguatingSemanticPredicate semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Alternatives returns GatedSemanticPredicate
@ -795,6 +839,25 @@ public class XtextSemanticSequencer extends AbstractDelegatingSemanticSequencer
}
/**
* Contexts:
* SemanticPredicate returns DisambiguatingSemanticPredicate
* DisambiguatingSemanticPredicate returns DisambiguatingSemanticPredicate
*
* Constraint:
* code=JavaCode
*/
protected void sequence_DisambiguatingSemanticPredicate(ISerializationContext context, DisambiguatingSemanticPredicate semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XtextPackage.Literals.ABSTRACT_SEMANTIC_PREDICATE__CODE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XtextPackage.Literals.ABSTRACT_SEMANTIC_PREDICATE__CODE));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getDisambiguatingSemanticPredicateAccess().getCodeJavaCodeParserRuleCall_0_0(), semanticObject.getCode());
feeder.finish();
}
/**
* Contexts:
* Disjunction returns Disjunction

View file

@ -865,14 +865,22 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
}
public class SemanticPredicateElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.Xtext.SemanticPredicate");
private final RuleCall cGatedSemanticPredicateParserRuleCall = (RuleCall)rule.eContents().get(1);
private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
private final RuleCall cDisambiguatingSemanticPredicateParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0);
private final RuleCall cGatedSemanticPredicateParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1);
//SemanticPredicate AbstractSemanticPredicate:
// GatedSemanticPredicate;
// DisambiguatingSemanticPredicate | GatedSemanticPredicate;
@Override public ParserRule getRule() { return rule; }
//DisambiguatingSemanticPredicate | GatedSemanticPredicate
public Alternatives getAlternatives() { return cAlternatives; }
//DisambiguatingSemanticPredicate
public RuleCall getDisambiguatingSemanticPredicateParserRuleCall_0() { return cDisambiguatingSemanticPredicateParserRuleCall_0; }
//GatedSemanticPredicate
public RuleCall getGatedSemanticPredicateParserRuleCall() { return cGatedSemanticPredicateParserRuleCall; }
public RuleCall getGatedSemanticPredicateParserRuleCall_1() { return cGatedSemanticPredicateParserRuleCall_1; }
}
public class GatedSemanticPredicateElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.Xtext.GatedSemanticPredicate");
@ -897,6 +905,29 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
//'?=>'
public Keyword getQuestionMarkEqualsSignGreaterThanSignKeyword_1() { return cQuestionMarkEqualsSignGreaterThanSignKeyword_1; }
}
public class DisambiguatingSemanticPredicateElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.Xtext.DisambiguatingSemanticPredicate");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Assignment cCodeAssignment_0 = (Assignment)cGroup.eContents().get(0);
private final RuleCall cCodeJavaCodeParserRuleCall_0_0 = (RuleCall)cCodeAssignment_0.eContents().get(0);
private final Keyword cQuestionMarkKeyword_1 = (Keyword)cGroup.eContents().get(1);
//DisambiguatingSemanticPredicate:
// code=JavaCode '?';
@Override public ParserRule getRule() { return rule; }
//code=JavaCode '?'
public Group getGroup() { return cGroup; }
//code=JavaCode
public Assignment getCodeAssignment_0() { return cCodeAssignment_0; }
//JavaCode
public RuleCall getCodeJavaCodeParserRuleCall_0_0() { return cCodeJavaCodeParserRuleCall_0_0; }
//'?'
public Keyword getQuestionMarkKeyword_1() { return cQuestionMarkKeyword_1; }
}
public class JavaActionElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.Xtext.JavaAction");
private final Assignment cCodeAssignment = (Assignment)rule.eContents().get(1);
@ -2432,6 +2463,7 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
private final AbstractTokenElements pAbstractToken;
private final SemanticPredicateElements pSemanticPredicate;
private final GatedSemanticPredicateElements pGatedSemanticPredicate;
private final DisambiguatingSemanticPredicateElements pDisambiguatingSemanticPredicate;
private final JavaActionElements pJavaAction;
private final JavaCodeElements pJavaCode;
private final TerminalRule tJAVACODESTRING;
@ -2505,6 +2537,7 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
this.pAbstractToken = new AbstractTokenElements();
this.pSemanticPredicate = new SemanticPredicateElements();
this.pGatedSemanticPredicate = new GatedSemanticPredicateElements();
this.pDisambiguatingSemanticPredicate = new DisambiguatingSemanticPredicateElements();
this.pJavaAction = new JavaActionElements();
this.pJavaCode = new JavaCodeElements();
this.tJAVACODESTRING = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.Xtext.JAVACODESTRING");
@ -2766,7 +2799,7 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
}
//SemanticPredicate AbstractSemanticPredicate:
// GatedSemanticPredicate;
// DisambiguatingSemanticPredicate | GatedSemanticPredicate;
public SemanticPredicateElements getSemanticPredicateAccess() {
return pSemanticPredicate;
}
@ -2785,6 +2818,16 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
return getGatedSemanticPredicateAccess().getRule();
}
//DisambiguatingSemanticPredicate:
// code=JavaCode '?';
public DisambiguatingSemanticPredicateElements getDisambiguatingSemanticPredicateAccess() {
return pDisambiguatingSemanticPredicate;
}
public ParserRule getDisambiguatingSemanticPredicateRule() {
return getDisambiguatingSemanticPredicateAccess().getRule();
}
//JavaAction:
// code=JavaCode;
public JavaActionElements getJavaActionAccess() {

View file

@ -97,6 +97,7 @@ AbstractToken returns AbstractElement:
;
SemanticPredicate returns AbstractSemanticPredicate:
DisambiguatingSemanticPredicate |
GatedSemanticPredicate
;
@ -104,6 +105,10 @@ GatedSemanticPredicate returns GatedSemanticPredicate:
code=JavaCode '?=>'
;
DisambiguatingSemanticPredicate returns DisambiguatingSemanticPredicate:
code=JavaCode '?'
;
JavaAction returns JavaAction:
code=JavaCode
;