mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
Merge pull request #1413 from eclipse/sz_bug318482
[bug 318482] Support keywords as terminals in cross references
This commit is contained in:
commit
8413a4df0e
22 changed files with 984 additions and 617 deletions
|
@ -59,7 +59,7 @@ public class SerializationErrorTestLanguageSemanticSequencer extends AbstractDel
|
|||
* Indent returns Indent
|
||||
*
|
||||
* Constraint:
|
||||
* ((((req=TwoRequired opt=TwoOptions) | opt=TwoOptions)? indent+=Indent+) | indent+=Indent+)?
|
||||
* ((req=TwoRequired? opt=TwoOptions indent+=Indent+) | (req=TwoRequired? indent+=Indent+) | indent+=Indent+)?
|
||||
*/
|
||||
protected void sequence_Indent(ISerializationContext context, Indent semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
<eStructuralFeatures xsi:type="ecore:EReference" name="ref2" eType="#//SingleCrossReference"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="ref3" eType="#//SingleCrossReference"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="ref4" eType="#//SingleCrossReference"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="ref5" eType="#//SingleCrossReference"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="BooleanAlternative">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="bool" eType="#//BooleanAlternativeLiteral"
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SyntacticSequencerTestLanguage.ecore#//SingleCrossReference/ref2"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SyntacticSequencerTestLanguage.ecore#//SingleCrossReference/ref3"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SyntacticSequencerTestLanguage.ecore#//SingleCrossReference/ref4"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SyntacticSequencerTestLanguage.ecore#//SingleCrossReference/ref5"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="SyntacticSequencerTestLanguage.ecore#//BooleanAlternative">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SyntacticSequencerTestLanguage.ecore#//BooleanAlternative/bool"/>
|
||||
|
|
Binary file not shown.
|
@ -1070,6 +1070,17 @@ ruleSingleCrossReference returns [EObject current=null]
|
|||
lv_name_1_2,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
}
|
||||
|
|
||||
lv_name_1_3='kw5'
|
||||
{
|
||||
newLeafNode(lv_name_1_3, grammarAccess.getSingleCrossReferenceAccess().getNameKw5Keyword_1_0_2());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getSingleCrossReferenceRule());
|
||||
}
|
||||
setWithLastConsumed($current, "name", lv_name_1_3, null);
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -1152,6 +1163,25 @@ ruleSingleCrossReference returns [EObject current=null]
|
|||
)
|
||||
)
|
||||
)?
|
||||
(
|
||||
otherlv_10='kw5'
|
||||
{
|
||||
newLeafNode(otherlv_10, grammarAccess.getSingleCrossReferenceAccess().getKw5Keyword_6_0());
|
||||
}
|
||||
(
|
||||
(
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getSingleCrossReferenceRule());
|
||||
}
|
||||
}
|
||||
otherlv_11='kw5'
|
||||
{
|
||||
newLeafNode(otherlv_11, grammarAccess.getSingleCrossReferenceAccess().getRef5SingleCrossReferenceCrossReference_6_1_0());
|
||||
}
|
||||
)
|
||||
)
|
||||
)?
|
||||
)
|
||||
;
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
'!'=40
|
||||
'#1'=14
|
||||
'#10'=32
|
||||
'#11'=33
|
||||
'#12'=34
|
||||
'#13'=35
|
||||
'#10'=33
|
||||
'#11'=34
|
||||
'#12'=35
|
||||
'#13'=36
|
||||
'#14'=41
|
||||
'#15'=42
|
||||
'#2'=19
|
||||
'#3'=21
|
||||
'#4'=24
|
||||
'#5'=26
|
||||
'#6'=27
|
||||
'#7'=28
|
||||
'#8'=30
|
||||
'#9'=31
|
||||
'#6'=28
|
||||
'#7'=29
|
||||
'#8'=31
|
||||
'#9'=32
|
||||
'('=22
|
||||
')'=23
|
||||
'*'=25
|
||||
|
@ -22,11 +22,11 @@
|
|||
'kw2'=16
|
||||
'kw3'=17
|
||||
'kw4'=18
|
||||
'kw5'=36
|
||||
'kw5'=27
|
||||
'kw6'=37
|
||||
'kw7'=38
|
||||
'kw8'=39
|
||||
'matched'=29
|
||||
'matched'=30
|
||||
RULE_ANY_OTHER=13
|
||||
RULE_BOOLEAN_TERMINAL_ID=7
|
||||
RULE_C_COMMENT_END=8
|
||||
|
|
|
@ -340,10 +340,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__27;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:24:7: ( '#6' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:24:9: '#6'
|
||||
// InternalSyntacticSequencerTestLanguage.g:24:7: ( 'kw5' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:24:9: 'kw5'
|
||||
{
|
||||
match("#6");
|
||||
match("kw5");
|
||||
|
||||
|
||||
}
|
||||
|
@ -361,10 +361,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__28;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:25:7: ( '#7' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:25:9: '#7'
|
||||
// InternalSyntacticSequencerTestLanguage.g:25:7: ( '#6' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:25:9: '#6'
|
||||
{
|
||||
match("#7");
|
||||
match("#6");
|
||||
|
||||
|
||||
}
|
||||
|
@ -382,10 +382,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__29;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:26:7: ( 'matched' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:26:9: 'matched'
|
||||
// InternalSyntacticSequencerTestLanguage.g:26:7: ( '#7' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:26:9: '#7'
|
||||
{
|
||||
match("matched");
|
||||
match("#7");
|
||||
|
||||
|
||||
}
|
||||
|
@ -403,10 +403,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__30;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:27:7: ( '#8' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:27:9: '#8'
|
||||
// InternalSyntacticSequencerTestLanguage.g:27:7: ( 'matched' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:27:9: 'matched'
|
||||
{
|
||||
match("#8");
|
||||
match("matched");
|
||||
|
||||
|
||||
}
|
||||
|
@ -424,10 +424,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__31;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:28:7: ( '#9' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:28:9: '#9'
|
||||
// InternalSyntacticSequencerTestLanguage.g:28:7: ( '#8' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:28:9: '#8'
|
||||
{
|
||||
match("#9");
|
||||
match("#8");
|
||||
|
||||
|
||||
}
|
||||
|
@ -445,10 +445,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__32;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:29:7: ( '#10' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:29:9: '#10'
|
||||
// InternalSyntacticSequencerTestLanguage.g:29:7: ( '#9' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:29:9: '#9'
|
||||
{
|
||||
match("#10");
|
||||
match("#9");
|
||||
|
||||
|
||||
}
|
||||
|
@ -466,10 +466,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__33;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:30:7: ( '#11' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:30:9: '#11'
|
||||
// InternalSyntacticSequencerTestLanguage.g:30:7: ( '#10' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:30:9: '#10'
|
||||
{
|
||||
match("#11");
|
||||
match("#10");
|
||||
|
||||
|
||||
}
|
||||
|
@ -487,10 +487,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__34;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:31:7: ( '#12' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:31:9: '#12'
|
||||
// InternalSyntacticSequencerTestLanguage.g:31:7: ( '#11' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:31:9: '#11'
|
||||
{
|
||||
match("#12");
|
||||
match("#11");
|
||||
|
||||
|
||||
}
|
||||
|
@ -508,10 +508,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__35;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:32:7: ( '#13' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:32:9: '#13'
|
||||
// InternalSyntacticSequencerTestLanguage.g:32:7: ( '#12' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:32:9: '#12'
|
||||
{
|
||||
match("#13");
|
||||
match("#12");
|
||||
|
||||
|
||||
}
|
||||
|
@ -529,10 +529,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = T__36;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:33:7: ( 'kw5' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:33:9: 'kw5'
|
||||
// InternalSyntacticSequencerTestLanguage.g:33:7: ( '#13' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:33:9: '#13'
|
||||
{
|
||||
match("kw5");
|
||||
match("#13");
|
||||
|
||||
|
||||
}
|
||||
|
@ -675,8 +675,8 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_TERMINAL_ID;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2087:18: ( '$1' RULE_ID )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2087:20: '$1' RULE_ID
|
||||
// InternalSyntacticSequencerTestLanguage.g:2117:18: ( '$1' RULE_ID )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2117:20: '$1' RULE_ID
|
||||
{
|
||||
match("$1");
|
||||
|
||||
|
@ -697,8 +697,8 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_BOOLEAN_TERMINAL_ID;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2089:26: ( '%1' RULE_ID )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2089:28: '%1' RULE_ID
|
||||
// InternalSyntacticSequencerTestLanguage.g:2119:26: ( '%1' RULE_ID )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2119:28: '%1' RULE_ID
|
||||
{
|
||||
match("%1");
|
||||
|
||||
|
@ -719,8 +719,8 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_C_COMMENT_END;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2091:20: ( '*/' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2091:22: '*/'
|
||||
// InternalSyntacticSequencerTestLanguage.g:2121:20: ( '*/' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2121:22: '*/'
|
||||
{
|
||||
match("*/");
|
||||
|
||||
|
@ -740,10 +740,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_ID;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2093:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2093:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
// InternalSyntacticSequencerTestLanguage.g:2123:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2123:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
{
|
||||
// InternalSyntacticSequencerTestLanguage.g:2093:11: ( '^' )?
|
||||
// InternalSyntacticSequencerTestLanguage.g:2123:11: ( '^' )?
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
|
@ -752,7 +752,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
}
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2093:11: '^'
|
||||
// InternalSyntacticSequencerTestLanguage.g:2123:11: '^'
|
||||
{
|
||||
match('^');
|
||||
|
||||
|
@ -770,7 +770,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
// InternalSyntacticSequencerTestLanguage.g:2093:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
// InternalSyntacticSequencerTestLanguage.g:2123:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
|
@ -819,10 +819,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_INT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2095:10: ( ( '0' .. '9' )+ )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2095:12: ( '0' .. '9' )+
|
||||
// InternalSyntacticSequencerTestLanguage.g:2125:10: ( ( '0' .. '9' )+ )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2125:12: ( '0' .. '9' )+
|
||||
{
|
||||
// InternalSyntacticSequencerTestLanguage.g:2095:12: ( '0' .. '9' )+
|
||||
// InternalSyntacticSequencerTestLanguage.g:2125:12: ( '0' .. '9' )+
|
||||
int cnt3=0;
|
||||
loop3:
|
||||
do {
|
||||
|
@ -836,7 +836,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2095:13: '0' .. '9'
|
||||
// InternalSyntacticSequencerTestLanguage.g:2125:13: '0' .. '9'
|
||||
{
|
||||
matchRange('0','9');
|
||||
|
||||
|
@ -868,10 +868,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_STRING;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
{
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
int alt6=2;
|
||||
int LA6_0 = input.LA(1);
|
||||
|
||||
|
@ -889,10 +889,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
}
|
||||
switch (alt6) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
|
||||
{
|
||||
match('\"');
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
|
||||
loop4:
|
||||
do {
|
||||
int alt4=3;
|
||||
|
@ -908,7 +908,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:21: '\\\\' .
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:21: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
@ -916,7 +916,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:28: ~ ( ( '\\\\' | '\"' ) )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:28: ~ ( ( '\\\\' | '\"' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
@ -941,10 +941,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
|
||||
{
|
||||
match('\'');
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
|
||||
loop5:
|
||||
do {
|
||||
int alt5=3;
|
||||
|
@ -960,7 +960,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:54: '\\\\' .
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:54: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
@ -968,7 +968,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2097:61: ~ ( ( '\\\\' | '\\'' ) )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2127:61: ~ ( ( '\\\\' | '\\'' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
@ -1011,12 +1011,12 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_ML_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2099:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2099:19: '/*' ( options {greedy=false; } : . )* '*/'
|
||||
// InternalSyntacticSequencerTestLanguage.g:2129:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2129:19: '/*' ( options {greedy=false; } : . )* '*/'
|
||||
{
|
||||
match("/*");
|
||||
|
||||
// InternalSyntacticSequencerTestLanguage.g:2099:24: ( options {greedy=false; } : . )*
|
||||
// InternalSyntacticSequencerTestLanguage.g:2129:24: ( options {greedy=false; } : . )*
|
||||
loop7:
|
||||
do {
|
||||
int alt7=2;
|
||||
|
@ -1041,7 +1041,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
|
||||
switch (alt7) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2099:52: .
|
||||
// InternalSyntacticSequencerTestLanguage.g:2129:52: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
|
@ -1071,12 +1071,12 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_SL_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2101:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2101:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
|
||||
// InternalSyntacticSequencerTestLanguage.g:2131:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2131:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
|
||||
{
|
||||
match("//");
|
||||
|
||||
// InternalSyntacticSequencerTestLanguage.g:2101:24: (~ ( ( '\\n' | '\\r' ) ) )*
|
||||
// InternalSyntacticSequencerTestLanguage.g:2131:24: (~ ( ( '\\n' | '\\r' ) ) )*
|
||||
loop8:
|
||||
do {
|
||||
int alt8=2;
|
||||
|
@ -1089,7 +1089,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
|
||||
switch (alt8) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2101:24: ~ ( ( '\\n' | '\\r' ) )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2131: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();
|
||||
|
@ -1109,7 +1109,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
}
|
||||
} while (true);
|
||||
|
||||
// InternalSyntacticSequencerTestLanguage.g:2101:40: ( ( '\\r' )? '\\n' )?
|
||||
// InternalSyntacticSequencerTestLanguage.g:2131:40: ( ( '\\r' )? '\\n' )?
|
||||
int alt10=2;
|
||||
int LA10_0 = input.LA(1);
|
||||
|
||||
|
@ -1118,9 +1118,9 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
}
|
||||
switch (alt10) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2101:41: ( '\\r' )? '\\n'
|
||||
// InternalSyntacticSequencerTestLanguage.g:2131:41: ( '\\r' )? '\\n'
|
||||
{
|
||||
// InternalSyntacticSequencerTestLanguage.g:2101:41: ( '\\r' )?
|
||||
// InternalSyntacticSequencerTestLanguage.g:2131:41: ( '\\r' )?
|
||||
int alt9=2;
|
||||
int LA9_0 = input.LA(1);
|
||||
|
||||
|
@ -1129,7 +1129,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
}
|
||||
switch (alt9) {
|
||||
case 1 :
|
||||
// InternalSyntacticSequencerTestLanguage.g:2101:41: '\\r'
|
||||
// InternalSyntacticSequencerTestLanguage.g:2131:41: '\\r'
|
||||
{
|
||||
match('\r');
|
||||
|
||||
|
@ -1161,10 +1161,10 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_WS;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2103:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2103:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
// InternalSyntacticSequencerTestLanguage.g:2133:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2133:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
{
|
||||
// InternalSyntacticSequencerTestLanguage.g:2103:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
// InternalSyntacticSequencerTestLanguage.g:2133:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
int cnt11=0;
|
||||
loop11:
|
||||
do {
|
||||
|
@ -1218,8 +1218,8 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
try {
|
||||
int _type = RULE_ANY_OTHER;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalSyntacticSequencerTestLanguage.g:2105:16: ( . )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2105:18: .
|
||||
// InternalSyntacticSequencerTestLanguage.g:2135:16: ( . )
|
||||
// InternalSyntacticSequencerTestLanguage.g:2135:18: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
|
@ -1527,7 +1527,7 @@ public class InternalSyntacticSequencerTestLanguageLexer extends Lexer {
|
|||
static final String DFA12_maxS =
|
||||
"\1\uffff\1\71\1\167\3\uffff\1\57\1\141\1\uffff\2\61\1\172\2\uffff\2\uffff\1\57\2\uffff\1\65\10\uffff\1\70\6\uffff\1\164\17\uffff\10\172\1\143\10\uffff\1\150\1\145\1\144\1\172\1\uffff";
|
||||
static final String DFA12_acceptS =
|
||||
"\3\uffff\1\7\1\11\1\12\2\uffff\1\33\3\uffff\1\41\1\42\3\uffff\1\46\1\47\1\uffff\1\6\1\10\1\13\1\15\1\16\1\17\1\21\1\22\1\uffff\1\41\1\7\1\11\1\12\1\40\1\14\1\uffff\1\33\1\36\1\37\1\42\1\43\1\44\1\45\1\46\1\23\1\24\1\25\1\26\1\34\1\35\1\1\11\uffff\1\2\1\3\1\4\1\5\1\27\1\30\1\31\1\32\4\uffff\1\20";
|
||||
"\3\uffff\1\7\1\11\1\12\2\uffff\1\33\3\uffff\1\41\1\42\3\uffff\1\46\1\47\1\uffff\1\6\1\10\1\13\1\15\1\17\1\20\1\22\1\23\1\uffff\1\41\1\7\1\11\1\12\1\40\1\14\1\uffff\1\33\1\36\1\37\1\42\1\43\1\44\1\45\1\46\1\24\1\25\1\26\1\27\1\34\1\35\1\1\11\uffff\1\2\1\3\1\4\1\5\1\16\1\30\1\31\1\32\4\uffff\1\21";
|
||||
static final String DFA12_specialS =
|
||||
"\1\2\15\uffff\1\0\1\1\71\uffff}>";
|
||||
static final String[] DFA12_transitionS = DFA12_transitionS_.DFA12_transitionS;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -539,11 +539,12 @@ public abstract class AbstractSyntacticSequencerTestLanguageSemanticSequencer ex
|
|||
*
|
||||
* Constraint:
|
||||
* (
|
||||
* (name=TERMINAL_ID | name=ID)
|
||||
* (name=TERMINAL_ID | name=ID | name='kw5')
|
||||
* ref1=[SingleCrossReference|TERMINAL_ID]?
|
||||
* ref2=[SingleCrossReference|DatatypeID]?
|
||||
* ref3=[SingleCrossReference|ID]?
|
||||
* ref4=[SingleCrossReference|ID]?
|
||||
* ref4=[SingleCrossReference|ID]?
|
||||
* ref5=[SingleCrossReference|'kw5']?
|
||||
* )
|
||||
*/
|
||||
protected void sequence_SingleCrossReference(ISerializationContext context, SingleCrossReference semanticObject) {
|
||||
|
|
|
@ -549,6 +549,7 @@ public class SyntacticSequencerTestLanguageGrammarAccess extends AbstractGrammar
|
|||
private final Alternatives cNameAlternatives_1_0 = (Alternatives)cNameAssignment_1.eContents().get(0);
|
||||
private final RuleCall cNameTERMINAL_IDTerminalRuleCall_1_0_0 = (RuleCall)cNameAlternatives_1_0.eContents().get(0);
|
||||
private final RuleCall cNameIDTerminalRuleCall_1_0_1 = (RuleCall)cNameAlternatives_1_0.eContents().get(1);
|
||||
private final Keyword cNameKw5Keyword_1_0_2 = (Keyword)cNameAlternatives_1_0.eContents().get(2);
|
||||
private final Group cGroup_2 = (Group)cGroup.eContents().get(2);
|
||||
private final Keyword cKw1Keyword_2_0 = (Keyword)cGroup_2.eContents().get(0);
|
||||
private final Assignment cRef1Assignment_2_1 = (Assignment)cGroup_2.eContents().get(1);
|
||||
|
@ -569,23 +570,30 @@ public class SyntacticSequencerTestLanguageGrammarAccess extends AbstractGrammar
|
|||
private final Assignment cRef4Assignment_5_1 = (Assignment)cGroup_5.eContents().get(1);
|
||||
private final CrossReference cRef4SingleCrossReferenceCrossReference_5_1_0 = (CrossReference)cRef4Assignment_5_1.eContents().get(0);
|
||||
private final RuleCall cRef4SingleCrossReferenceIDTerminalRuleCall_5_1_0_1 = (RuleCall)cRef4SingleCrossReferenceCrossReference_5_1_0.eContents().get(1);
|
||||
private final Group cGroup_6 = (Group)cGroup.eContents().get(6);
|
||||
private final Keyword cKw5Keyword_6_0 = (Keyword)cGroup_6.eContents().get(0);
|
||||
private final Assignment cRef5Assignment_6_1 = (Assignment)cGroup_6.eContents().get(1);
|
||||
private final CrossReference cRef5SingleCrossReferenceCrossReference_6_1_0 = (CrossReference)cRef5Assignment_6_1.eContents().get(0);
|
||||
private final Keyword cRef5SingleCrossReferenceKw5Keyword_6_1_0_1 = (Keyword)cRef5SingleCrossReferenceCrossReference_6_1_0.eContents().get(1);
|
||||
|
||||
//SingleCrossReference:
|
||||
// "#5" name=(TERMINAL_ID | ID) ("kw1" ref1=[SingleCrossReference|TERMINAL_ID])? ("kw2"
|
||||
// ref2=[SingleCrossReference|DatatypeID])? ("kw3" ref3=[SingleCrossReference])? ("kw4" ref4=[SingleCrossReference])?;
|
||||
// "#5" name=(TERMINAL_ID | ID | "kw5") ("kw1" ref1=[SingleCrossReference|TERMINAL_ID])? ("kw2"
|
||||
// ref2=[SingleCrossReference|DatatypeID])? ("kw3" ref3=[SingleCrossReference])? ("kw4" ref4=[SingleCrossReference])?
|
||||
// ("kw5" ref5=[SingleCrossReference])?;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//"#5" name=(TERMINAL_ID | ID) ("kw1" ref1=[SingleCrossReference|TERMINAL_ID])? ("kw2"
|
||||
//"#5" name=(TERMINAL_ID | ID | "kw5") ("kw1" ref1=[SingleCrossReference|TERMINAL_ID])? ("kw2"
|
||||
//ref2=[SingleCrossReference|DatatypeID])? ("kw3" ref3=[SingleCrossReference])? ("kw4" ref4=[SingleCrossReference])?
|
||||
//("kw5" ref5=[SingleCrossReference])?
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//"#5"
|
||||
public Keyword getNumberSignDigitFiveKeyword_0() { return cNumberSignDigitFiveKeyword_0; }
|
||||
|
||||
//name=(TERMINAL_ID | ID)
|
||||
//name=(TERMINAL_ID | ID | "kw5")
|
||||
public Assignment getNameAssignment_1() { return cNameAssignment_1; }
|
||||
|
||||
//(TERMINAL_ID | ID)
|
||||
//(TERMINAL_ID | ID | "kw5")
|
||||
public Alternatives getNameAlternatives_1_0() { return cNameAlternatives_1_0; }
|
||||
|
||||
//TERMINAL_ID
|
||||
|
@ -594,6 +602,9 @@ public class SyntacticSequencerTestLanguageGrammarAccess extends AbstractGrammar
|
|||
//ID
|
||||
public RuleCall getNameIDTerminalRuleCall_1_0_1() { return cNameIDTerminalRuleCall_1_0_1; }
|
||||
|
||||
//"kw5"
|
||||
public Keyword getNameKw5Keyword_1_0_2() { return cNameKw5Keyword_1_0_2; }
|
||||
|
||||
//("kw1" ref1=[SingleCrossReference|TERMINAL_ID])?
|
||||
public Group getGroup_2() { return cGroup_2; }
|
||||
|
||||
|
@ -653,6 +664,21 @@ public class SyntacticSequencerTestLanguageGrammarAccess extends AbstractGrammar
|
|||
|
||||
//ID
|
||||
public RuleCall getRef4SingleCrossReferenceIDTerminalRuleCall_5_1_0_1() { return cRef4SingleCrossReferenceIDTerminalRuleCall_5_1_0_1; }
|
||||
|
||||
//("kw5" ref5=[SingleCrossReference])?
|
||||
public Group getGroup_6() { return cGroup_6; }
|
||||
|
||||
//"kw5"
|
||||
public Keyword getKw5Keyword_6_0() { return cKw5Keyword_6_0; }
|
||||
|
||||
//ref5=[SingleCrossReference]
|
||||
public Assignment getRef5Assignment_6_1() { return cRef5Assignment_6_1; }
|
||||
|
||||
//[SingleCrossReference]
|
||||
public CrossReference getRef5SingleCrossReferenceCrossReference_6_1_0() { return cRef5SingleCrossReferenceCrossReference_6_1_0; }
|
||||
|
||||
//"kw5"
|
||||
public Keyword getRef5SingleCrossReferenceKw5Keyword_6_1_0_1() { return cRef5SingleCrossReferenceKw5Keyword_6_1_0_1; }
|
||||
}
|
||||
public class BooleanAlternativeElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.serializer.SyntacticSequencerTestLanguage.BooleanAlternative");
|
||||
|
@ -1454,8 +1480,9 @@ public class SyntacticSequencerTestLanguageGrammarAccess extends AbstractGrammar
|
|||
}
|
||||
|
||||
//SingleCrossReference:
|
||||
// "#5" name=(TERMINAL_ID | ID) ("kw1" ref1=[SingleCrossReference|TERMINAL_ID])? ("kw2"
|
||||
// ref2=[SingleCrossReference|DatatypeID])? ("kw3" ref3=[SingleCrossReference])? ("kw4" ref4=[SingleCrossReference])?;
|
||||
// "#5" name=(TERMINAL_ID | ID | "kw5") ("kw1" ref1=[SingleCrossReference|TERMINAL_ID])? ("kw2"
|
||||
// ref2=[SingleCrossReference|DatatypeID])? ("kw3" ref3=[SingleCrossReference])? ("kw4" ref4=[SingleCrossReference])?
|
||||
// ("kw5" ref5=[SingleCrossReference])?;
|
||||
public SingleCrossReferenceElements getSingleCrossReferenceAccess() {
|
||||
return pSingleCrossReference;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.eclipse.emf.ecore.EObject;
|
|||
* <li>{@link org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference#getRef2 <em>Ref2</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference#getRef3 <em>Ref3</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference#getRef4 <em>Ref4</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference#getRef5 <em>Ref5</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.serializer.syntacticsequencertest.SyntacticsequencertestPackage#getSingleCrossReference()
|
||||
|
@ -137,4 +138,26 @@ public interface SingleCrossReference extends EObject
|
|||
*/
|
||||
void setRef4(SingleCrossReference value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Ref5</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Ref5</em>' reference.
|
||||
* @see #setRef5(SingleCrossReference)
|
||||
* @see org.eclipse.xtext.serializer.syntacticsequencertest.SyntacticsequencertestPackage#getSingleCrossReference_Ref5()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
SingleCrossReference getRef5();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference#getRef5 <em>Ref5</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Ref5</em>' reference.
|
||||
* @see #getRef5()
|
||||
* @generated
|
||||
*/
|
||||
void setRef5(SingleCrossReference value);
|
||||
|
||||
} // SingleCrossReference
|
||||
|
|
|
@ -378,6 +378,15 @@ public interface SyntacticsequencertestPackage extends EPackage
|
|||
*/
|
||||
int SINGLE_CROSS_REFERENCE__REF4 = 4;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Ref5</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int SINGLE_CROSS_REFERENCE__REF5 = 5;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Single Cross Reference</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
|
@ -385,7 +394,7 @@ public interface SyntacticsequencertestPackage extends EPackage
|
|||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int SINGLE_CROSS_REFERENCE_FEATURE_COUNT = 5;
|
||||
int SINGLE_CROSS_REFERENCE_FEATURE_COUNT = 6;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.serializer.syntacticsequencertest.impl.BooleanAlternativeImpl <em>Boolean Alternative</em>}' class.
|
||||
|
@ -1379,6 +1388,17 @@ public interface SyntacticsequencertestPackage extends EPackage
|
|||
*/
|
||||
EReference getSingleCrossReference_Ref4();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the reference '{@link org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference#getRef5 <em>Ref5</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the reference '<em>Ref5</em>'.
|
||||
* @see org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference#getRef5()
|
||||
* @see #getSingleCrossReference()
|
||||
* @generated
|
||||
*/
|
||||
EReference getSingleCrossReference_Ref5();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.serializer.syntacticsequencertest.BooleanAlternative <em>Boolean Alternative</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
|
@ -2218,6 +2238,14 @@ public interface SyntacticsequencertestPackage extends EPackage
|
|||
*/
|
||||
EReference SINGLE_CROSS_REFERENCE__REF4 = eINSTANCE.getSingleCrossReference_Ref4();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Ref5</b></em>' reference feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference SINGLE_CROSS_REFERENCE__REF5 = eINSTANCE.getSingleCrossReference_Ref5();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.serializer.syntacticsequencertest.impl.BooleanAlternativeImpl <em>Boolean Alternative</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.xtext.serializer.syntacticsequencertest.Syntacticsequencertes
|
|||
* <li>{@link org.eclipse.xtext.serializer.syntacticsequencertest.impl.SingleCrossReferenceImpl#getRef2 <em>Ref2</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.serializer.syntacticsequencertest.impl.SingleCrossReferenceImpl#getRef3 <em>Ref3</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.serializer.syntacticsequencertest.impl.SingleCrossReferenceImpl#getRef4 <em>Ref4</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.serializer.syntacticsequencertest.impl.SingleCrossReferenceImpl#getRef5 <em>Ref5</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
|
@ -93,6 +94,16 @@ public class SingleCrossReferenceImpl extends MinimalEObjectImpl.Container imple
|
|||
*/
|
||||
protected SingleCrossReference ref4;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getRef5() <em>Ref5</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getRef5()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected SingleCrossReference ref5;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
|
@ -319,6 +330,51 @@ public class SingleCrossReferenceImpl extends MinimalEObjectImpl.Container imple
|
|||
eNotify(new ENotificationImpl(this, Notification.SET, SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF4, oldRef4, ref4));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public SingleCrossReference getRef5()
|
||||
{
|
||||
if (ref5 != null && ref5.eIsProxy())
|
||||
{
|
||||
InternalEObject oldRef5 = (InternalEObject)ref5;
|
||||
ref5 = (SingleCrossReference)eResolveProxy(oldRef5);
|
||||
if (ref5 != oldRef5)
|
||||
{
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF5, oldRef5, ref5));
|
||||
}
|
||||
}
|
||||
return ref5;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SingleCrossReference basicGetRef5()
|
||||
{
|
||||
return ref5;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void setRef5(SingleCrossReference newRef5)
|
||||
{
|
||||
SingleCrossReference oldRef5 = ref5;
|
||||
ref5 = newRef5;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF5, oldRef5, ref5));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
|
@ -343,6 +399,9 @@ public class SingleCrossReferenceImpl extends MinimalEObjectImpl.Container imple
|
|||
case SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF4:
|
||||
if (resolve) return getRef4();
|
||||
return basicGetRef4();
|
||||
case SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF5:
|
||||
if (resolve) return getRef5();
|
||||
return basicGetRef5();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
@ -372,6 +431,9 @@ public class SingleCrossReferenceImpl extends MinimalEObjectImpl.Container imple
|
|||
case SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF4:
|
||||
setRef4((SingleCrossReference)newValue);
|
||||
return;
|
||||
case SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF5:
|
||||
setRef5((SingleCrossReference)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
@ -401,6 +463,9 @@ public class SingleCrossReferenceImpl extends MinimalEObjectImpl.Container imple
|
|||
case SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF4:
|
||||
setRef4((SingleCrossReference)null);
|
||||
return;
|
||||
case SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF5:
|
||||
setRef5((SingleCrossReference)null);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
@ -425,6 +490,8 @@ public class SingleCrossReferenceImpl extends MinimalEObjectImpl.Container imple
|
|||
return ref3 != null;
|
||||
case SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF4:
|
||||
return ref4 != null;
|
||||
case SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF5:
|
||||
return ref5 != null;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
|
|
@ -618,6 +618,17 @@ public class SyntacticsequencertestPackageImpl extends EPackageImpl implements S
|
|||
return (EReference)singleCrossReferenceEClass.getEStructuralFeatures().get(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EReference getSingleCrossReference_Ref5()
|
||||
{
|
||||
return (EReference)singleCrossReferenceEClass.getEStructuralFeatures().get(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
|
@ -1267,6 +1278,7 @@ public class SyntacticsequencertestPackageImpl extends EPackageImpl implements S
|
|||
createEReference(singleCrossReferenceEClass, SINGLE_CROSS_REFERENCE__REF2);
|
||||
createEReference(singleCrossReferenceEClass, SINGLE_CROSS_REFERENCE__REF3);
|
||||
createEReference(singleCrossReferenceEClass, SINGLE_CROSS_REFERENCE__REF4);
|
||||
createEReference(singleCrossReferenceEClass, SINGLE_CROSS_REFERENCE__REF5);
|
||||
|
||||
booleanAlternativeEClass = createEClass(BOOLEAN_ALTERNATIVE);
|
||||
createEReference(booleanAlternativeEClass, BOOLEAN_ALTERNATIVE__BOOL);
|
||||
|
@ -1417,6 +1429,7 @@ public class SyntacticsequencertestPackageImpl extends EPackageImpl implements S
|
|||
initEReference(getSingleCrossReference_Ref2(), this.getSingleCrossReference(), null, "ref2", null, 0, 1, SingleCrossReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getSingleCrossReference_Ref3(), this.getSingleCrossReference(), null, "ref3", null, 0, 1, SingleCrossReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getSingleCrossReference_Ref4(), this.getSingleCrossReference(), null, "ref4", null, 0, 1, SingleCrossReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getSingleCrossReference_Ref5(), this.getSingleCrossReference(), null, "ref5", null, 0, 1, SingleCrossReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(booleanAlternativeEClass, BooleanAlternative.class, "BooleanAlternative", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getBooleanAlternative_Bool(), this.getBooleanAlternativeLiteral(), null, "bool", null, 0, 1, BooleanAlternative.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
|
|
@ -303,6 +303,16 @@ public class SyntacticSequencerTest extends AbstractXtextTests {
|
|||
public void testCrossRef1_d() throws Exception {
|
||||
testSequence("#5 someid kw4 someid");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCrossRef1_e_1() throws Exception {
|
||||
testSequence("#5 ^kw5 kw5 kw5");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCrossRef1_e_2() throws Exception {
|
||||
testSequence("#5 kw5 kw5 kw5");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBooleanAlternative_a() throws Exception {
|
||||
|
|
|
@ -56,11 +56,12 @@ DatatypeID:
|
|||
ID;
|
||||
|
||||
SingleCrossReference:
|
||||
"#5" name=(TERMINAL_ID | ID)
|
||||
"#5" name=(TERMINAL_ID | ID | "kw5")
|
||||
("kw1" ref1=[SingleCrossReference|TERMINAL_ID])?
|
||||
("kw2" ref2=[SingleCrossReference|DatatypeID])?
|
||||
("kw3" ref3=[SingleCrossReference|ID])?
|
||||
("kw4" ref4=[SingleCrossReference])?;
|
||||
("kw4" ref4=[SingleCrossReference])?
|
||||
("kw5" ref5=[SingleCrossReference|"kw5"])?;
|
||||
|
||||
BooleanAlternative:
|
||||
"#6" bool=BooleanAlternativeLiteral;
|
||||
|
|
|
@ -338,7 +338,7 @@ abstract class AbstractAntlrGrammarGenerator {
|
|||
'''
|
||||
|
||||
protected dispatch def String dataTypeEbnf2(Keyword it, boolean supportActions) {
|
||||
if (combinedGrammar) "'" + value.toAntlrString + "'" else keywordHelper.getRuleName(value)
|
||||
it.ebnf
|
||||
}
|
||||
|
||||
protected dispatch def String dataTypeEbnf2(RuleCall it, boolean supportActions) {
|
||||
|
@ -367,8 +367,12 @@ abstract class AbstractAntlrGrammarGenerator {
|
|||
''
|
||||
}
|
||||
|
||||
protected def String ebnf(Keyword it) {
|
||||
if (combinedGrammar) "'" + value.toAntlrString + "'" else keywordHelper.getRuleName(value)
|
||||
}
|
||||
|
||||
protected dispatch def String ebnf2(Keyword it, AntlrOptions options, boolean supportActions) {
|
||||
if (combinedGrammar) "'" + value.toAntlrString + "'" else keywordHelper.getRuleName(value)
|
||||
it.ebnf
|
||||
}
|
||||
|
||||
protected dispatch def String ebnf2(RuleCall it, AntlrOptions options, boolean supportActions) {
|
||||
|
@ -397,6 +401,10 @@ abstract class AbstractAntlrGrammarGenerator {
|
|||
rule.crossrefEbnf(it, ref, supportActions)
|
||||
}
|
||||
|
||||
protected dispatch def String crossrefEbnf(Keyword it, CrossReference ref, boolean supportActions) {
|
||||
it.ebnf
|
||||
}
|
||||
|
||||
protected def String crossrefEbnf(AbstractRule it, RuleCall call, CrossReference ref, boolean supportActions) {
|
||||
switch it {
|
||||
EnumRule,
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.eclipse.xtext.UnorderedGroup
|
|||
|
||||
import static extension org.eclipse.xtext.GrammarUtil.*
|
||||
import static extension org.eclipse.xtext.xtext.generator.parser.antlr.AntlrGrammarGenUtil.*
|
||||
import org.eclipse.xtext.Keyword
|
||||
|
||||
class AntlrContentAssistGrammarGenerator extends AbstractAntlrGrammarWithActionsGenerator {
|
||||
@Inject
|
||||
|
@ -378,6 +379,14 @@ class AntlrContentAssistGrammarGenerator extends AbstractAntlrGrammarWithActions
|
|||
{ after(grammarAccess.«originalElement.grammarElementAccess»); }
|
||||
)
|
||||
'''
|
||||
|
||||
protected dispatch override crossrefEbnf(Keyword it, CrossReference ref, boolean supportActions) '''
|
||||
(
|
||||
{ before(grammarAccess.«originalElement.grammarElementAccess»); }
|
||||
«super._crossrefEbnf(it, ref, supportActions)»
|
||||
{ after(grammarAccess.«originalElement.grammarElementAccess»); }
|
||||
)
|
||||
'''
|
||||
|
||||
protected dispatch def crossrefEbnf(TerminalRule it, RuleCall call, CrossReference ref, boolean supportActions) {
|
||||
ruleName
|
||||
|
|
|
@ -331,6 +331,17 @@ class AntlrGrammarGenerator extends AbstractAntlrGrammarWithActionsGenerator {
|
|||
super.crossrefEbnf(it, call, ref, supportActions)
|
||||
}
|
||||
|
||||
override protected _crossrefEbnf(Keyword it, CrossReference ref, boolean supportActions) {
|
||||
if (!supportActions)
|
||||
super._crossrefEbnf(it, ref, supportActions)
|
||||
else '''
|
||||
«ref.containingAssignment.localVar»=«super._crossrefEbnf(it, ref, supportActions)»
|
||||
{
|
||||
«ref.newLeafNode(ref.containingAssignment.localVar)»
|
||||
}
|
||||
'''
|
||||
}
|
||||
|
||||
override protected _assignmentEbnf(CrossReference it, Assignment assignment, AntlrOptions options, boolean supportActions) {
|
||||
if (supportActions) '''
|
||||
«IF options.backtrack»
|
||||
|
|
|
@ -844,16 +844,7 @@ public abstract class AbstractAntlrGrammarGenerator {
|
|||
}
|
||||
|
||||
protected String _dataTypeEbnf2(final Keyword it, final boolean supportActions) {
|
||||
String _xifexpression = null;
|
||||
boolean _isCombinedGrammar = this.isCombinedGrammar();
|
||||
if (_isCombinedGrammar) {
|
||||
String _antlrString = AntlrGrammarGenUtil.toAntlrString(it.getValue());
|
||||
String _plus = ("\'" + _antlrString);
|
||||
_xifexpression = (_plus + "\'");
|
||||
} else {
|
||||
_xifexpression = this.keywordHelper.getRuleName(it.getValue());
|
||||
}
|
||||
return _xifexpression;
|
||||
return this.ebnf(it);
|
||||
}
|
||||
|
||||
protected String _dataTypeEbnf2(final RuleCall it, final boolean supportActions) {
|
||||
|
@ -934,7 +925,7 @@ public abstract class AbstractAntlrGrammarGenerator {
|
|||
return "";
|
||||
}
|
||||
|
||||
protected String _ebnf2(final Keyword it, final AntlrOptions options, final boolean supportActions) {
|
||||
protected String ebnf(final Keyword it) {
|
||||
String _xifexpression = null;
|
||||
boolean _isCombinedGrammar = this.isCombinedGrammar();
|
||||
if (_isCombinedGrammar) {
|
||||
|
@ -947,6 +938,10 @@ public abstract class AbstractAntlrGrammarGenerator {
|
|||
return _xifexpression;
|
||||
}
|
||||
|
||||
protected String _ebnf2(final Keyword it, final AntlrOptions options, final boolean supportActions) {
|
||||
return this.ebnf(it);
|
||||
}
|
||||
|
||||
protected String _ebnf2(final RuleCall it, final AntlrOptions options, final boolean supportActions) {
|
||||
return this._grammarAccessExtensions.ruleName(it.getRule());
|
||||
}
|
||||
|
@ -1004,6 +999,10 @@ public abstract class AbstractAntlrGrammarGenerator {
|
|||
return _xblockexpression;
|
||||
}
|
||||
|
||||
protected String _crossrefEbnf(final Keyword it, final CrossReference ref, final boolean supportActions) {
|
||||
return this.ebnf(it);
|
||||
}
|
||||
|
||||
protected String crossrefEbnf(final AbstractRule it, final RuleCall call, final CrossReference ref, final boolean supportActions) {
|
||||
String _switchResult = null;
|
||||
boolean _matched = false;
|
||||
|
@ -1173,6 +1172,8 @@ public abstract class AbstractAntlrGrammarGenerator {
|
|||
protected String crossrefEbnf(final AbstractElement it, final CrossReference ref, final boolean supportActions) {
|
||||
if (it instanceof Alternatives) {
|
||||
return _crossrefEbnf((Alternatives)it, ref, supportActions);
|
||||
} else if (it instanceof Keyword) {
|
||||
return _crossrefEbnf((Keyword)it, ref, supportActions);
|
||||
} else if (it instanceof RuleCall) {
|
||||
return _crossrefEbnf((RuleCall)it, ref, supportActions);
|
||||
} else if (it != null) {
|
||||
|
|
|
@ -1208,6 +1208,32 @@ public class AntlrContentAssistGrammarGenerator extends AbstractAntlrGrammarWith
|
|||
return _builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _crossrefEbnf(final Keyword it, final CrossReference ref, final boolean supportActions) {
|
||||
StringConcatenation _builder = new StringConcatenation();
|
||||
_builder.append("(");
|
||||
_builder.newLine();
|
||||
_builder.append("\t");
|
||||
_builder.append("{ before(grammarAccess.");
|
||||
String _grammarElementAccess = this._grammarAccessExtensions.grammarElementAccess(AntlrGrammarGenUtil.<Keyword>getOriginalElement(it));
|
||||
_builder.append(_grammarElementAccess, "\t");
|
||||
_builder.append("); }");
|
||||
_builder.newLineIfNotEmpty();
|
||||
_builder.append("\t");
|
||||
String __crossrefEbnf = super._crossrefEbnf(it, ref, supportActions);
|
||||
_builder.append(__crossrefEbnf, "\t");
|
||||
_builder.newLineIfNotEmpty();
|
||||
_builder.append("\t");
|
||||
_builder.append("{ after(grammarAccess.");
|
||||
String _grammarElementAccess_1 = this._grammarAccessExtensions.grammarElementAccess(AntlrGrammarGenUtil.<Keyword>getOriginalElement(it));
|
||||
_builder.append(_grammarElementAccess_1, "\t");
|
||||
_builder.append("); }");
|
||||
_builder.newLineIfNotEmpty();
|
||||
_builder.append(")");
|
||||
_builder.newLine();
|
||||
return _builder.toString();
|
||||
}
|
||||
|
||||
protected String _crossrefEbnf(final TerminalRule it, final RuleCall call, final CrossReference ref, final boolean supportActions) {
|
||||
return this._grammarAccessExtensions.ruleName(it);
|
||||
}
|
||||
|
@ -1331,6 +1357,8 @@ public class AntlrContentAssistGrammarGenerator extends AbstractAntlrGrammarWith
|
|||
protected String crossrefEbnf(final AbstractElement it, final CrossReference ref, final boolean supportActions) {
|
||||
if (it instanceof Alternatives) {
|
||||
return _crossrefEbnf((Alternatives)it, ref, supportActions);
|
||||
} else if (it instanceof Keyword) {
|
||||
return _crossrefEbnf((Keyword)it, ref, supportActions);
|
||||
} else if (it instanceof RuleCall) {
|
||||
return _crossrefEbnf((RuleCall)it, ref, supportActions);
|
||||
} else if (it != null) {
|
||||
|
|
|
@ -899,6 +899,32 @@ public class AntlrGrammarGenerator extends AbstractAntlrGrammarWithActionsGenera
|
|||
return _xifexpression;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _crossrefEbnf(final Keyword it, final CrossReference ref, final boolean supportActions) {
|
||||
String _xifexpression = null;
|
||||
if ((!supportActions)) {
|
||||
_xifexpression = super._crossrefEbnf(it, ref, supportActions);
|
||||
} else {
|
||||
StringConcatenation _builder = new StringConcatenation();
|
||||
String _localVar = this._grammarAccessExtensions.localVar(GrammarUtil.containingAssignment(ref));
|
||||
_builder.append(_localVar);
|
||||
_builder.append("=");
|
||||
String __crossrefEbnf = super._crossrefEbnf(it, ref, supportActions);
|
||||
_builder.append(__crossrefEbnf);
|
||||
_builder.newLineIfNotEmpty();
|
||||
_builder.append("{");
|
||||
_builder.newLine();
|
||||
_builder.append("\t");
|
||||
CharSequence _newLeafNode = this.newLeafNode(ref, this._grammarAccessExtensions.localVar(GrammarUtil.containingAssignment(ref)));
|
||||
_builder.append(_newLeafNode, "\t");
|
||||
_builder.newLineIfNotEmpty();
|
||||
_builder.append("}");
|
||||
_builder.newLine();
|
||||
_xifexpression = _builder.toString();
|
||||
}
|
||||
return _xifexpression;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _assignmentEbnf(final CrossReference it, final Assignment assignment, final AntlrOptions options, final boolean supportActions) {
|
||||
String _xifexpression = null;
|
||||
|
|
Loading…
Reference in a new issue