Skip to content

Commit

Permalink
eclipse-archived#190 POC: insert syntax and auto completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodolfo Totaro committed Dec 17, 2016
1 parent 89c4c16 commit 259e330
Show file tree
Hide file tree
Showing 44 changed files with 3,090 additions and 2,575 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ protected String getRuleName(AbstractElement element) {
nameMappings = new HashMap<AbstractElement, String>() {
private static final long serialVersionUID = 1L;
{
put(grammarAccess.getCommandAccess().getAlternatives(), "rule__Command__Alternatives");
put(grammarAccess.getCommandAccess().getAlternatives_0(), "rule__Command__Alternatives_0");
put(grammarAccess.getJvmTypeReferenceAccess().getAlternatives(), "rule__JvmTypeReference__Alternatives");
put(grammarAccess.getJvmArgumentTypeReferenceAccess().getAlternatives(), "rule__JvmArgumentTypeReference__Alternatives");
put(grammarAccess.getJvmWildcardTypeReferenceAccess().getAlternatives_2(), "rule__JvmWildcardTypeReference__Alternatives_2");
put(grammarAccess.getXImportDeclarationAccess().getAlternatives_1(), "rule__XImportDeclaration__Alternatives_1");
put(grammarAccess.getXImportDeclarationAccess().getAlternatives_1_0_3(), "rule__XImportDeclaration__Alternatives_1_0_3");
put(grammarAccess.getCommandAccess().getGroup(), "rule__Command__Group__0");
put(grammarAccess.getInsertAccess().getGroup(), "rule__Insert__Group__0");
put(grammarAccess.getInsertAccess().getGroup_2(), "rule__Insert__Group_2__0");
put(grammarAccess.getInsertAccess().getGroup_3(), "rule__Insert__Group_3__0");
put(grammarAccess.getInsertAccess().getGroup_3_2(), "rule__Insert__Group_3_2__0");
put(grammarAccess.getParameterAccess().getGroup(), "rule__Parameter__Group__0");
put(grammarAccess.getConnectAccess().getGroup(), "rule__Connect__Group__0");
put(grammarAccess.getJvmTypeReferenceAccess().getGroup_0(), "rule__JvmTypeReference__Group_0__0");
Expand Down Expand Up @@ -81,7 +83,7 @@ protected String getRuleName(AbstractElement element) {
put(grammarAccess.getInsertAccess().getObjAssignment_1(), "rule__Insert__ObjAssignment_1");
put(grammarAccess.getInsertAccess().getAliasAssignment_2_1(), "rule__Insert__AliasAssignment_2_1");
put(grammarAccess.getInsertAccess().getParametersAssignment_3_1(), "rule__Insert__ParametersAssignment_3_1");
put(grammarAccess.getParameterAccess().getNameAssignment_0(), "rule__Parameter__NameAssignment_0");
put(grammarAccess.getInsertAccess().getParametersAssignment_3_2_1(), "rule__Insert__ParametersAssignment_3_2_1");
put(grammarAccess.getParameterAccess().getValueAssignment_2(), "rule__Parameter__ValueAssignment_2");
put(grammarAccess.getNamedObjAccess().getNameAssignment(), "rule__NamedObj__NameAssignment");
put(grammarAccess.getConnectAccess().getFromAssignment_1(), "rule__Connect__FromAssignment_1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ ruleCommand
}
:
(
{ before(grammarAccess.getCommandAccess().getAlternatives()); }
(rule__Command__Alternatives)
{ after(grammarAccess.getCommandAccess().getAlternatives()); }
{ before(grammarAccess.getCommandAccess().getGroup()); }
(rule__Command__Group__0)
{ after(grammarAccess.getCommandAccess().getGroup()); }
)
;
finally {
Expand Down Expand Up @@ -582,21 +582,21 @@ finally {
restoreStackSize(stackSize);
}

rule__Command__Alternatives
rule__Command__Alternatives_0
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getCommandAccess().getInsertParserRuleCall_0()); }
{ before(grammarAccess.getCommandAccess().getInsertParserRuleCall_0_0()); }
ruleInsert
{ after(grammarAccess.getCommandAccess().getInsertParserRuleCall_0()); }
{ after(grammarAccess.getCommandAccess().getInsertParserRuleCall_0_0()); }
)
|
(
{ before(grammarAccess.getCommandAccess().getConnectParserRuleCall_1()); }
{ before(grammarAccess.getCommandAccess().getConnectParserRuleCall_0_1()); }
ruleConnect
{ after(grammarAccess.getCommandAccess().getConnectParserRuleCall_1()); }
{ after(grammarAccess.getCommandAccess().getConnectParserRuleCall_0_1()); }
)
;
finally {
Expand Down Expand Up @@ -714,6 +714,60 @@ finally {
restoreStackSize(stackSize);
}

rule__Command__Group__0
@init {
int stackSize = keepStackSize();
}
:
rule__Command__Group__0__Impl
rule__Command__Group__1
;
finally {
restoreStackSize(stackSize);
}

rule__Command__Group__0__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getCommandAccess().getAlternatives_0()); }
(rule__Command__Alternatives_0)
{ after(grammarAccess.getCommandAccess().getAlternatives_0()); }
)
;
finally {
restoreStackSize(stackSize);
}

rule__Command__Group__1
@init {
int stackSize = keepStackSize();
}
:
rule__Command__Group__1__Impl
;
finally {
restoreStackSize(stackSize);
}

rule__Command__Group__1__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getCommandAccess().getSemicolonKeyword_1()); }
';'
{ after(grammarAccess.getCommandAccess().getSemicolonKeyword_1()); }
)
;
finally {
restoreStackSize(stackSize);
}


rule__Insert__Group__0
@init {
int stackSize = keepStackSize();
Expand Down Expand Up @@ -909,6 +963,7 @@ rule__Insert__Group_3__1
}
:
rule__Insert__Group_3__1__Impl
rule__Insert__Group_3__2
;
finally {
restoreStackSize(stackSize);
Expand All @@ -921,14 +976,94 @@ rule__Insert__Group_3__1__Impl
:
(
{ before(grammarAccess.getInsertAccess().getParametersAssignment_3_1()); }
(rule__Insert__ParametersAssignment_3_1)*
(rule__Insert__ParametersAssignment_3_1)
{ after(grammarAccess.getInsertAccess().getParametersAssignment_3_1()); }
)
;
finally {
restoreStackSize(stackSize);
}

rule__Insert__Group_3__2
@init {
int stackSize = keepStackSize();
}
:
rule__Insert__Group_3__2__Impl
;
finally {
restoreStackSize(stackSize);
}

rule__Insert__Group_3__2__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getInsertAccess().getGroup_3_2()); }
(rule__Insert__Group_3_2__0)*
{ after(grammarAccess.getInsertAccess().getGroup_3_2()); }
)
;
finally {
restoreStackSize(stackSize);
}


rule__Insert__Group_3_2__0
@init {
int stackSize = keepStackSize();
}
:
rule__Insert__Group_3_2__0__Impl
rule__Insert__Group_3_2__1
;
finally {
restoreStackSize(stackSize);
}

rule__Insert__Group_3_2__0__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getInsertAccess().getCommaKeyword_3_2_0()); }
','
{ after(grammarAccess.getInsertAccess().getCommaKeyword_3_2_0()); }
)
;
finally {
restoreStackSize(stackSize);
}

rule__Insert__Group_3_2__1
@init {
int stackSize = keepStackSize();
}
:
rule__Insert__Group_3_2__1__Impl
;
finally {
restoreStackSize(stackSize);
}

rule__Insert__Group_3_2__1__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getInsertAccess().getParametersAssignment_3_2_1()); }
(rule__Insert__ParametersAssignment_3_2_1)
{ after(grammarAccess.getInsertAccess().getParametersAssignment_3_2_1()); }
)
;
finally {
restoreStackSize(stackSize);
}


rule__Parameter__Group__0
@init {
Expand All @@ -948,9 +1083,9 @@ rule__Parameter__Group__0__Impl
}
:
(
{ before(grammarAccess.getParameterAccess().getNameAssignment_0()); }
(rule__Parameter__NameAssignment_0)
{ after(grammarAccess.getParameterAccess().getNameAssignment_0()); }
{ before(grammarAccess.getParameterAccess().getNamedObjParserRuleCall_0()); }
ruleNamedObj
{ after(grammarAccess.getParameterAccess().getNamedObjParserRuleCall_0()); }
)
;
finally {
Expand Down Expand Up @@ -3003,9 +3138,9 @@ rule__Insert__ObjAssignment_1
}
:
(
{ before(grammarAccess.getInsertAccess().getObjQualifiedNameParserRuleCall_1_0()); }
ruleQualifiedName
{ after(grammarAccess.getInsertAccess().getObjQualifiedNameParserRuleCall_1_0()); }
{ before(grammarAccess.getInsertAccess().getObjNamedObjParserRuleCall_1_0()); }
ruleNamedObj
{ after(grammarAccess.getInsertAccess().getObjNamedObjParserRuleCall_1_0()); }
)
;
finally {
Expand Down Expand Up @@ -3042,15 +3177,15 @@ finally {
restoreStackSize(stackSize);
}

rule__Parameter__NameAssignment_0
rule__Insert__ParametersAssignment_3_2_1
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getParameterAccess().getNameQualifiedNameParserRuleCall_0_0()); }
ruleQualifiedName
{ after(grammarAccess.getParameterAccess().getNameQualifiedNameParserRuleCall_0_0()); }
{ before(grammarAccess.getInsertAccess().getParametersParameterParserRuleCall_3_2_1_0()); }
ruleParameter
{ after(grammarAccess.getInsertAccess().getParametersParameterParserRuleCall_3_2_1_0()); }
)
;
finally {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
'&'=27
'('=19
')'=20
'*'=29
','=21
'.'=24
';'=31
'<'=22
'='=13
'=>'=18
'>'=23
'?'=25
'['=16
']'=17
'as'=11
'connect'=14
'extends'=26
'&'=28
'('=21
')'=22
'*'=30
','=14
'.'=25
';'=10
'<'=23
'='=15
'=>'=20
'>'=24
'?'=26
'['=18
']'=19
'as'=12
'connect'=16
'extends'=27
'extension'=33
'import'=30
'insert'=10
'import'=31
'insert'=11
'static'=32
'super'=28
'to'=15
'with'=12
'super'=29
'to'=17
'with'=13
RULE_ANY_OTHER=9
RULE_ID=4
RULE_ML_COMMENT=6
Expand Down
Loading

0 comments on commit 259e330

Please sign in to comment.