added grammar init block to model and xtext grammar

This commit is contained in:
overflowerror 2021-11-23 15:35:23 +01:00
parent a1db3fe348
commit 69b5babb91
26 changed files with 8126 additions and 6691 deletions

View file

@ -62,6 +62,7 @@ public class XtextParser extends AbstractContentAssistParser {
builder.put(grammarAccess.getGrammarAccess().getGroup_3(), "rule__Grammar__Group_3__0");
builder.put(grammarAccess.getGrammarAccess().getGroup_3_2(), "rule__Grammar__Group_3_2__0");
builder.put(grammarAccess.getGrammarAccess().getGroup_3_2_1(), "rule__Grammar__Group_3_2_1__0");
builder.put(grammarAccess.getInitBlockAccess().getGroup(), "rule__InitBlock__Group__0");
builder.put(grammarAccess.getGrammarIDAccess().getGroup(), "rule__GrammarID__Group__0");
builder.put(grammarAccess.getGrammarIDAccess().getGroup_1(), "rule__GrammarID__Group_1__0");
builder.put(grammarAccess.getGeneratedMetamodelAccess().getGroup(), "rule__GeneratedMetamodel__Group__0");
@ -154,7 +155,9 @@ public class XtextParser extends AbstractContentAssistParser {
builder.put(grammarAccess.getGrammarAccess().getHiddenTokensAssignment_3_2_0(), "rule__Grammar__HiddenTokensAssignment_3_2_0");
builder.put(grammarAccess.getGrammarAccess().getHiddenTokensAssignment_3_2_1_1(), "rule__Grammar__HiddenTokensAssignment_3_2_1_1");
builder.put(grammarAccess.getGrammarAccess().getMetamodelDeclarationsAssignment_4(), "rule__Grammar__MetamodelDeclarationsAssignment_4");
builder.put(grammarAccess.getGrammarAccess().getRulesAssignment_5(), "rule__Grammar__RulesAssignment_5");
builder.put(grammarAccess.getGrammarAccess().getInitBlockAssignment_5(), "rule__Grammar__InitBlockAssignment_5");
builder.put(grammarAccess.getGrammarAccess().getRulesAssignment_6(), "rule__Grammar__RulesAssignment_6");
builder.put(grammarAccess.getInitBlockAccess().getCodeAssignment_1(), "rule__InitBlock__CodeAssignment_1");
builder.put(grammarAccess.getGeneratedMetamodelAccess().getNameAssignment_1(), "rule__GeneratedMetamodel__NameAssignment_1");
builder.put(grammarAccess.getGeneratedMetamodelAccess().getEPackageAssignment_2(), "rule__GeneratedMetamodel__EPackageAssignment_2");
builder.put(grammarAccess.getGeneratedMetamodelAccess().getAliasAssignment_3_1(), "rule__GeneratedMetamodel__AliasAssignment_3_1");

View file

@ -74,6 +74,31 @@ finally {
restoreStackSize(stackSize);
}
// Entry rule entryRuleInitBlock
entryRuleInitBlock
:
{ before(grammarAccess.getInitBlockRule()); }
ruleInitBlock
{ after(grammarAccess.getInitBlockRule()); }
EOF
;
// Rule InitBlock
ruleInitBlock
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getInitBlockAccess().getGroup()); }
(rule__InitBlock__Group__0)
{ after(grammarAccess.getInitBlockAccess().getGroup()); }
)
;
finally {
restoreStackSize(stackSize);
}
// Entry rule entryRuleGrammarID
entryRuleGrammarID
:
@ -2340,6 +2365,7 @@ rule__Grammar__Group__5
}
:
rule__Grammar__Group__5__Impl
rule__Grammar__Group__6
;
finally {
restoreStackSize(stackSize);
@ -2350,16 +2376,42 @@ rule__Grammar__Group__5__Impl
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getGrammarAccess().getInitBlockAssignment_5()); }
(rule__Grammar__InitBlockAssignment_5)?
{ after(grammarAccess.getGrammarAccess().getInitBlockAssignment_5()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__Grammar__Group__6
@init {
int stackSize = keepStackSize();
}
:
rule__Grammar__Group__6__Impl
;
finally {
restoreStackSize(stackSize);
}
rule__Grammar__Group__6__Impl
@init {
int stackSize = keepStackSize();
}
:
(
(
{ before(grammarAccess.getGrammarAccess().getRulesAssignment_5()); }
(rule__Grammar__RulesAssignment_5)
{ after(grammarAccess.getGrammarAccess().getRulesAssignment_5()); }
{ before(grammarAccess.getGrammarAccess().getRulesAssignment_6()); }
(rule__Grammar__RulesAssignment_6)
{ after(grammarAccess.getGrammarAccess().getRulesAssignment_6()); }
)
(
{ before(grammarAccess.getGrammarAccess().getRulesAssignment_5()); }
(rule__Grammar__RulesAssignment_5)*
{ after(grammarAccess.getGrammarAccess().getRulesAssignment_5()); }
{ before(grammarAccess.getGrammarAccess().getRulesAssignment_6()); }
(rule__Grammar__RulesAssignment_6)*
{ after(grammarAccess.getGrammarAccess().getRulesAssignment_6()); }
)
)
;
@ -2719,6 +2771,60 @@ finally {
}
rule__InitBlock__Group__0
@init {
int stackSize = keepStackSize();
}
:
rule__InitBlock__Group__0__Impl
rule__InitBlock__Group__1
;
finally {
restoreStackSize(stackSize);
}
rule__InitBlock__Group__0__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getInitBlockAccess().getInitKeyword_0()); }
'@init'
{ after(grammarAccess.getInitBlockAccess().getInitKeyword_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__InitBlock__Group__1
@init {
int stackSize = keepStackSize();
}
:
rule__InitBlock__Group__1__Impl
;
finally {
restoreStackSize(stackSize);
}
rule__InitBlock__Group__1__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getInitBlockAccess().getCodeAssignment_1()); }
(rule__InitBlock__CodeAssignment_1)
{ after(grammarAccess.getInitBlockAccess().getCodeAssignment_1()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__GrammarID__Group__0
@init {
int stackSize = keepStackSize();
@ -8732,15 +8838,45 @@ finally {
restoreStackSize(stackSize);
}
rule__Grammar__RulesAssignment_5
rule__Grammar__InitBlockAssignment_5
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getGrammarAccess().getRulesAbstractRuleParserRuleCall_5_0()); }
{ before(grammarAccess.getGrammarAccess().getInitBlockInitBlockParserRuleCall_5_0()); }
ruleInitBlock
{ after(grammarAccess.getGrammarAccess().getInitBlockInitBlockParserRuleCall_5_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__Grammar__RulesAssignment_6
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getGrammarAccess().getRulesAbstractRuleParserRuleCall_6_0()); }
ruleAbstractRule
{ after(grammarAccess.getGrammarAccess().getRulesAbstractRuleParserRuleCall_5_0()); }
{ after(grammarAccess.getGrammarAccess().getRulesAbstractRuleParserRuleCall_6_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__InitBlock__CodeAssignment_1
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getInitBlockAccess().getCodeJavaCodeParserRuleCall_1_0()); }
ruleJavaCode
{ after(grammarAccess.getInitBlockAccess().getCodeJavaCodeParserRuleCall_1_0()); }
)
;
finally {

View file

@ -1,44 +1,45 @@
'!'=42
'&'=37
'!'=43
'&'=38
'('=23
')'=24
'*'=13
'+'=14
'+='=16
','=22
'->'=46
'.'=25
'..'=48
':'=30
'::'=35
';'=31
'<'=33
'->'=47
'.'=26
'..'=49
':'=31
'::'=36
';'=32
'<'=34
'='=15
'=>'=52
'>'=34
'=>'=53
'>'=35
'?'=12
'?='=19
'?=>'=38
'@'=29
'EOF'=47
'['=43
']'=44
'as'=27
'current'=41
'enum'=49
'?=>'=39
'@'=30
'@init'=25
'EOF'=48
'['=44
']'=45
'as'=28
'current'=42
'enum'=50
'false'=17
'fragment'=51
'generate'=26
'fragment'=52
'generate'=27
'grammar'=20
'hidden'=50
'import'=28
'returns'=32
'terminal'=45
'hidden'=51
'import'=29
'returns'=33
'terminal'=46
'true'=18
'with'=21
'{'=39
'|'=36
'}'=40
'{'=40
'|'=37
'}'=41
RULE_ANY_OTHER=11
RULE_ID=4
RULE_INT=7
@ -88,3 +89,4 @@ T__49=49
T__50=50
T__51=51
T__52=52
T__53=53

View file

@ -23,6 +23,7 @@ public class InternalXtextLexer extends Lexer {
public static final int T__14=14;
public static final int T__51=51;
public static final int T__52=52;
public static final int T__53=53;
public static final int RULE_ID=4;
public static final int T__26=26;
public static final int T__27=27;
@ -347,10 +348,11 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__25;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:24:7: ( '.' )
// InternalXtext.g:24:9: '.'
// InternalXtext.g:24:7: ( '@init' )
// InternalXtext.g:24:9: '@init'
{
match('.');
match("@init");
}
@ -367,11 +369,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__26;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:25:7: ( 'generate' )
// InternalXtext.g:25:9: 'generate'
// InternalXtext.g:25:7: ( '.' )
// InternalXtext.g:25:9: '.'
{
match("generate");
match('.');
}
@ -388,10 +389,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__27;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:26:7: ( 'as' )
// InternalXtext.g:26:9: 'as'
// InternalXtext.g:26:7: ( 'generate' )
// InternalXtext.g:26:9: 'generate'
{
match("as");
match("generate");
}
@ -409,10 +410,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__28;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:27:7: ( 'import' )
// InternalXtext.g:27:9: 'import'
// InternalXtext.g:27:7: ( 'as' )
// InternalXtext.g:27:9: 'as'
{
match("import");
match("as");
}
@ -430,10 +431,11 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__29;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:28:7: ( '@' )
// InternalXtext.g:28:9: '@'
// InternalXtext.g:28:7: ( 'import' )
// InternalXtext.g:28:9: 'import'
{
match('@');
match("import");
}
@ -450,10 +452,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__30;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:29:7: ( ':' )
// InternalXtext.g:29:9: ':'
// InternalXtext.g:29:7: ( '@' )
// InternalXtext.g:29:9: '@'
{
match(':');
match('@');
}
@ -470,10 +472,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__31;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:30:7: ( ';' )
// InternalXtext.g:30:9: ';'
// InternalXtext.g:30:7: ( ':' )
// InternalXtext.g:30:9: ':'
{
match(';');
match(':');
}
@ -490,11 +492,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__32;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:31:7: ( 'returns' )
// InternalXtext.g:31:9: 'returns'
// InternalXtext.g:31:7: ( ';' )
// InternalXtext.g:31:9: ';'
{
match("returns");
match(';');
}
@ -511,10 +512,11 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__33;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:32:7: ( '<' )
// InternalXtext.g:32:9: '<'
// InternalXtext.g:32:7: ( 'returns' )
// InternalXtext.g:32:9: 'returns'
{
match('<');
match("returns");
}
@ -531,10 +533,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__34;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:33:7: ( '>' )
// InternalXtext.g:33:9: '>'
// InternalXtext.g:33:7: ( '<' )
// InternalXtext.g:33:9: '<'
{
match('>');
match('<');
}
@ -551,11 +553,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__35;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:34:7: ( '::' )
// InternalXtext.g:34:9: '::'
// InternalXtext.g:34:7: ( '>' )
// InternalXtext.g:34:9: '>'
{
match("::");
match('>');
}
@ -572,10 +573,11 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__36;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:35:7: ( '|' )
// InternalXtext.g:35:9: '|'
// InternalXtext.g:35:7: ( '::' )
// InternalXtext.g:35:9: '::'
{
match('|');
match("::");
}
@ -592,10 +594,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__37;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:36:7: ( '&' )
// InternalXtext.g:36:9: '&'
// InternalXtext.g:36:7: ( '|' )
// InternalXtext.g:36:9: '|'
{
match('&');
match('|');
}
@ -612,11 +614,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__38;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:37:7: ( '?=>' )
// InternalXtext.g:37:9: '?=>'
// InternalXtext.g:37:7: ( '&' )
// InternalXtext.g:37:9: '&'
{
match("?=>");
match('&');
}
@ -633,10 +634,11 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__39;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:38:7: ( '{' )
// InternalXtext.g:38:9: '{'
// InternalXtext.g:38:7: ( '?=>' )
// InternalXtext.g:38:9: '?=>'
{
match('{');
match("?=>");
}
@ -653,10 +655,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__40;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:39:7: ( '}' )
// InternalXtext.g:39:9: '}'
// InternalXtext.g:39:7: ( '{' )
// InternalXtext.g:39:9: '{'
{
match('}');
match('{');
}
@ -673,11 +675,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__41;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:40:7: ( 'current' )
// InternalXtext.g:40:9: 'current'
// InternalXtext.g:40:7: ( '}' )
// InternalXtext.g:40:9: '}'
{
match("current");
match('}');
}
@ -694,10 +695,11 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__42;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:41:7: ( '!' )
// InternalXtext.g:41:9: '!'
// InternalXtext.g:41:7: ( 'current' )
// InternalXtext.g:41:9: 'current'
{
match('!');
match("current");
}
@ -714,10 +716,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__43;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:42:7: ( '[' )
// InternalXtext.g:42:9: '['
// InternalXtext.g:42:7: ( '!' )
// InternalXtext.g:42:9: '!'
{
match('[');
match('!');
}
@ -734,10 +736,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__44;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:43:7: ( ']' )
// InternalXtext.g:43:9: ']'
// InternalXtext.g:43:7: ( '[' )
// InternalXtext.g:43:9: '['
{
match(']');
match('[');
}
@ -754,11 +756,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__45;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:44:7: ( 'terminal' )
// InternalXtext.g:44:9: 'terminal'
// InternalXtext.g:44:7: ( ']' )
// InternalXtext.g:44:9: ']'
{
match("terminal");
match(']');
}
@ -775,10 +776,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__46;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:45:7: ( '->' )
// InternalXtext.g:45:9: '->'
// InternalXtext.g:45:7: ( 'terminal' )
// InternalXtext.g:45:9: 'terminal'
{
match("->");
match("terminal");
}
@ -796,10 +797,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__47;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:46:7: ( 'EOF' )
// InternalXtext.g:46:9: 'EOF'
// InternalXtext.g:46:7: ( '->' )
// InternalXtext.g:46:9: '->'
{
match("EOF");
match("->");
}
@ -817,10 +818,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__48;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:47:7: ( '..' )
// InternalXtext.g:47:9: '..'
// InternalXtext.g:47:7: ( 'EOF' )
// InternalXtext.g:47:9: 'EOF'
{
match("..");
match("EOF");
}
@ -838,10 +839,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__49;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:48:7: ( 'enum' )
// InternalXtext.g:48:9: 'enum'
// InternalXtext.g:48:7: ( '..' )
// InternalXtext.g:48:9: '..'
{
match("enum");
match("..");
}
@ -859,10 +860,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__50;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:49:7: ( 'hidden' )
// InternalXtext.g:49:9: 'hidden'
// InternalXtext.g:49:7: ( 'enum' )
// InternalXtext.g:49:9: 'enum'
{
match("hidden");
match("enum");
}
@ -880,10 +881,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__51;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:50:7: ( 'fragment' )
// InternalXtext.g:50:9: 'fragment'
// InternalXtext.g:50:7: ( 'hidden' )
// InternalXtext.g:50:9: 'hidden'
{
match("fragment");
match("hidden");
}
@ -901,10 +902,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = T__52;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:51:7: ( '=>' )
// InternalXtext.g:51:9: '=>'
// InternalXtext.g:51:7: ( 'fragment' )
// InternalXtext.g:51:9: 'fragment'
{
match("=>");
match("fragment");
}
@ -917,17 +918,38 @@ public class InternalXtextLexer extends Lexer {
}
// $ANTLR end "T__52"
// $ANTLR start "T__53"
public final void mT__53() throws RecognitionException {
try {
int _type = T__53;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:52:7: ( '=>' )
// InternalXtext.g:52:9: '=>'
{
match("=>");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__53"
// $ANTLR start "RULE_JAVACODESTRING"
public final void mRULE_JAVACODESTRING() throws RecognitionException {
try {
int _type = RULE_JAVACODESTRING;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10114:21: ( '$$' ( options {greedy=false; } : . )* '$$' )
// InternalXtext.g:10114:23: '$$' ( options {greedy=false; } : . )* '$$'
// InternalXtext.g:10250:21: ( '$$' ( options {greedy=false; } : . )* '$$' )
// InternalXtext.g:10250:23: '$$' ( options {greedy=false; } : . )* '$$'
{
match("$$");
// InternalXtext.g:10114:28: ( options {greedy=false; } : . )*
// InternalXtext.g:10250:28: ( options {greedy=false; } : . )*
loop1:
do {
int alt1=2;
@ -952,7 +974,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt1) {
case 1 :
// InternalXtext.g:10114:56: .
// InternalXtext.g:10250:56: .
{
matchAny();
@ -982,10 +1004,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10116:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalXtext.g:10116:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
// 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:10116:11: ( '^' )?
// InternalXtext.g:10252:11: ( '^' )?
int alt2=2;
int LA2_0 = input.LA(1);
@ -994,7 +1016,7 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt2) {
case 1 :
// InternalXtext.g:10116:11: '^'
// InternalXtext.g:10252:11: '^'
{
match('^');
@ -1012,7 +1034,7 @@ public class InternalXtextLexer extends Lexer {
recover(mse);
throw mse;}
// InternalXtext.g:10116:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
// InternalXtext.g:10252:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
loop3:
do {
int alt3=2;
@ -1061,10 +1083,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_INT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10118:10: ( ( '0' .. '9' )+ )
// InternalXtext.g:10118:12: ( '0' .. '9' )+
// InternalXtext.g:10254:10: ( ( '0' .. '9' )+ )
// InternalXtext.g:10254:12: ( '0' .. '9' )+
{
// InternalXtext.g:10118:12: ( '0' .. '9' )+
// InternalXtext.g:10254:12: ( '0' .. '9' )+
int cnt4=0;
loop4:
do {
@ -1078,7 +1100,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt4) {
case 1 :
// InternalXtext.g:10118:13: '0' .. '9'
// InternalXtext.g:10254:13: '0' .. '9'
{
matchRange('0','9');
@ -1110,10 +1132,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_STRING;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10120:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalXtext.g:10120:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
// InternalXtext.g:10256:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalXtext.g:10256:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{
// InternalXtext.g:10120:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
// InternalXtext.g:10256:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
int alt7=2;
int LA7_0 = input.LA(1);
@ -1131,10 +1153,10 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt7) {
case 1 :
// InternalXtext.g:10120:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
// InternalXtext.g:10256:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{
match('\"');
// InternalXtext.g:10120:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
// InternalXtext.g:10256:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
loop5:
do {
int alt5=3;
@ -1150,7 +1172,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt5) {
case 1 :
// InternalXtext.g:10120:21: '\\\\' .
// InternalXtext.g:10256:21: '\\\\' .
{
match('\\');
matchAny();
@ -1158,7 +1180,7 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:10120:28: ~ ( ( '\\\\' | '\"' ) )
// InternalXtext.g:10256:28: ~ ( ( '\\\\' | '\"' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
@ -1183,10 +1205,10 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:10120:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
// InternalXtext.g:10256:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{
match('\'');
// InternalXtext.g:10120:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
// InternalXtext.g:10256:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
loop6:
do {
int alt6=3;
@ -1202,7 +1224,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt6) {
case 1 :
// InternalXtext.g:10120:54: '\\\\' .
// InternalXtext.g:10256:54: '\\\\' .
{
match('\\');
matchAny();
@ -1210,7 +1232,7 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 2 :
// InternalXtext.g:10120:61: ~ ( ( '\\\\' | '\\'' ) )
// InternalXtext.g:10256:61: ~ ( ( '\\\\' | '\\'' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
@ -1253,12 +1275,12 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ML_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10122:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalXtext.g:10122:19: '/*' ( options {greedy=false; } : . )* '*/'
// InternalXtext.g:10258:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalXtext.g:10258:19: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");
// InternalXtext.g:10122:24: ( options {greedy=false; } : . )*
// InternalXtext.g:10258:24: ( options {greedy=false; } : . )*
loop8:
do {
int alt8=2;
@ -1283,7 +1305,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt8) {
case 1 :
// InternalXtext.g:10122:52: .
// InternalXtext.g:10258:52: .
{
matchAny();
@ -1313,12 +1335,12 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_SL_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10124:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalXtext.g:10124:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
// InternalXtext.g:10260:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalXtext.g:10260:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{
match("//");
// InternalXtext.g:10124:24: (~ ( ( '\\n' | '\\r' ) ) )*
// InternalXtext.g:10260:24: (~ ( ( '\\n' | '\\r' ) ) )*
loop9:
do {
int alt9=2;
@ -1331,7 +1353,7 @@ public class InternalXtextLexer extends Lexer {
switch (alt9) {
case 1 :
// InternalXtext.g:10124:24: ~ ( ( '\\n' | '\\r' ) )
// InternalXtext.g:10260: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();
@ -1351,7 +1373,7 @@ public class InternalXtextLexer extends Lexer {
}
} while (true);
// InternalXtext.g:10124:40: ( ( '\\r' )? '\\n' )?
// InternalXtext.g:10260:40: ( ( '\\r' )? '\\n' )?
int alt11=2;
int LA11_0 = input.LA(1);
@ -1360,9 +1382,9 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt11) {
case 1 :
// InternalXtext.g:10124:41: ( '\\r' )? '\\n'
// InternalXtext.g:10260:41: ( '\\r' )? '\\n'
{
// InternalXtext.g:10124:41: ( '\\r' )?
// InternalXtext.g:10260:41: ( '\\r' )?
int alt10=2;
int LA10_0 = input.LA(1);
@ -1371,7 +1393,7 @@ public class InternalXtextLexer extends Lexer {
}
switch (alt10) {
case 1 :
// InternalXtext.g:10124:41: '\\r'
// InternalXtext.g:10260:41: '\\r'
{
match('\r');
@ -1403,10 +1425,10 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10126:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalXtext.g:10126:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
// InternalXtext.g:10262:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalXtext.g:10262:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{
// InternalXtext.g:10126:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
// InternalXtext.g:10262:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
int cnt12=0;
loop12:
do {
@ -1460,8 +1482,8 @@ public class InternalXtextLexer extends Lexer {
try {
int _type = RULE_ANY_OTHER;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalXtext.g:10128:16: ( . )
// InternalXtext.g:10128:18: .
// InternalXtext.g:10264:16: ( . )
// InternalXtext.g:10264:18: .
{
matchAny();
@ -1476,8 +1498,8 @@ public class InternalXtextLexer extends Lexer {
// $ANTLR end "RULE_ANY_OTHER"
public void mTokens() throws RecognitionException {
// InternalXtext.g:1:8: ( T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | RULE_JAVACODESTRING | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
int alt13=49;
// InternalXtext.g:1:8: ( T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | RULE_JAVACODESTRING | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
int alt13=50;
alt13 = dfa13.predict(input);
switch (alt13) {
case 1 :
@ -1768,56 +1790,63 @@ public class InternalXtextLexer extends Lexer {
}
break;
case 42 :
// InternalXtext.g:1:256: RULE_JAVACODESTRING
// InternalXtext.g:1:256: T__53
{
mT__53();
}
break;
case 43 :
// InternalXtext.g:1:262: RULE_JAVACODESTRING
{
mRULE_JAVACODESTRING();
}
break;
case 43 :
// InternalXtext.g:1:276: RULE_ID
case 44 :
// InternalXtext.g:1:282: RULE_ID
{
mRULE_ID();
}
break;
case 44 :
// InternalXtext.g:1:284: RULE_INT
case 45 :
// InternalXtext.g:1:290: RULE_INT
{
mRULE_INT();
}
break;
case 45 :
// InternalXtext.g:1:293: RULE_STRING
case 46 :
// InternalXtext.g:1:299: RULE_STRING
{
mRULE_STRING();
}
break;
case 46 :
// InternalXtext.g:1:305: RULE_ML_COMMENT
case 47 :
// InternalXtext.g:1:311: RULE_ML_COMMENT
{
mRULE_ML_COMMENT();
}
break;
case 47 :
// InternalXtext.g:1:321: RULE_SL_COMMENT
case 48 :
// InternalXtext.g:1:327: RULE_SL_COMMENT
{
mRULE_SL_COMMENT();
}
break;
case 48 :
// InternalXtext.g:1:337: RULE_WS
case 49 :
// InternalXtext.g:1:343: RULE_WS
{
mRULE_WS();
}
break;
case 49 :
// InternalXtext.g:1:345: RULE_ANY_OTHER
case 50 :
// InternalXtext.g:1:351: RULE_ANY_OTHER
{
mRULE_ANY_OTHER();
@ -1831,21 +1860,21 @@ public class InternalXtextLexer extends Lexer {
protected DFA13 dfa13 = new DFA13(this);
static final String DFA13_eotS =
"\1\uffff\1\53\1\uffff\1\56\1\60\4\63\3\uffff\1\75\2\63\1\uffff\1\102\1\uffff\1\63\6\uffff\1\63\3\uffff\1\51\3\63\2\51\2\uffff\3\51\2\uffff\1\132\6\uffff\2\63\1\uffff\5\63\5\uffff\1\142\1\63\4\uffff\1\63\6\uffff\1\63\4\uffff\3\63\10\uffff\7\63\1\uffff\3\63\1\163\4\63\1\170\3\63\1\174\3\63\1\uffff\1\u0080\1\63\1\u0082\1\63\1\uffff\3\63\1\uffff\3\63\1\uffff\1\63\1\uffff\4\63\1\u008f\2\63\1\u0092\2\63\1\u0095\1\63\1\uffff\1\u0097\1\u0098\1\uffff\1\u0099\1\u009a\1\uffff\1\u009b\5\uffff";
"\1\uffff\1\53\1\uffff\1\56\1\60\4\63\3\uffff\1\75\1\77\2\63\1\103\1\uffff\1\63\6\uffff\1\63\3\uffff\1\51\3\63\2\51\2\uffff\3\51\2\uffff\1\133\6\uffff\2\63\1\uffff\5\63\7\uffff\1\143\1\63\3\uffff\1\63\6\uffff\1\63\4\uffff\3\63\10\uffff\7\63\1\uffff\3\63\1\164\4\63\1\171\3\63\1\175\3\63\1\uffff\1\u0081\1\63\1\u0083\1\63\1\uffff\3\63\1\uffff\3\63\1\uffff\1\63\1\uffff\4\63\1\u0090\2\63\1\u0093\2\63\1\u0096\1\63\1\uffff\1\u0098\1\u0099\1\uffff\1\u009a\1\u009b\1\uffff\1\u009c\5\uffff";
static final String DFA13_eofS =
"\u009c\uffff";
"\u009d\uffff";
static final String DFA13_minS =
"\1\0\1\75\1\uffff\1\75\1\76\1\141\2\145\1\151\3\uffff\1\56\1\163\1\155\1\uffff\1\72\1\uffff\1\145\6\uffff\1\165\3\uffff\1\76\1\117\1\156\1\151\1\44\1\101\2\uffff\2\0\1\52\2\uffff\1\76\6\uffff\1\154\1\141\1\uffff\1\165\1\162\1\141\1\156\1\164\5\uffff\1\60\1\160\4\uffff\1\164\6\uffff\1\162\4\uffff\1\106\1\165\1\144\10\uffff\1\163\1\147\1\145\2\155\1\145\1\150\1\uffff\1\157\1\165\1\162\1\60\1\155\1\144\1\145\1\155\1\60\1\151\1\155\1\162\1\60\2\162\1\145\1\uffff\1\60\1\145\1\60\1\145\1\uffff\1\156\2\141\1\uffff\1\164\2\156\1\uffff\1\156\1\uffff\1\156\1\141\1\162\1\164\1\60\1\163\1\164\1\60\1\164\1\154\1\60\1\145\1\uffff\2\60\1\uffff\2\60\1\uffff\1\60\5\uffff";
"\1\0\1\75\1\uffff\1\75\1\76\1\141\2\145\1\151\3\uffff\1\151\1\56\1\163\1\155\1\72\1\uffff\1\145\6\uffff\1\165\3\uffff\1\76\1\117\1\156\1\151\1\44\1\101\2\uffff\2\0\1\52\2\uffff\1\76\6\uffff\1\154\1\141\1\uffff\1\165\1\162\1\141\1\156\1\164\7\uffff\1\60\1\160\3\uffff\1\164\6\uffff\1\162\4\uffff\1\106\1\165\1\144\10\uffff\1\163\1\147\1\145\2\155\1\145\1\150\1\uffff\1\157\1\165\1\162\1\60\1\155\1\144\1\145\1\155\1\60\1\151\1\155\1\162\1\60\2\162\1\145\1\uffff\1\60\1\145\1\60\1\145\1\uffff\1\156\2\141\1\uffff\1\164\2\156\1\uffff\1\156\1\uffff\1\156\1\141\1\162\1\164\1\60\1\163\1\164\1\60\1\164\1\154\1\60\1\145\1\uffff\2\60\1\uffff\2\60\1\uffff\1\60\5\uffff";
static final String DFA13_maxS =
"\1\uffff\1\75\1\uffff\1\75\1\76\3\162\1\151\3\uffff\1\56\1\163\1\155\1\uffff\1\72\1\uffff\1\145\6\uffff\1\165\3\uffff\1\76\1\117\1\156\1\151\1\44\1\172\2\uffff\2\uffff\1\57\2\uffff\1\76\6\uffff\1\154\1\141\1\uffff\1\165\1\162\1\141\1\156\1\164\5\uffff\1\172\1\160\4\uffff\1\164\6\uffff\1\162\4\uffff\1\106\1\165\1\144\10\uffff\1\163\1\147\1\145\2\155\1\145\1\150\1\uffff\1\157\1\165\1\162\1\172\1\155\1\144\1\145\1\155\1\172\1\151\1\155\1\162\1\172\2\162\1\145\1\uffff\1\172\1\145\1\172\1\145\1\uffff\1\156\2\141\1\uffff\1\164\2\156\1\uffff\1\156\1\uffff\1\156\1\141\1\162\1\164\1\172\1\163\1\164\1\172\1\164\1\154\1\172\1\145\1\uffff\2\172\1\uffff\2\172\1\uffff\1\172\5\uffff";
"\1\uffff\1\75\1\uffff\1\75\1\76\3\162\1\151\3\uffff\1\151\1\56\1\163\1\155\1\72\1\uffff\1\145\6\uffff\1\165\3\uffff\1\76\1\117\1\156\1\151\1\44\1\172\2\uffff\2\uffff\1\57\2\uffff\1\76\6\uffff\1\154\1\141\1\uffff\1\165\1\162\1\141\1\156\1\164\7\uffff\1\172\1\160\3\uffff\1\164\6\uffff\1\162\4\uffff\1\106\1\165\1\144\10\uffff\1\163\1\147\1\145\2\155\1\145\1\150\1\uffff\1\157\1\165\1\162\1\172\1\155\1\144\1\145\1\155\1\172\1\151\1\155\1\162\1\172\2\162\1\145\1\uffff\1\172\1\145\1\172\1\145\1\uffff\1\156\2\141\1\uffff\1\164\2\156\1\uffff\1\156\1\uffff\1\156\1\141\1\162\1\164\1\172\1\163\1\164\1\172\1\164\1\154\1\172\1\145\1\uffff\2\172\1\uffff\2\172\1\uffff\1\172\5\uffff";
static final String DFA13_acceptS =
"\2\uffff\1\2\6\uffff\1\13\1\14\1\15\3\uffff\1\22\1\uffff\1\24\1\uffff\1\26\1\27\1\31\1\32\1\34\1\35\1\uffff\1\37\1\40\1\41\6\uffff\1\53\1\54\3\uffff\1\60\1\61\1\uffff\1\1\1\2\1\5\1\3\1\51\1\4\2\uffff\1\53\5\uffff\1\13\1\14\1\15\1\45\1\16\2\uffff\1\22\1\30\1\23\1\24\1\uffff\1\26\1\27\1\31\1\32\1\34\1\35\1\uffff\1\37\1\40\1\41\1\43\3\uffff\1\52\1\54\1\55\1\56\1\57\1\60\1\33\1\10\7\uffff\1\20\20\uffff\1\44\4\uffff\1\7\3\uffff\1\12\3\uffff\1\46\1\uffff\1\6\14\uffff\1\21\2\uffff\1\47\2\uffff\1\11\1\uffff\1\25\1\36\1\50\1\42\1\17";
"\2\uffff\1\2\6\uffff\1\13\1\14\1\15\5\uffff\1\25\1\uffff\1\27\1\30\1\32\1\33\1\35\1\36\1\uffff\1\40\1\41\1\42\6\uffff\1\54\1\55\3\uffff\1\61\1\62\1\uffff\1\1\1\2\1\5\1\3\1\52\1\4\2\uffff\1\54\5\uffff\1\13\1\14\1\15\1\16\1\23\1\46\1\17\2\uffff\1\31\1\24\1\25\1\uffff\1\27\1\30\1\32\1\33\1\35\1\36\1\uffff\1\40\1\41\1\42\1\44\3\uffff\1\53\1\55\1\56\1\57\1\60\1\61\1\34\1\10\7\uffff\1\21\20\uffff\1\45\4\uffff\1\7\3\uffff\1\12\3\uffff\1\47\1\uffff\1\6\14\uffff\1\22\2\uffff\1\50\2\uffff\1\11\1\uffff\1\26\1\37\1\51\1\43\1\20";
static final String DFA13_specialS =
"\1\1\44\uffff\1\2\1\0\165\uffff}>";
"\1\1\44\uffff\1\2\1\0\166\uffff}>";
static final String[] DFA13_transitionS = DFA13_transitionS_.DFA13_transitionS;
private static final class DFA13_transitionS_ {
static final String[] DFA13_transitionS = {
"\11\51\2\50\2\51\1\50\22\51\1\50\1\32\1\45\1\51\1\41\1\51\1\26\1\46\1\12\1\13\1\2\1\3\1\11\1\35\1\14\1\47\12\44\1\20\1\21\1\23\1\4\1\24\1\1\1\17\4\43\1\36\25\43\1\33\1\51\1\34\1\42\1\43\1\51\1\15\1\43\1\31\1\43\1\37\1\5\1\7\1\40\1\16\10\43\1\22\1\43\1\6\2\43\1\10\3\43\1\27\1\25\1\30\uff82\51",
"\11\51\2\50\2\51\1\50\22\51\1\50\1\32\1\45\1\51\1\41\1\51\1\26\1\46\1\12\1\13\1\2\1\3\1\11\1\35\1\15\1\47\12\44\1\20\1\21\1\23\1\4\1\24\1\1\1\14\4\43\1\36\25\43\1\33\1\51\1\34\1\42\1\43\1\51\1\16\1\43\1\31\1\43\1\37\1\5\1\7\1\40\1\17\10\43\1\22\1\43\1\6\2\43\1\10\3\43\1\27\1\25\1\30\uff82\51",
"\1\52",
"",
"\1\55",
@ -1859,135 +1888,136 @@ public class InternalXtextLexer extends Lexer {
"",
"\1\74",
"\1\76",
"\1\77",
"",
"\1\100",
"\1\101",
"\1\102",
"",
"\1\104",
"\1\105",
"",
"",
"",
"",
"",
"",
"\1\113",
"\1\114",
"",
"",
"",
"\1\117",
"\1\120",
"\1\121",
"\1\122",
"\1\123",
"\1\124",
"\32\63\4\uffff\1\63\1\uffff\32\63",
"",
"",
"\0\125",
"\0\125",
"\1\126\4\uffff\1\127",
"\0\126",
"\0\126",
"\1\127\4\uffff\1\130",
"",
"",
"\1\131",
"\1\132",
"",
"",
"",
"",
"",
"",
"\1\133",
"\1\134",
"",
"\1\135",
"",
"\1\136",
"\1\137",
"\1\140",
"\1\141",
"\1\142",
"",
"",
"",
"",
"",
"",
"",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\143",
"",
"",
"",
"",
"\1\144",
"",
"",
"",
"",
"",
"",
"\1\145",
"",
"",
"",
"",
"",
"",
"\1\146",
"",
"",
"",
"",
"\1\147",
"\1\150",
"",
"",
"",
"",
"",
"",
"",
"",
"\1\151",
"",
"",
"",
"",
"",
"",
"",
"",
"\1\152",
"\1\153",
"\1\154",
"\1\155",
"\1\156",
"\1\157",
"",
"\1\160",
"",
"\1\161",
"\1\162",
"\1\163",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\164",
"\1\165",
"\1\166",
"\1\167",
"\1\170",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\171",
"\1\172",
"\1\173",
"\1\174",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\175",
"\1\176",
"\1\177",
"\1\u0080",
"",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\u0081",
"\1\u0082",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\u0083",
"",
"\1\u0084",
"",
"\1\u0085",
"\1\u0086",
"",
"\1\u0087",
"",
"\1\u0088",
"\1\u0089",
"",
"\1\u008a",
"",
"\1\u008b",
"",
"\1\u008c",
"\1\u008d",
"\1\u008e",
"\1\u008f",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\u0090",
"\1\u0091",
"\1\u0092",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\u0093",
"\1\u0094",
"\1\u0095",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\1\u0096",
"\1\u0097",
"",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
"\12\63\7\uffff\32\63\4\uffff\1\63\1\uffff\32\63",
@ -2034,7 +2064,7 @@ public class InternalXtextLexer extends Lexer {
this.transition = DFA13_transition;
}
public String getDescription() {
return "1:1: Tokens : ( T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | RULE_JAVACODESTRING | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
return "1:1: Tokens : ( T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | RULE_JAVACODESTRING | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
}
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
IntStream input = _input;
@ -2044,7 +2074,7 @@ public class InternalXtextLexer extends Lexer {
int LA13_38 = input.LA(1);
s = -1;
if ( ((LA13_38>='\u0000' && LA13_38<='\uFFFF')) ) {s = 85;}
if ( ((LA13_38>='\u0000' && LA13_38<='\uFFFF')) ) {s = 86;}
else s = 41;
@ -2076,13 +2106,13 @@ public class InternalXtextLexer extends Lexer {
else if ( (LA13_0==')') ) {s = 11;}
else if ( (LA13_0=='.') ) {s = 12;}
else if ( (LA13_0=='@') ) {s = 12;}
else if ( (LA13_0=='a') ) {s = 13;}
else if ( (LA13_0=='.') ) {s = 13;}
else if ( (LA13_0=='i') ) {s = 14;}
else if ( (LA13_0=='a') ) {s = 14;}
else if ( (LA13_0=='@') ) {s = 15;}
else if ( (LA13_0=='i') ) {s = 15;}
else if ( (LA13_0==':') ) {s = 16;}
@ -2142,7 +2172,7 @@ public class InternalXtextLexer extends Lexer {
int LA13_37 = input.LA(1);
s = -1;
if ( ((LA13_37>='\u0000' && LA13_37<='\uFFFF')) ) {s = 85;}
if ( ((LA13_37>='\u0000' && LA13_37<='\uFFFF')) ) {s = 86;}
else s = 41;

View file

@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
* <li>{@link org.eclipse.xtext.Grammar#getHiddenTokens <em>Hidden Tokens</em>}</li>
* <li>{@link org.eclipse.xtext.Grammar#getMetamodelDeclarations <em>Metamodel Declarations</em>}</li>
* <li>{@link org.eclipse.xtext.Grammar#getRules <em>Rules</em>}</li>
* <li>{@link org.eclipse.xtext.Grammar#getInitBlock <em>Init Block</em>}</li>
* </ul>
*
* @see org.eclipse.xtext.XtextPackage#getGrammar()
@ -144,4 +145,26 @@ public interface Grammar extends EObject {
*/
EList<AbstractRule> getRules();
/**
* Returns the value of the '<em><b>Init Block</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Init Block</em>' containment reference.
* @see #setInitBlock(InitBlock)
* @see org.eclipse.xtext.XtextPackage#getGrammar_InitBlock()
* @model containment="true"
* @generated
*/
InitBlock getInitBlock();
/**
* Sets the value of the '{@link org.eclipse.xtext.Grammar#getInitBlock <em>Init Block</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Init Block</em>' containment reference.
* @see #getInitBlock()
* @generated
*/
void setInitBlock(InitBlock value);
} // Grammar

View file

@ -0,0 +1,46 @@
/**
*/
package org.eclipse.xtext;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Init Block</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.xtext.InitBlock#getCode <em>Code</em>}</li>
* </ul>
*
* @see org.eclipse.xtext.XtextPackage#getInitBlock()
* @model
* @generated
*/
public interface InitBlock extends EObject {
/**
* Returns the value of the '<em><b>Code</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Code</em>' containment reference.
* @see #setCode(JavaCode)
* @see org.eclipse.xtext.XtextPackage#getInitBlock_Code()
* @model containment="true"
* @generated
*/
JavaCode getCode();
/**
* Sets the value of the '{@link org.eclipse.xtext.InitBlock#getCode <em>Code</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Code</em>' containment reference.
* @see #getCode()
* @generated
*/
void setCode(JavaCode value);
} // InitBlock

View file

@ -381,6 +381,15 @@ public interface XtextFactory extends EFactory {
*/
JavaAction createJavaAction();
/**
* Returns a new object of class '<em>Init Block</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Init Block</em>'.
* @generated
*/
InitBlock createInitBlock();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->

View file

@ -121,6 +121,15 @@ public interface XtextPackage extends EPackage {
*/
int GRAMMAR__RULES = 5;
/**
* The feature id for the '<em><b>Init Block</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int GRAMMAR__INIT_BLOCK = 6;
/**
* The number of structural features of the '<em>Grammar</em>' class.
* <!-- begin-user-doc -->
@ -128,7 +137,7 @@ public interface XtextPackage extends EPackage {
* @generated
* @ordered
*/
int GRAMMAR_FEATURE_COUNT = 6;
int GRAMMAR_FEATURE_COUNT = 7;
/**
* The meta object id for the '{@link org.eclipse.xtext.impl.AbstractRuleImpl <em>Abstract Rule</em>}' class.
@ -2126,6 +2135,34 @@ public interface XtextPackage extends EPackage {
*/
int JAVA_ACTION_FEATURE_COUNT = ABSTRACT_ELEMENT_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link org.eclipse.xtext.impl.InitBlockImpl <em>Init Block</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.impl.InitBlockImpl
* @see org.eclipse.xtext.impl.XtextPackageImpl#getInitBlock()
* @generated
*/
int INIT_BLOCK = 40;
/**
* The feature id for the '<em><b>Code</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int INIT_BLOCK__CODE = 0;
/**
* The number of structural features of the '<em>Init Block</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int INIT_BLOCK_FEATURE_COUNT = 1;
/**
* Returns the meta object for class '{@link org.eclipse.xtext.Grammar <em>Grammar</em>}'.
* <!-- begin-user-doc -->
@ -2202,6 +2239,17 @@ public interface XtextPackage extends EPackage {
*/
EReference getGrammar_Rules();
/**
* Returns the meta object for the containment reference '{@link org.eclipse.xtext.Grammar#getInitBlock <em>Init Block</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Init Block</em>'.
* @see org.eclipse.xtext.Grammar#getInitBlock()
* @see #getGrammar()
* @generated
*/
EReference getGrammar_InitBlock();
/**
* Returns the meta object for class '{@link org.eclipse.xtext.AbstractRule <em>Abstract Rule</em>}'.
* <!-- begin-user-doc -->
@ -3167,6 +3215,27 @@ public interface XtextPackage extends EPackage {
*/
EReference getJavaAction_Code();
/**
* Returns the meta object for class '{@link org.eclipse.xtext.InitBlock <em>Init Block</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Init Block</em>'.
* @see org.eclipse.xtext.InitBlock
* @generated
*/
EClass getInitBlock();
/**
* Returns the meta object for the containment reference '{@link org.eclipse.xtext.InitBlock#getCode <em>Code</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Code</em>'.
* @see org.eclipse.xtext.InitBlock#getCode()
* @see #getInitBlock()
* @generated
*/
EReference getInitBlock_Code();
/**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
@ -3247,6 +3316,14 @@ public interface XtextPackage extends EPackage {
*/
EReference GRAMMAR__RULES = eINSTANCE.getGrammar_Rules();
/**
* The meta object literal for the '<em><b>Init Block</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference GRAMMAR__INIT_BLOCK = eINSTANCE.getGrammar_InitBlock();
/**
* The meta object literal for the '{@link org.eclipse.xtext.impl.AbstractRuleImpl <em>Abstract Rule</em>}' class.
* <!-- begin-user-doc -->
@ -4062,6 +4139,24 @@ public interface XtextPackage extends EPackage {
*/
EReference JAVA_ACTION__CODE = eINSTANCE.getJavaAction_Code();
/**
* The meta object literal for the '{@link org.eclipse.xtext.impl.InitBlockImpl <em>Init Block</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.impl.InitBlockImpl
* @see org.eclipse.xtext.impl.XtextPackageImpl#getInitBlock()
* @generated
*/
EClass INIT_BLOCK = eINSTANCE.getInitBlock();
/**
* The meta object literal for the '<em><b>Code</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference INIT_BLOCK__CODE = eINSTANCE.getInitBlock_Code();
}
} //XtextPackage

View file

@ -22,6 +22,8 @@ import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.xtext.AbstractMetamodelDeclaration;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.Grammar;
import org.eclipse.xtext.InitBlock;
import org.eclipse.xtext.JavaCode;
import org.eclipse.xtext.XtextPackage;
/**
@ -38,6 +40,7 @@ import org.eclipse.xtext.XtextPackage;
* <li>{@link org.eclipse.xtext.impl.GrammarImpl#getHiddenTokens <em>Hidden Tokens</em>}</li>
* <li>{@link org.eclipse.xtext.impl.GrammarImpl#getMetamodelDeclarations <em>Metamodel Declarations</em>}</li>
* <li>{@link org.eclipse.xtext.impl.GrammarImpl#getRules <em>Rules</em>}</li>
* <li>{@link org.eclipse.xtext.impl.GrammarImpl#getInitBlock <em>Init Block</em>}</li>
* </ul>
*
* @generated
@ -123,6 +126,16 @@ public class GrammarImpl extends MinimalEObjectImpl.Container implements Grammar
*/
protected EList<AbstractRule> rules;
/**
* The cached value of the '{@link #getInitBlock() <em>Init Block</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInitBlock()
* @generated
* @ordered
*/
protected InitBlock initBlock;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -240,6 +253,51 @@ public class GrammarImpl extends MinimalEObjectImpl.Container implements Grammar
return rules;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public InitBlock getInitBlock() {
return initBlock;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInitBlock(InitBlock newInitBlock, NotificationChain msgs) {
InitBlock oldInitBlock = initBlock;
initBlock = newInitBlock;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XtextPackage.GRAMMAR__INIT_BLOCK, oldInitBlock, newInitBlock);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setInitBlock(InitBlock newInitBlock) {
if (newInitBlock != initBlock) {
NotificationChain msgs = null;
if (initBlock != null)
msgs = ((InternalEObject)initBlock).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.GRAMMAR__INIT_BLOCK, null, msgs);
if (newInitBlock != null)
msgs = ((InternalEObject)newInitBlock).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XtextPackage.GRAMMAR__INIT_BLOCK, null, msgs);
msgs = basicSetInitBlock(newInitBlock, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.GRAMMAR__INIT_BLOCK, newInitBlock, newInitBlock));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -252,6 +310,8 @@ public class GrammarImpl extends MinimalEObjectImpl.Container implements Grammar
return ((InternalEList<?>)getMetamodelDeclarations()).basicRemove(otherEnd, msgs);
case XtextPackage.GRAMMAR__RULES:
return ((InternalEList<?>)getRules()).basicRemove(otherEnd, msgs);
case XtextPackage.GRAMMAR__INIT_BLOCK:
return basicSetInitBlock(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@ -276,6 +336,8 @@ public class GrammarImpl extends MinimalEObjectImpl.Container implements Grammar
return getMetamodelDeclarations();
case XtextPackage.GRAMMAR__RULES:
return getRules();
case XtextPackage.GRAMMAR__INIT_BLOCK:
return getInitBlock();
}
return super.eGet(featureID, resolve, coreType);
}
@ -311,6 +373,9 @@ public class GrammarImpl extends MinimalEObjectImpl.Container implements Grammar
getRules().clear();
getRules().addAll((Collection<? extends AbstractRule>)newValue);
return;
case XtextPackage.GRAMMAR__INIT_BLOCK:
setInitBlock((InitBlock)newValue);
return;
}
super.eSet(featureID, newValue);
}
@ -341,6 +406,9 @@ public class GrammarImpl extends MinimalEObjectImpl.Container implements Grammar
case XtextPackage.GRAMMAR__RULES:
getRules().clear();
return;
case XtextPackage.GRAMMAR__INIT_BLOCK:
setInitBlock((InitBlock)null);
return;
}
super.eUnset(featureID);
}
@ -365,6 +433,8 @@ public class GrammarImpl extends MinimalEObjectImpl.Container implements Grammar
return metamodelDeclarations != null && !metamodelDeclarations.isEmpty();
case XtextPackage.GRAMMAR__RULES:
return rules != null && !rules.isEmpty();
case XtextPackage.GRAMMAR__INIT_BLOCK:
return initBlock != null;
}
return super.eIsSet(featureID);
}

View file

@ -0,0 +1,178 @@
/**
*/
package org.eclipse.xtext.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.xtext.InitBlock;
import org.eclipse.xtext.JavaCode;
import org.eclipse.xtext.XtextPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Init Block</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.xtext.impl.InitBlockImpl#getCode <em>Code</em>}</li>
* </ul>
*
* @generated
*/
public class InitBlockImpl extends MinimalEObjectImpl.Container implements InitBlock {
/**
* The cached value of the '{@link #getCode() <em>Code</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCode()
* @generated
* @ordered
*/
protected JavaCode code;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InitBlockImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return XtextPackage.Literals.INIT_BLOCK;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public JavaCode getCode() {
return code;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCode(JavaCode newCode, NotificationChain msgs) {
JavaCode oldCode = code;
code = newCode;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XtextPackage.INIT_BLOCK__CODE, oldCode, newCode);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setCode(JavaCode newCode) {
if (newCode != code) {
NotificationChain msgs = null;
if (code != null)
msgs = ((InternalEObject)code).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.INIT_BLOCK__CODE, null, msgs);
if (newCode != null)
msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XtextPackage.INIT_BLOCK__CODE, null, msgs);
msgs = basicSetCode(newCode, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.INIT_BLOCK__CODE, newCode, newCode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case XtextPackage.INIT_BLOCK__CODE:
return basicSetCode(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case XtextPackage.INIT_BLOCK__CODE:
return getCode();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XtextPackage.INIT_BLOCK__CODE:
setCode((JavaCode)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case XtextPackage.INIT_BLOCK__CODE:
setCode((JavaCode)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case XtextPackage.INIT_BLOCK__CODE:
return code != null;
}
return super.eIsSet(featureID);
}
} //InitBlockImpl

View file

@ -95,6 +95,7 @@ public class XtextFactoryImpl extends EFactoryImpl implements XtextFactory {
case XtextPackage.GATED_SEMANTIC_PREDICATE: return createGatedSemanticPredicate();
case XtextPackage.JAVA_CODE: return createJavaCode();
case XtextPackage.JAVA_ACTION: return createJavaAction();
case XtextPackage.INIT_BLOCK: return createInitBlock();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@ -531,6 +532,17 @@ public class XtextFactoryImpl extends EFactoryImpl implements XtextFactory {
return javaAction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public InitBlock createInitBlock() {
InitBlockImpl initBlock = new InitBlockImpl();
return initBlock;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->

View file

@ -32,6 +32,7 @@ import org.eclipse.xtext.GatedSemanticPredicate;
import org.eclipse.xtext.GeneratedMetamodel;
import org.eclipse.xtext.Grammar;
import org.eclipse.xtext.Group;
import org.eclipse.xtext.InitBlock;
import org.eclipse.xtext.JavaAction;
import org.eclipse.xtext.JavaCode;
import org.eclipse.xtext.Keyword;
@ -339,6 +340,13 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
*/
private EClass javaActionEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass initBlockEClass = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
@ -473,6 +481,16 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
return (EReference)grammarEClass.getEStructuralFeatures().get(5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getGrammar_InitBlock() {
return (EReference)grammarEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -1374,6 +1392,26 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
return (EReference)javaActionEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getInitBlock() {
return initBlockEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getInitBlock_Code() {
return (EReference)initBlockEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -1410,6 +1448,7 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
createEReference(grammarEClass, GRAMMAR__HIDDEN_TOKENS);
createEReference(grammarEClass, GRAMMAR__METAMODEL_DECLARATIONS);
createEReference(grammarEClass, GRAMMAR__RULES);
createEReference(grammarEClass, GRAMMAR__INIT_BLOCK);
abstractRuleEClass = createEClass(ABSTRACT_RULE);
createEAttribute(abstractRuleEClass, ABSTRACT_RULE__NAME);
@ -1538,6 +1577,9 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
javaActionEClass = createEClass(JAVA_ACTION);
createEReference(javaActionEClass, JAVA_ACTION__CODE);
initBlockEClass = createEClass(INIT_BLOCK);
createEReference(initBlockEClass, INIT_BLOCK__CODE);
}
/**
@ -1610,6 +1652,7 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
initEReference(getGrammar_HiddenTokens(), this.getAbstractRule(), null, "hiddenTokens", null, 0, -1, Grammar.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGrammar_MetamodelDeclarations(), this.getAbstractMetamodelDeclaration(), null, "metamodelDeclarations", null, 0, -1, Grammar.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGrammar_Rules(), this.getAbstractRule(), null, "rules", null, 0, -1, Grammar.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGrammar_InitBlock(), this.getInitBlock(), null, "initBlock", null, 0, 1, Grammar.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(abstractRuleEClass, AbstractRule.class, "AbstractRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAbstractRule_Name(), theEcorePackage.getEString(), "name", null, 0, 1, AbstractRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@ -1739,6 +1782,9 @@ public class XtextPackageImpl extends EPackageImpl implements XtextPackage {
initEClass(javaActionEClass, JavaAction.class, "JavaAction", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getJavaAction_Code(), this.getJavaCode(), null, "code", null, 0, 1, JavaAction.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
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);
// Create resource
createResource(eNS_URI);
}

View file

@ -228,6 +228,10 @@ public class XtextAdapterFactory extends AdapterFactoryImpl {
return createJavaActionAdapter();
}
@Override
public Adapter caseInitBlock(InitBlock object) {
return createInitBlockAdapter();
}
@Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@ -816,6 +820,20 @@ public class XtextAdapterFactory extends AdapterFactoryImpl {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.InitBlock <em>Init Block</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.InitBlock
* @generated
*/
public Adapter createInitBlockAdapter() {
return null;
}
/**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->

View file

@ -345,6 +345,12 @@ public class XtextSwitch<T> extends Switch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
case XtextPackage.INIT_BLOCK: {
InitBlock initBlock = (InitBlock)theEObject;
T result = caseInitBlock(initBlock);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
@ -958,6 +964,21 @@ public class XtextSwitch<T> extends Switch<T> {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Init Block</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>Init Block</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseInitBlock(InitBlock object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->

View file

@ -12,6 +12,8 @@
upperBound="-1" eType="#//AbstractMetamodelDeclaration" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="rules" upperBound="-1"
eType="#//AbstractRule" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="initBlock" eType="#//InitBlock"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractRule">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType ../../../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
@ -153,4 +155,8 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="code" eType="#//JavaCode"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="InitBlock">
<eStructuralFeatures xsi:type="ecore:EReference" name="code" eType="#//JavaCode"
containment="true"/>
</eClassifiers>
</ecore:EPackage>

View file

@ -16,6 +16,7 @@
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Xtext.ecore#//Grammar/hiddenTokens"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Xtext.ecore#//Grammar/metamodelDeclarations"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Xtext.ecore#//Grammar/rules"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Xtext.ecore#//Grammar/initBlock"/>
</genClasses>
<genClasses ecoreClass="Xtext.ecore#//AbstractRule">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Xtext.ecore#//AbstractRule/name"/>
@ -133,5 +134,8 @@
<genClasses ecoreClass="Xtext.ecore#//JavaAction">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Xtext.ecore#//JavaAction/code"/>
</genClasses>
<genClasses ecoreClass="Xtext.ecore#//InitBlock">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Xtext.ecore#//InitBlock/code"/>
</genClasses>
</genPackages>
</genmodel:GenModel>

View file

@ -229,9 +229,28 @@ ruleGrammar returns [EObject current=null]
(
(
{
newCompositeNode(grammarAccess.getGrammarAccess().getRulesAbstractRuleParserRuleCall_5_0());
newCompositeNode(grammarAccess.getGrammarAccess().getInitBlockInitBlockParserRuleCall_5_0());
}
lv_rules_13_0=ruleAbstractRule
lv_initBlock_13_0=ruleInitBlock
{
if ($current==null) {
$current = createModelElementForParent(grammarAccess.getGrammarRule());
}
set(
$current,
"initBlock",
lv_initBlock_13_0,
"org.eclipse.xtext.Xtext.InitBlock");
afterParserOrEnumRuleCall();
}
)
)?
(
(
{
newCompositeNode(grammarAccess.getGrammarAccess().getRulesAbstractRuleParserRuleCall_6_0());
}
lv_rules_14_0=ruleAbstractRule
{
if ($current==null) {
$current = createModelElementForParent(grammarAccess.getGrammarRule());
@ -239,7 +258,7 @@ ruleGrammar returns [EObject current=null]
add(
$current,
"rules",
lv_rules_13_0,
lv_rules_14_0,
"org.eclipse.xtext.Xtext.AbstractRule");
afterParserOrEnumRuleCall();
}
@ -248,6 +267,48 @@ ruleGrammar returns [EObject current=null]
)
;
// Entry rule entryRuleInitBlock
entryRuleInitBlock returns [EObject current=null]:
{ newCompositeNode(grammarAccess.getInitBlockRule()); }
iv_ruleInitBlock=ruleInitBlock
{ $current=$iv_ruleInitBlock.current; }
EOF;
// Rule InitBlock
ruleInitBlock returns [EObject current=null]
@init {
enterRule();
}
@after {
leaveRule();
}:
(
otherlv_0='@init'
{
newLeafNode(otherlv_0, grammarAccess.getInitBlockAccess().getInitKeyword_0());
}
(
(
{
newCompositeNode(grammarAccess.getInitBlockAccess().getCodeJavaCodeParserRuleCall_1_0());
}
lv_code_1_0=ruleJavaCode
{
if ($current==null) {
$current = createModelElementForParent(grammarAccess.getInitBlockRule());
}
set(
$current,
"code",
lv_code_1_0,
"org.eclipse.xtext.Xtext.JavaCode");
afterParserOrEnumRuleCall();
}
)
)
)
;
// Entry rule entryRuleGrammarID
entryRuleGrammarID returns [String current=null]:
{ newCompositeNode(grammarAccess.getGrammarIDRule()); }

View file

@ -1,44 +1,45 @@
'!'=43
'&'=32
'!'=44
'&'=33
'('=16
')'=17
'*'=24
'+'=35
'+='=38
'*'=25
'+'=36
'+='=39
','=14
'->'=45
'.'=18
'..'=51
':'=26
'::'=30
';'=27
'<'=28
'='=37
'=>'=44
'>'=29
'?'=34
'?='=46
'?=>'=33
'@'=22
'EOF'=50
'['=47
']'=48
'as'=20
'current'=39
'enum'=52
'false'=42
'fragment'=23
'generate'=19
'->'=46
'.'=19
'..'=52
':'=27
'::'=31
';'=28
'<'=29
'='=38
'=>'=45
'>'=30
'?'=35
'?='=47
'?=>'=34
'@'=23
'@init'=18
'EOF'=51
'['=48
']'=49
'as'=21
'current'=40
'enum'=53
'false'=43
'fragment'=24
'generate'=20
'grammar'=12
'hidden'=15
'import'=21
'returns'=25
'terminal'=49
'true'=41
'import'=22
'returns'=26
'terminal'=50
'true'=42
'with'=13
'{'=36
'|'=31
'}'=40
'{'=37
'|'=32
'}'=41
RULE_ANY_OTHER=11
RULE_ID=5
RULE_INT=7
@ -88,3 +89,4 @@ T__49=49
T__50=50
T__51=51
T__52=52
T__53=53

View file

@ -22,6 +22,7 @@ import org.eclipse.xtext.GatedSemanticPredicate;
import org.eclipse.xtext.GeneratedMetamodel;
import org.eclipse.xtext.Grammar;
import org.eclipse.xtext.Group;
import org.eclipse.xtext.InitBlock;
import org.eclipse.xtext.JavaAction;
import org.eclipse.xtext.JavaCode;
import org.eclipse.xtext.Keyword;
@ -243,6 +244,9 @@ public class XtextSemanticSequencer extends AbstractDelegatingSemanticSequencer
return;
}
else break;
case XtextPackage.INIT_BLOCK:
sequence_InitBlock(context, (InitBlock) semanticObject);
return;
case XtextPackage.JAVA_ACTION:
if (rule == grammarAccess.getAlternativesRule()
|| action == grammarAccess.getAlternativesAccess().getAlternativesElementsAction_1_0()
@ -929,6 +933,7 @@ public class XtextSemanticSequencer extends AbstractDelegatingSemanticSequencer
* (usedGrammars+=[Grammar|GrammarID] usedGrammars+=[Grammar|GrammarID]*)?
* (definesHiddenTokens?='hidden' (hiddenTokens+=[AbstractRule|RuleID] hiddenTokens+=[AbstractRule|RuleID]*)?)?
* metamodelDeclarations+=AbstractMetamodelDeclaration*
* initBlock=InitBlock?
* rules+=AbstractRule+
* )
*/
@ -937,6 +942,24 @@ public class XtextSemanticSequencer extends AbstractDelegatingSemanticSequencer
}
/**
* Contexts:
* InitBlock returns InitBlock
*
* Constraint:
* code=JavaCode
*/
protected void sequence_InitBlock(ISerializationContext context, InitBlock semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XtextPackage.Literals.INIT_BLOCK__CODE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XtextPackage.Literals.INIT_BLOCK__CODE));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getInitBlockAccess().getCodeJavaCodeParserRuleCall_1_0(), semanticObject.getCode());
feeder.finish();
}
/**
* Contexts:
* JavaAction returns JavaAction

View file

@ -56,20 +56,23 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
private final Keyword cRightParenthesisKeyword_3_3 = (Keyword)cGroup_3.eContents().get(3);
private final Assignment cMetamodelDeclarationsAssignment_4 = (Assignment)cGroup.eContents().get(4);
private final RuleCall cMetamodelDeclarationsAbstractMetamodelDeclarationParserRuleCall_4_0 = (RuleCall)cMetamodelDeclarationsAssignment_4.eContents().get(0);
private final Assignment cRulesAssignment_5 = (Assignment)cGroup.eContents().get(5);
private final RuleCall cRulesAbstractRuleParserRuleCall_5_0 = (RuleCall)cRulesAssignment_5.eContents().get(0);
private final Assignment cInitBlockAssignment_5 = (Assignment)cGroup.eContents().get(5);
private final RuleCall cInitBlockInitBlockParserRuleCall_5_0 = (RuleCall)cInitBlockAssignment_5.eContents().get(0);
private final Assignment cRulesAssignment_6 = (Assignment)cGroup.eContents().get(6);
private final RuleCall cRulesAbstractRuleParserRuleCall_6_0 = (RuleCall)cRulesAssignment_6.eContents().get(0);
//Grammar:
// 'grammar' name=GrammarID ('with' usedGrammars+=[Grammar|GrammarID] (',' usedGrammars+=[Grammar|GrammarID])*)?
// (definesHiddenTokens?='hidden' '(' (hiddenTokens+=[AbstractRule|RuleID] (',' hiddenTokens+=[AbstractRule|RuleID])*)?
// ')')?
// metamodelDeclarations+=AbstractMetamodelDeclaration*
// initBlock=InitBlock?
// rules+=AbstractRule+;
@Override public ParserRule getRule() { return rule; }
//'grammar' name=GrammarID ('with' usedGrammars+=[Grammar|GrammarID] (',' usedGrammars+=[Grammar|GrammarID])*)?
//(definesHiddenTokens?='hidden' '(' (hiddenTokens+=[AbstractRule|RuleID] (',' hiddenTokens+=[AbstractRule|RuleID])*)?
//')')? metamodelDeclarations+=AbstractMetamodelDeclaration* rules+=AbstractRule+
//')')? metamodelDeclarations+=AbstractMetamodelDeclaration* initBlock=InitBlock? rules+=AbstractRule+
public Group getGroup() { return cGroup; }
//'grammar'
@ -160,11 +163,40 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
//AbstractMetamodelDeclaration
public RuleCall getMetamodelDeclarationsAbstractMetamodelDeclarationParserRuleCall_4_0() { return cMetamodelDeclarationsAbstractMetamodelDeclarationParserRuleCall_4_0; }
//initBlock=InitBlock?
public Assignment getInitBlockAssignment_5() { return cInitBlockAssignment_5; }
//InitBlock
public RuleCall getInitBlockInitBlockParserRuleCall_5_0() { return cInitBlockInitBlockParserRuleCall_5_0; }
//rules+=AbstractRule+
public Assignment getRulesAssignment_5() { return cRulesAssignment_5; }
public Assignment getRulesAssignment_6() { return cRulesAssignment_6; }
//AbstractRule
public RuleCall getRulesAbstractRuleParserRuleCall_5_0() { return cRulesAbstractRuleParserRuleCall_5_0; }
public RuleCall getRulesAbstractRuleParserRuleCall_6_0() { return cRulesAbstractRuleParserRuleCall_6_0; }
}
public class InitBlockElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.Xtext.InitBlock");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cInitKeyword_0 = (Keyword)cGroup.eContents().get(0);
private final Assignment cCodeAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cCodeJavaCodeParserRuleCall_1_0 = (RuleCall)cCodeAssignment_1.eContents().get(0);
//InitBlock:
// '@init' code=JavaCode;
@Override public ParserRule getRule() { return rule; }
//'@init' code=JavaCode
public Group getGroup() { return cGroup; }
//'@init'
public Keyword getInitKeyword_0() { return cInitKeyword_0; }
//code=JavaCode
public Assignment getCodeAssignment_1() { return cCodeAssignment_1; }
//JavaCode
public RuleCall getCodeJavaCodeParserRuleCall_1_0() { return cCodeJavaCodeParserRuleCall_1_0; }
}
public class GrammarIDElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.Xtext.GrammarID");
@ -2382,6 +2414,7 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
private final GrammarElements pGrammar;
private final InitBlockElements pInitBlock;
private final GrammarIDElements pGrammarID;
private final AbstractRuleElements pAbstractRule;
private final AbstractMetamodelDeclarationElements pAbstractMetamodelDeclaration;
@ -2454,6 +2487,7 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
this.grammar = internalFindGrammar(grammarProvider);
this.gaTerminals = gaTerminals;
this.pGrammar = new GrammarElements();
this.pInitBlock = new InitBlockElements();
this.pGrammarID = new GrammarIDElements();
this.pAbstractRule = new AbstractRuleElements();
this.pAbstractMetamodelDeclaration = new AbstractMetamodelDeclarationElements();
@ -2549,6 +2583,7 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
// (definesHiddenTokens?='hidden' '(' (hiddenTokens+=[AbstractRule|RuleID] (',' hiddenTokens+=[AbstractRule|RuleID])*)?
// ')')?
// metamodelDeclarations+=AbstractMetamodelDeclaration*
// initBlock=InitBlock?
// rules+=AbstractRule+;
public GrammarElements getGrammarAccess() {
return pGrammar;
@ -2558,6 +2593,16 @@ public class XtextGrammarAccess extends AbstractElementFinder.AbstractGrammarEle
return getGrammarAccess().getRule();
}
//InitBlock:
// '@init' code=JavaCode;
public InitBlockElements getInitBlockAccess() {
return pInitBlock;
}
public ParserRule getInitBlockRule() {
return getInitBlockAccess().getRule();
}
//GrammarID:
// ValidID ('.' ValidID)*;
public GrammarIDElements getGrammarIDAccess() {

View file

@ -15,9 +15,14 @@ Grammar:
'grammar' name=GrammarID ('with' usedGrammars+=[Grammar|GrammarID] (',' usedGrammars+=[Grammar|GrammarID])*)?
(definesHiddenTokens?='hidden' '(' (hiddenTokens+=[AbstractRule|RuleID] (',' hiddenTokens+=[AbstractRule|RuleID])*)? ')')?
metamodelDeclarations+=AbstractMetamodelDeclaration*
(initBlock=InitBlock)?
(rules+=AbstractRule)+
;
InitBlock returns InitBlock:
'@init' code=JavaCode
;
GrammarID returns ecore::EString:
ValidID ('.' ValidID)*;

View file

@ -80,8 +80,8 @@ public class XtextFormatter extends AbstractDeclarativeFormatter {
cfg.setLinewrap(2).between(gr.getGroup_2(), gr.getMetamodelDeclarationsAssignment_4());
cfg.setLinewrap(2).between(gr.getGroup_3(), gr.getMetamodelDeclarationsAssignment_4());
cfg.setLinewrap().after(gr.getMetamodelDeclarationsAssignment_4());
cfg.setLinewrap(2).between(gr.getMetamodelDeclarationsAssignment_4(), gr.getRulesAssignment_5());
cfg.setLinewrap(2).before(gr.getRulesAssignment_5());
cfg.setLinewrap(2).between(gr.getMetamodelDeclarationsAssignment_4(), gr.getRulesAssignment_6());
cfg.setLinewrap(2).before(gr.getRulesAssignment_6());
// ParserRule
ParserRuleElements pr = g.getParserRuleAccess();