- delete compiled classes
This commit is contained in:
parent
a2b405466b
commit
1035b7d227
107 changed files with 3 additions and 2059 deletions
1
utils/java/org.wesnoth.wml.ide.generator/.gitignore
vendored
Normal file
1
utils/java/org.wesnoth.wml.ide.generator/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin
|
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
* This is an example model
|
||||
*/
|
||||
type String
|
||||
|
||||
entity Leaf extends Composable {
|
||||
property name: String
|
||||
}
|
||||
|
||||
entity Composite extends Composable {
|
||||
property content: Composable[]
|
||||
}
|
||||
|
||||
entity Composable {
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
import wml;
|
||||
|
||||
listSubclasses(Entity this) :
|
||||
let subclasses = this.eRootContainer.eAllContents.typeSelect(Entity).select(e|e.extends == this).name:
|
||||
switch (subclasses.size) {
|
||||
case 0: "no subclasses"
|
||||
case 1: "subclass: " + subclasses.toString(", ")
|
||||
default: subclasses.size.toString() + " subclasses: " + subclasses.toString(", ")
|
||||
};
|
|
@ -1,11 +0,0 @@
|
|||
«IMPORT wml»;
|
||||
|
||||
«EXTENSION templates::Extensions»
|
||||
|
||||
«DEFINE main FOR Model-»
|
||||
«FILE "output.txt"-»
|
||||
«FOREACH this.elements.typeSelect(Entity).sortBy(e|e.name) AS e-»
|
||||
«e.name» has «e.listSubclasses()».
|
||||
«ENDFOREACH-»
|
||||
«ENDFILE-»
|
||||
«ENDDEFINE»
|
|
@ -1,20 +0,0 @@
|
|||
<workflow>
|
||||
<property name="modelFile" value="classpath:/model/MyModel.cfg"/>
|
||||
<property name="targetDir" value="src-gen"/>
|
||||
|
||||
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".."/>
|
||||
|
||||
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner" directory="${targetDir}"/>
|
||||
|
||||
<component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
|
||||
<!-- this class will be generated by the xtext generator -->
|
||||
<register class="org.wesnoth.WmlStandaloneSetup"/>
|
||||
</component>
|
||||
|
||||
<component class="org.eclipse.xpand2.Generator">
|
||||
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
|
||||
<fileEncoding value="Cp1252"/>
|
||||
<expand value="templates::Template::main FOR model"/>
|
||||
<genPath value="${targetDir}"/>
|
||||
</component>
|
||||
</workflow>
|
1
utils/java/org.wesnoth.wml.ide.ui/.gitignore
vendored
Normal file
1
utils/java/org.wesnoth.wml.ide.ui/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,928 +0,0 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
grammar InternalWml;
|
||||
|
||||
options {
|
||||
superClass=AbstractInternalContentAssistParser;
|
||||
|
||||
}
|
||||
|
||||
@lexer::header {
|
||||
package org.wesnoth.contentassist.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.ui.common.editor.contentassist.antlr.internal.Lexer;
|
||||
}
|
||||
|
||||
@parser::header {
|
||||
package org.wesnoth.contentassist.antlr.internal;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.xtext.parsetree.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.ui.common.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
|
||||
import org.wesnoth.services.WmlGrammarAccess;
|
||||
|
||||
}
|
||||
|
||||
@parser::members {
|
||||
|
||||
private WmlGrammarAccess grammarAccess;
|
||||
|
||||
public void setGrammarAccess(WmlGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Grammar getGrammar() {
|
||||
return grammarAccess.getGrammar();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getValueForTokenName(String tokenName) {
|
||||
return tokenName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleModel
|
||||
entryRuleModel :
|
||||
{ before(grammarAccess.getModelRule()); }
|
||||
ruleModel
|
||||
{ after(grammarAccess.getModelRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Model
|
||||
ruleModel
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getModelAccess().getGroup()); }
|
||||
(rule__Model__Group__0)
|
||||
{ after(grammarAccess.getModelAccess().getGroup()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleImport
|
||||
entryRuleImport :
|
||||
{ before(grammarAccess.getImportRule()); }
|
||||
ruleImport
|
||||
{ after(grammarAccess.getImportRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Import
|
||||
ruleImport
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getImportAccess().getGroup()); }
|
||||
(rule__Import__Group__0)
|
||||
{ after(grammarAccess.getImportAccess().getGroup()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleType
|
||||
entryRuleType :
|
||||
{ before(grammarAccess.getTypeRule()); }
|
||||
ruleType
|
||||
{ after(grammarAccess.getTypeRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Type
|
||||
ruleType
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getAlternatives()); }
|
||||
(rule__Type__Alternatives)
|
||||
{ after(grammarAccess.getTypeAccess().getAlternatives()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleSimpleType
|
||||
entryRuleSimpleType :
|
||||
{ before(grammarAccess.getSimpleTypeRule()); }
|
||||
ruleSimpleType
|
||||
{ after(grammarAccess.getSimpleTypeRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule SimpleType
|
||||
ruleSimpleType
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSimpleTypeAccess().getGroup()); }
|
||||
(rule__SimpleType__Group__0)
|
||||
{ after(grammarAccess.getSimpleTypeAccess().getGroup()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleCampaignType
|
||||
entryRuleCampaignType :
|
||||
{ before(grammarAccess.getCampaignTypeRule()); }
|
||||
ruleCampaignType
|
||||
{ after(grammarAccess.getCampaignTypeRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule CampaignType
|
||||
ruleCampaignType
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getCampaignTypeAccess().getGroup()); }
|
||||
(rule__CampaignType__Group__0)
|
||||
{ after(grammarAccess.getCampaignTypeAccess().getGroup()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleEntity
|
||||
entryRuleEntity :
|
||||
{ before(grammarAccess.getEntityRule()); }
|
||||
ruleEntity
|
||||
{ after(grammarAccess.getEntityRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Entity
|
||||
ruleEntity
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getGroup()); }
|
||||
(rule__Entity__Group__0)
|
||||
{ after(grammarAccess.getEntityAccess().getGroup()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleProperty
|
||||
entryRuleProperty :
|
||||
{ before(grammarAccess.getPropertyRule()); }
|
||||
ruleProperty
|
||||
{ after(grammarAccess.getPropertyRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Property
|
||||
ruleProperty
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getGroup()); }
|
||||
(rule__Property__Group__0)
|
||||
{ after(grammarAccess.getPropertyAccess().getGroup()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
rule__Type__Alternatives
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getSimpleTypeParserRuleCall_0()); }
|
||||
ruleSimpleType
|
||||
{ after(grammarAccess.getTypeAccess().getSimpleTypeParserRuleCall_0()); }
|
||||
)
|
||||
|
||||
|(
|
||||
{ before(grammarAccess.getTypeAccess().getEntityParserRuleCall_1()); }
|
||||
ruleEntity
|
||||
{ after(grammarAccess.getTypeAccess().getEntityParserRuleCall_1()); }
|
||||
)
|
||||
|
||||
|(
|
||||
{ before(grammarAccess.getTypeAccess().getCampaignTypeParserRuleCall_2()); }
|
||||
ruleCampaignType
|
||||
{ after(grammarAccess.getTypeAccess().getCampaignTypeParserRuleCall_2()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
rule__Model__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getModelAccess().getImportsAssignment_0()); }
|
||||
(rule__Model__ImportsAssignment_0)*
|
||||
{ after(grammarAccess.getModelAccess().getImportsAssignment_0()); }
|
||||
)
|
||||
|
||||
rule__Model__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Model__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getModelAccess().getElementsAssignment_1()); }
|
||||
(rule__Model__ElementsAssignment_1)*
|
||||
{ after(grammarAccess.getModelAccess().getElementsAssignment_1()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rule__Import__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getImportAccess().getImportKeyword_0()); }
|
||||
|
||||
'import'
|
||||
|
||||
{ after(grammarAccess.getImportAccess().getImportKeyword_0()); }
|
||||
)
|
||||
|
||||
rule__Import__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Import__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getImportAccess().getImportURIAssignment_1()); }
|
||||
(rule__Import__ImportURIAssignment_1)
|
||||
{ after(grammarAccess.getImportAccess().getImportURIAssignment_1()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rule__SimpleType__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSimpleTypeAccess().getTypeKeyword_0()); }
|
||||
|
||||
'type'
|
||||
|
||||
{ after(grammarAccess.getSimpleTypeAccess().getTypeKeyword_0()); }
|
||||
)
|
||||
|
||||
rule__SimpleType__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__SimpleType__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSimpleTypeAccess().getNameAssignment_1()); }
|
||||
(rule__SimpleType__NameAssignment_1)
|
||||
{ after(grammarAccess.getSimpleTypeAccess().getNameAssignment_1()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rule__CampaignType__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getCampaignTypeAccess().getCampaignKeyword_0()); }
|
||||
|
||||
'[campaign]'
|
||||
|
||||
{ after(grammarAccess.getCampaignTypeAccess().getCampaignKeyword_0()); }
|
||||
)
|
||||
|
||||
rule__CampaignType__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__CampaignType__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getCampaignTypeAccess().getNameAssignment_1()); }
|
||||
(rule__CampaignType__NameAssignment_1)?
|
||||
{ after(grammarAccess.getCampaignTypeAccess().getNameAssignment_1()); }
|
||||
)
|
||||
|
||||
rule__CampaignType__Group__2
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__CampaignType__Group__2
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getCampaignTypeAccess().getCampaignKeyword_2()); }
|
||||
|
||||
'[/campaign]'
|
||||
|
||||
{ after(grammarAccess.getCampaignTypeAccess().getCampaignKeyword_2()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rule__Entity__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getEntityKeyword_0()); }
|
||||
|
||||
'entity'
|
||||
|
||||
{ after(grammarAccess.getEntityAccess().getEntityKeyword_0()); }
|
||||
)
|
||||
|
||||
rule__Entity__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Entity__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getNameAssignment_1()); }
|
||||
(rule__Entity__NameAssignment_1)
|
||||
{ after(grammarAccess.getEntityAccess().getNameAssignment_1()); }
|
||||
)
|
||||
|
||||
rule__Entity__Group__2
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Entity__Group__2
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getGroup_2()); }
|
||||
(rule__Entity__Group_2__0)?
|
||||
{ after(grammarAccess.getEntityAccess().getGroup_2()); }
|
||||
)
|
||||
|
||||
rule__Entity__Group__3
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Entity__Group__3
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getLeftCurlyBracketKeyword_3()); }
|
||||
|
||||
'{'
|
||||
|
||||
{ after(grammarAccess.getEntityAccess().getLeftCurlyBracketKeyword_3()); }
|
||||
)
|
||||
|
||||
rule__Entity__Group__4
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Entity__Group__4
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getPropertiesAssignment_4()); }
|
||||
(rule__Entity__PropertiesAssignment_4)*
|
||||
{ after(grammarAccess.getEntityAccess().getPropertiesAssignment_4()); }
|
||||
)
|
||||
|
||||
rule__Entity__Group__5
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Entity__Group__5
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getRightCurlyBracketKeyword_5()); }
|
||||
|
||||
'}'
|
||||
|
||||
{ after(grammarAccess.getEntityAccess().getRightCurlyBracketKeyword_5()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rule__Entity__Group_2__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getExtendsKeyword_2_0()); }
|
||||
|
||||
'extends'
|
||||
|
||||
{ after(grammarAccess.getEntityAccess().getExtendsKeyword_2_0()); }
|
||||
)
|
||||
|
||||
rule__Entity__Group_2__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Entity__Group_2__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getExtendsAssignment_2_1()); }
|
||||
(rule__Entity__ExtendsAssignment_2_1)
|
||||
{ after(grammarAccess.getEntityAccess().getExtendsAssignment_2_1()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rule__Property__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getPropertyKeyword_0()); }
|
||||
|
||||
'property'
|
||||
|
||||
{ after(grammarAccess.getPropertyAccess().getPropertyKeyword_0()); }
|
||||
)
|
||||
|
||||
rule__Property__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Property__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getNameAssignment_1()); }
|
||||
(rule__Property__NameAssignment_1)
|
||||
{ after(grammarAccess.getPropertyAccess().getNameAssignment_1()); }
|
||||
)
|
||||
|
||||
rule__Property__Group__2
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Property__Group__2
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getColonKeyword_2()); }
|
||||
|
||||
':'
|
||||
|
||||
{ after(grammarAccess.getPropertyAccess().getColonKeyword_2()); }
|
||||
)
|
||||
|
||||
rule__Property__Group__3
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Property__Group__3
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getTypeAssignment_3()); }
|
||||
(rule__Property__TypeAssignment_3)
|
||||
{ after(grammarAccess.getPropertyAccess().getTypeAssignment_3()); }
|
||||
)
|
||||
|
||||
rule__Property__Group__4
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Property__Group__4
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getManyAssignment_4()); }
|
||||
(rule__Property__ManyAssignment_4)?
|
||||
{ after(grammarAccess.getPropertyAccess().getManyAssignment_4()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rule__Model__ImportsAssignment_0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getModelAccess().getImportsImportParserRuleCall_0_0()); }
|
||||
ruleImport{ after(grammarAccess.getModelAccess().getImportsImportParserRuleCall_0_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Model__ElementsAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getModelAccess().getElementsTypeParserRuleCall_1_0()); }
|
||||
ruleType{ after(grammarAccess.getModelAccess().getElementsTypeParserRuleCall_1_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Import__ImportURIAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getImportAccess().getImportURISTRINGTerminalRuleCall_1_0()); }
|
||||
RULE_STRING{ after(grammarAccess.getImportAccess().getImportURISTRINGTerminalRuleCall_1_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SimpleType__NameAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSimpleTypeAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
RULE_ID{ after(grammarAccess.getSimpleTypeAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__CampaignType__NameAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getCampaignTypeAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
RULE_ID{ after(grammarAccess.getCampaignTypeAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Entity__NameAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
RULE_ID{ after(grammarAccess.getEntityAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Entity__ExtendsAssignment_2_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getExtendsEntityCrossReference_2_1_0()); }
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getExtendsEntityIDTerminalRuleCall_2_1_0_1()); }
|
||||
RULE_ID{ after(grammarAccess.getEntityAccess().getExtendsEntityIDTerminalRuleCall_2_1_0_1()); }
|
||||
)
|
||||
{ after(grammarAccess.getEntityAccess().getExtendsEntityCrossReference_2_1_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Entity__PropertiesAssignment_4
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getEntityAccess().getPropertiesPropertyParserRuleCall_4_0()); }
|
||||
ruleProperty{ after(grammarAccess.getEntityAccess().getPropertiesPropertyParserRuleCall_4_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Property__NameAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
RULE_ID{ after(grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Property__TypeAssignment_3
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getTypeTypeCrossReference_3_0()); }
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getTypeTypeIDTerminalRuleCall_3_0_1()); }
|
||||
RULE_ID{ after(grammarAccess.getPropertyAccess().getTypeTypeIDTerminalRuleCall_3_0_1()); }
|
||||
)
|
||||
{ after(grammarAccess.getPropertyAccess().getTypeTypeCrossReference_3_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Property__ManyAssignment_4
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_0()); }
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_0()); }
|
||||
|
||||
'[]'
|
||||
|
||||
{ after(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_0()); }
|
||||
)
|
||||
|
||||
{ after(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_0()); }
|
||||
)
|
||||
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
RULE_STRING : ('"' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'"')))* '"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'\'')))* '\'');
|
||||
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
RULE_ANY_OTHER : .;
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
RULE_ID=5
|
||||
RULE_STRING=4
|
||||
RULE_ANY_OTHER=10
|
||||
RULE_INT=6
|
||||
RULE_WS=9
|
||||
RULE_SL_COMMENT=8
|
||||
RULE_ML_COMMENT=7
|
||||
'property'=19
|
||||
'entity'=15
|
||||
'}'=17
|
||||
':'=20
|
||||
'extends'=18
|
||||
'type'=12
|
||||
'{'=16
|
||||
'[/campaign]'=14
|
||||
'[campaign]'=13
|
||||
'[]'=21
|
||||
'import'=11
|
Binary file not shown.
Binary file not shown.
|
@ -1,43 +0,0 @@
|
|||
lexer grammar InternalWml;
|
||||
@header {
|
||||
package org.wesnoth.contentassist.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.ui.common.editor.contentassist.antlr.internal.Lexer;
|
||||
}
|
||||
|
||||
T11 : 'import' ;
|
||||
T12 : 'type' ;
|
||||
T13 : '[campaign]' ;
|
||||
T14 : '[/campaign]' ;
|
||||
T15 : 'entity' ;
|
||||
T16 : '{' ;
|
||||
T17 : '}' ;
|
||||
T18 : 'extends' ;
|
||||
T19 : 'property' ;
|
||||
T20 : ':' ;
|
||||
T21 : '[]' ;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide.ui/src-gen/org/wesnoth/contentassist/antlr/internal/InternalWml.g" 914
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide.ui/src-gen/org/wesnoth/contentassist/antlr/internal/InternalWml.g" 916
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide.ui/src-gen/org/wesnoth/contentassist/antlr/internal/InternalWml.g" 918
|
||||
RULE_STRING : ('"' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'"')))* '"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'\'')))* '\'');
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide.ui/src-gen/org/wesnoth/contentassist/antlr/internal/InternalWml.g" 920
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide.ui/src-gen/org/wesnoth/contentassist/antlr/internal/InternalWml.g" 922
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide.ui/src-gen/org/wesnoth/contentassist/antlr/internal/InternalWml.g" 924
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide.ui/src-gen/org/wesnoth/contentassist/antlr/internal/InternalWml.g" 926
|
||||
RULE_ANY_OTHER : .;
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
utils/java/org.wesnoth.wml.ide/.gitignore
vendored
Normal file
1
utils/java/org.wesnoth.wml.ide/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin
|
Binary file not shown.
|
@ -1,77 +0,0 @@
|
|||
<workflow>
|
||||
<property file="org/wesnoth/GenerateWml.properties"/>
|
||||
|
||||
<property name="runtimeProject" value="../${projectName}"/>
|
||||
|
||||
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri="${runtimeProject}/.."/>
|
||||
|
||||
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner" directory="${runtimeProject}/src-gen"/>
|
||||
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner" directory="${runtimeProject}.ui/src-gen"/>
|
||||
|
||||
<component class="org.eclipse.xtext.generator.Generator">
|
||||
<pathRtProject value="${runtimeProject}"/>
|
||||
<pathUiProject value="${runtimeProject}.ui"/>
|
||||
<projectNameRt value="${projectName}"/>
|
||||
<projectNameUi value="${projectName}.ui"/>
|
||||
|
||||
<language uri="${grammarURI}" fileExtensions="${file.extensions}">
|
||||
<!-- Java API to access grammar elements (required by several other fragments) -->
|
||||
<fragment class="org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment"/>
|
||||
|
||||
<!-- generates Java API for the generated EPackages -->
|
||||
<fragment class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment"/>
|
||||
|
||||
<!-- the serialization component -->
|
||||
<fragment class="org.eclipse.xtext.generator.parseTreeConstructor.ParseTreeConstructorFragment"/>
|
||||
|
||||
<!-- a custom ResourceFactory for use with EMF -->
|
||||
<fragment class="org.eclipse.xtext.generator.resourceFactory.ResourceFactoryFragment"
|
||||
fileExtensions="${file.extensions}"/>
|
||||
|
||||
<!-- the following fragment tries to use the Antlr Generator fragment which can be installed via update manager from http://download.itemis.com/updates/ -->
|
||||
<fragment class="org.eclipse.xtext.generator.AntlrDelegatingFragment" />
|
||||
|
||||
<!-- If you don't want to use the Antlr fragment for some reason, remove the antlr fragment and uncomment the packrat parser fragment below.
|
||||
<fragment class="org.eclipse.xtext.generator.parser.PackratParserFragment"/>
|
||||
-->
|
||||
|
||||
|
||||
<!-- java-based API for validation -->
|
||||
<fragment class="org.eclipse.xtext.generator.validation.JavaValidatorFragment">
|
||||
<composedCheck value="org.eclipse.xtext.validation.ImportUriValidator"/>
|
||||
</fragment>
|
||||
|
||||
|
||||
<!-- scoping API -->
|
||||
<fragment class="org.eclipse.xtext.generator.scoping.JavaScopingFragment"/>
|
||||
|
||||
<!-- formatter API -->
|
||||
<fragment class="org.eclipse.xtext.generator.formatting.FormatterFragment"/>
|
||||
|
||||
<!-- labeling API -->
|
||||
<fragment class="org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment"/>
|
||||
|
||||
<!-- outline API -->
|
||||
<fragment class="org.eclipse.xtext.ui.generator.outline.TransformerFragment"/>
|
||||
<fragment class="org.eclipse.xtext.ui.generator.outline.OutlineNodeAdapterFactoryFragment"/>
|
||||
|
||||
|
||||
<!-- java-based API for content assistance -->
|
||||
<fragment class="org.eclipse.xtext.ui.generator.contentAssist.JavaBasedContentAssistFragment"/>
|
||||
<!-- the following fragment tries to use the Antlr based content assist fragment which can be downloaded from http://www.itemis.com
|
||||
and will be ignored if it's not available. -->
|
||||
<fragment class="org.eclipse.xtext.generator.DelegatingGeneratorFragment"
|
||||
delegate="de.itemis.xtext.antlr.XtextAntlrUiGeneratorFragment"
|
||||
message="You are generating without ANTLR. It is highly recommended to download and use the plugin 'de.itemis.xtext.antlr' \n\t using the update site http://download.itemis.com/updates/.">
|
||||
</fragment>
|
||||
<!-- <fragment class="de.itemis.xtext.antlr.XtextAntlrUiGeneratorFragment"/> -->
|
||||
|
||||
|
||||
<!-- project wizard (optional) -->
|
||||
<!--
|
||||
<fragment class="org.eclipse.xtext.ui.generator.projectWizard.SimpleProjectWizardFragment"
|
||||
generatorProjectName="${projectName}.generator" modelFileExtension="cfg"/>
|
||||
-->
|
||||
</language>
|
||||
</component>
|
||||
</workflow>
|
|
@ -1,3 +0,0 @@
|
|||
grammarURI=classpath:/org/wesnoth/Wml.xtext
|
||||
file.extensions=cfg
|
||||
projectName=org.wesnoth.wml.ide
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ecore:EPackage xmi:version="2.0"
|
||||
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="wml"
|
||||
nsURI="http://www.wesnoth.org/Wml" nsPrefix="wml">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Model">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="imports" upperBound="-1"
|
||||
eType="#//Import" containment="true"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="elements" upperBound="-1"
|
||||
eType="#//Type" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Import">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="importURI" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Type">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="SimpleType" eSuperTypes="#//Type"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="CampaignType" eSuperTypes="#//Type"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Entity" eSuperTypes="#//Type">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="extends" eType="#//Entity"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="properties" upperBound="-1"
|
||||
eType="#//Property" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Property">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="#//Type"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="many" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
|
||||
</eClassifiers>
|
||||
</ecore:EPackage>
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<genmodel:GenModel xmi:version="2.0"
|
||||
xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
|
||||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.wesnoth.wml.ide/src-gen"
|
||||
editDirectory="/org.wesnoth.wml.ide.edit/src" editorDirectory="/org.wesnoth.wml.ide.editor/src"
|
||||
modelPluginID="org.wesnoth.wml.ide" forceOverwrite="true" modelName="Wml" updateClasspath="false"
|
||||
rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" complianceLevel="5.0"
|
||||
copyrightFields="false" editPluginID="org.wesnoth.wml.ide.edit" editorPluginID="org.wesnoth.wml.ide.editor">
|
||||
<genPackages prefix="Wml" basePackage="org.wesnoth" disposableProviderFactory="true"
|
||||
ecorePackage="Wml.ecore#/">
|
||||
<genClasses ecoreClass="Wml.ecore#//Model">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Wml.ecore#//Model/imports"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Wml.ecore#//Model/elements"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="Wml.ecore#//Import">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Wml.ecore#//Import/importURI"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="Wml.ecore#//Type">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Wml.ecore#//Type/name"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="Wml.ecore#//SimpleType"/>
|
||||
<genClasses ecoreClass="Wml.ecore#//CampaignType"/>
|
||||
<genClasses ecoreClass="Wml.ecore#//Entity">
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Wml.ecore#//Entity/extends"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Wml.ecore#//Entity/properties"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="Wml.ecore#//Property">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Wml.ecore#//Property/name"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Wml.ecore#//Property/type"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Wml.ecore#//Property/many"/>
|
||||
</genClasses>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
|
@ -1,266 +0,0 @@
|
|||
<?xml version="1.0" encoding="ASCII"?>
|
||||
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:xtext="http://www.eclipse.org/2008/Xtext">
|
||||
<xtext:Grammar name="org.wesnoth.Wml" usedGrammars="/1">
|
||||
<metamodelDeclarations xsi:type="xtext:GeneratedMetamodel" name="wml">
|
||||
<ePackage href="http://www.wesnoth.org/Wml#/"/>
|
||||
</metamodelDeclarations>
|
||||
<rules xsi:type="xtext:ParserRule" name="Model">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//Model"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Assignment" cardinality="*" feature="imports" operator="+=">
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.1"/>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Assignment" cardinality="*" feature="elements" operator="+=">
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.2"/>
|
||||
</tokens>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:ParserRule" name="Import">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//Import"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="import"/>
|
||||
<tokens xsi:type="xtext:Assignment" feature="importURI" operator="=">
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.2"/>
|
||||
</tokens>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:ParserRule" name="Type">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//Type"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Alternatives">
|
||||
<groups xsi:type="xtext:RuleCall" rule="/0/@rules.3"/>
|
||||
<groups xsi:type="xtext:RuleCall" rule="/0/@rules.5"/>
|
||||
<groups xsi:type="xtext:RuleCall" rule="/0/@rules.4"/>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:ParserRule" name="SimpleType">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//SimpleType"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="type"/>
|
||||
<tokens xsi:type="xtext:Assignment" feature="name" operator="=">
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
|
||||
</tokens>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:ParserRule" name="CampaignType">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//CampaignType"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="[campaign]"/>
|
||||
<tokens xsi:type="xtext:Assignment" cardinality="?" feature="name" operator="=">
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Keyword" value="[/campaign]"/>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:ParserRule" name="Entity">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//Entity"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="entity"/>
|
||||
<tokens xsi:type="xtext:Assignment" feature="name" operator="=">
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Group" cardinality="?">
|
||||
<tokens xsi:type="xtext:Keyword" value="extends"/>
|
||||
<tokens xsi:type="xtext:Assignment" feature="extends" operator="=">
|
||||
<terminal xsi:type="xtext:CrossReference">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//Entity"/>
|
||||
</type>
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
|
||||
</terminal>
|
||||
</tokens>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Keyword" value="{"/>
|
||||
<tokens xsi:type="xtext:Assignment" cardinality="*" feature="properties" operator="+=">
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.6"/>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Keyword" value="}"/>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:ParserRule" name="Property">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//Property"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="property"/>
|
||||
<tokens xsi:type="xtext:Assignment" feature="name" operator="=">
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Keyword" value=":"/>
|
||||
<tokens xsi:type="xtext:Assignment" feature="type" operator="=">
|
||||
<terminal xsi:type="xtext:CrossReference">
|
||||
<type metamodel="/0/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/Wml#//Type"/>
|
||||
</type>
|
||||
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
|
||||
</terminal>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Assignment" cardinality="?" feature="many" operator="?=">
|
||||
<terminal xsi:type="xtext:Keyword" value="[]"/>
|
||||
</tokens>
|
||||
</alternatives>
|
||||
</rules>
|
||||
</xtext:Grammar>
|
||||
<xtext:Grammar name="org.eclipse.xtext.common.Terminals" definesHiddenTokens="true" hiddenTokens="/1/@rules.5 /1/@rules.3 /1/@rules.4">
|
||||
<metamodelDeclarations xsi:type="xtext:ReferencedMetamodel" alias="ecore">
|
||||
<ePackage href="http://www.eclipse.org/emf/2002/Ecore#/"/>
|
||||
</metamodelDeclarations>
|
||||
<rules xsi:type="xtext:TerminalRule" name="ID">
|
||||
<type metamodel="/1/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" cardinality="?" value="^"/>
|
||||
<tokens xsi:type="xtext:Alternatives">
|
||||
<groups xsi:type="xtext:CharacterRange">
|
||||
<left value="a"/>
|
||||
<right value="z"/>
|
||||
</groups>
|
||||
<groups xsi:type="xtext:CharacterRange">
|
||||
<left value="A"/>
|
||||
<right value="Z"/>
|
||||
</groups>
|
||||
<groups xsi:type="xtext:Keyword" value="_"/>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Alternatives" cardinality="*">
|
||||
<groups xsi:type="xtext:CharacterRange">
|
||||
<left value="a"/>
|
||||
<right value="z"/>
|
||||
</groups>
|
||||
<groups xsi:type="xtext:CharacterRange">
|
||||
<left value="A"/>
|
||||
<right value="Z"/>
|
||||
</groups>
|
||||
<groups xsi:type="xtext:Keyword" value="_"/>
|
||||
<groups xsi:type="xtext:CharacterRange">
|
||||
<left value="0"/>
|
||||
<right value="9"/>
|
||||
</groups>
|
||||
</tokens>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:TerminalRule" name="INT">
|
||||
<type metamodel="/1/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:CharacterRange" cardinality="+">
|
||||
<left value="0"/>
|
||||
<right value="9"/>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:TerminalRule" name="STRING">
|
||||
<type metamodel="/1/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Alternatives">
|
||||
<groups xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="""/>
|
||||
<tokens xsi:type="xtext:Alternatives" cardinality="*">
|
||||
<groups xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="\"/>
|
||||
<tokens xsi:type="xtext:Alternatives">
|
||||
<groups xsi:type="xtext:Keyword" value="b"/>
|
||||
<groups xsi:type="xtext:Keyword" value="t"/>
|
||||
<groups xsi:type="xtext:Keyword" value="n"/>
|
||||
<groups xsi:type="xtext:Keyword" value="f"/>
|
||||
<groups xsi:type="xtext:Keyword" value="r"/>
|
||||
<groups xsi:type="xtext:Keyword" value="""/>
|
||||
<groups xsi:type="xtext:Keyword" value="'"/>
|
||||
<groups xsi:type="xtext:Keyword" value="\"/>
|
||||
</tokens>
|
||||
</groups>
|
||||
<groups xsi:type="xtext:NegatedToken">
|
||||
<terminal xsi:type="xtext:Alternatives">
|
||||
<groups xsi:type="xtext:Keyword" value="\"/>
|
||||
<groups xsi:type="xtext:Keyword" value="""/>
|
||||
</terminal>
|
||||
</groups>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Keyword" value="""/>
|
||||
</groups>
|
||||
<groups xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="'"/>
|
||||
<tokens xsi:type="xtext:Alternatives" cardinality="*">
|
||||
<groups xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="\"/>
|
||||
<tokens xsi:type="xtext:Alternatives">
|
||||
<groups xsi:type="xtext:Keyword" value="b"/>
|
||||
<groups xsi:type="xtext:Keyword" value="t"/>
|
||||
<groups xsi:type="xtext:Keyword" value="n"/>
|
||||
<groups xsi:type="xtext:Keyword" value="f"/>
|
||||
<groups xsi:type="xtext:Keyword" value="r"/>
|
||||
<groups xsi:type="xtext:Keyword" value="""/>
|
||||
<groups xsi:type="xtext:Keyword" value="'"/>
|
||||
<groups xsi:type="xtext:Keyword" value="\"/>
|
||||
</tokens>
|
||||
</groups>
|
||||
<groups xsi:type="xtext:NegatedToken">
|
||||
<terminal xsi:type="xtext:Alternatives">
|
||||
<groups xsi:type="xtext:Keyword" value="\"/>
|
||||
<groups xsi:type="xtext:Keyword" value="'"/>
|
||||
</terminal>
|
||||
</groups>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Keyword" value="'"/>
|
||||
</groups>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:TerminalRule" name="ML_COMMENT">
|
||||
<type metamodel="/1/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="/*"/>
|
||||
<tokens xsi:type="xtext:UntilToken">
|
||||
<terminal xsi:type="xtext:Keyword" value="*/"/>
|
||||
</tokens>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:TerminalRule" name="SL_COMMENT">
|
||||
<type metamodel="/1/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Group">
|
||||
<tokens xsi:type="xtext:Keyword" value="//"/>
|
||||
<tokens xsi:type="xtext:NegatedToken" cardinality="*">
|
||||
<terminal xsi:type="xtext:Alternatives">
|
||||
<groups xsi:type="xtext:Keyword" value="
"/>
|
||||
<groups xsi:type="xtext:Keyword" value="
"/>
|
||||
</terminal>
|
||||
</tokens>
|
||||
<tokens xsi:type="xtext:Group" cardinality="?">
|
||||
<tokens xsi:type="xtext:Keyword" cardinality="?" value="
"/>
|
||||
<tokens xsi:type="xtext:Keyword" value="
"/>
|
||||
</tokens>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:TerminalRule" name="WS">
|
||||
<type metamodel="/1/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Alternatives" cardinality="+">
|
||||
<groups xsi:type="xtext:Keyword" value=" "/>
|
||||
<groups xsi:type="xtext:Keyword" value="	"/>
|
||||
<groups xsi:type="xtext:Keyword" value="
"/>
|
||||
<groups xsi:type="xtext:Keyword" value="
"/>
|
||||
</alternatives>
|
||||
</rules>
|
||||
<rules xsi:type="xtext:TerminalRule" name="ANY_OTHER">
|
||||
<type metamodel="/1/@metamodelDeclarations.0">
|
||||
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</type>
|
||||
<alternatives xsi:type="xtext:Wildcard"/>
|
||||
</rules>
|
||||
</xtext:Grammar>
|
||||
</xmi:XMI>
|
|
@ -1,28 +0,0 @@
|
|||
grammar org.wesnoth.Wml with org.eclipse.xtext.common.Terminals
|
||||
|
||||
generate wml "http://www.wesnoth.org/Wml"
|
||||
|
||||
Model :
|
||||
(imports+=Import)*
|
||||
(elements+=Type)*;
|
||||
|
||||
Import :
|
||||
'import' importURI=STRING;
|
||||
|
||||
Type:
|
||||
SimpleType | Entity | CampaignType;
|
||||
|
||||
SimpleType:
|
||||
'type' name=ID;
|
||||
|
||||
CampaignType:
|
||||
'[campaign]' (name=ID)? '[/campaign]';
|
||||
|
||||
Entity :
|
||||
'entity' name=ID ('extends' extends=[Entity])? '{'
|
||||
properties+=Property*
|
||||
'}';
|
||||
|
||||
Property:
|
||||
'property' name=ID ':' type=[Type] (many?='[]')?;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,517 +0,0 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
grammar InternalWml;
|
||||
|
||||
options {
|
||||
superClass=AbstractInternalAntlrParser;
|
||||
|
||||
}
|
||||
|
||||
@lexer::header {
|
||||
package org.wesnoth.parser.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
}
|
||||
|
||||
@parser::header {
|
||||
package org.wesnoth.parser.antlr.internal;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.xtext.parsetree.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
|
||||
import org.eclipse.xtext.conversion.ValueConverterException;
|
||||
import org.wesnoth.services.WmlGrammarAccess;
|
||||
|
||||
}
|
||||
|
||||
@parser::members {
|
||||
|
||||
private WmlGrammarAccess grammarAccess;
|
||||
|
||||
public InternalWmlParser(TokenStream input, IAstFactory factory, WmlGrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.factory = factory;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InputStream getTokenFile() {
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
return classLoader.getResourceAsStream("org/wesnoth/parser/antlr/internal/InternalWml.tokens");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "Model";
|
||||
}
|
||||
}
|
||||
|
||||
@rulecatch {
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleModel
|
||||
entryRuleModel returns [EObject current=null] :
|
||||
{ currentNode = createCompositeNode(grammarAccess.getModelRule(), currentNode); }
|
||||
iv_ruleModel=ruleModel
|
||||
{ $current=$iv_ruleModel.current; }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Model
|
||||
ruleModel returns [EObject current=null]
|
||||
@init { EObject temp=null; setCurrentLookahead(); resetLookahead();
|
||||
}
|
||||
@after { resetLookahead();
|
||||
lastConsumedNode = currentNode;
|
||||
}:
|
||||
((
|
||||
|
||||
|
||||
{
|
||||
currentNode=createCompositeNode(grammarAccess.getModelAccess().getImportsImportParserRuleCall_0_0(), currentNode);
|
||||
}
|
||||
lv_imports_0=ruleImport
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode.getParent(), $current);
|
||||
}
|
||||
|
||||
try {
|
||||
add($current, "imports", lv_imports_0, "Import", currentNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
currentNode = currentNode.getParent();
|
||||
}
|
||||
|
||||
)*(
|
||||
|
||||
|
||||
{
|
||||
currentNode=createCompositeNode(grammarAccess.getModelAccess().getElementsTypeParserRuleCall_1_0(), currentNode);
|
||||
}
|
||||
lv_elements_1=ruleType
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode.getParent(), $current);
|
||||
}
|
||||
|
||||
try {
|
||||
add($current, "elements", lv_elements_1, "Type", currentNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
currentNode = currentNode.getParent();
|
||||
}
|
||||
|
||||
)*);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleImport
|
||||
entryRuleImport returns [EObject current=null] :
|
||||
{ currentNode = createCompositeNode(grammarAccess.getImportRule(), currentNode); }
|
||||
iv_ruleImport=ruleImport
|
||||
{ $current=$iv_ruleImport.current; }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Import
|
||||
ruleImport returns [EObject current=null]
|
||||
@init { EObject temp=null; setCurrentLookahead(); resetLookahead();
|
||||
}
|
||||
@after { resetLookahead();
|
||||
lastConsumedNode = currentNode;
|
||||
}:
|
||||
('import'
|
||||
{
|
||||
createLeafNode(grammarAccess.getImportAccess().getImportKeyword_0(), null);
|
||||
}
|
||||
(
|
||||
|
||||
lv_importURI_1= RULE_STRING
|
||||
{
|
||||
createLeafNode(grammarAccess.getImportAccess().getImportURISTRINGTerminalRuleCall_1_0(), "importURI");
|
||||
}
|
||||
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getImportRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode, $current);
|
||||
}
|
||||
|
||||
try {
|
||||
set($current, "importURI", lv_importURI_1, "STRING", lastConsumedNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
}
|
||||
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleType
|
||||
entryRuleType returns [EObject current=null] :
|
||||
{ currentNode = createCompositeNode(grammarAccess.getTypeRule(), currentNode); }
|
||||
iv_ruleType=ruleType
|
||||
{ $current=$iv_ruleType.current; }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Type
|
||||
ruleType returns [EObject current=null]
|
||||
@init { EObject temp=null; setCurrentLookahead(); resetLookahead();
|
||||
}
|
||||
@after { resetLookahead();
|
||||
lastConsumedNode = currentNode;
|
||||
}:
|
||||
(
|
||||
{
|
||||
currentNode=createCompositeNode(grammarAccess.getTypeAccess().getSimpleTypeParserRuleCall_0(), currentNode);
|
||||
}
|
||||
this_SimpleType_0=ruleSimpleType
|
||||
{
|
||||
$current = $this_SimpleType_0.current;
|
||||
currentNode = currentNode.getParent();
|
||||
}
|
||||
|
||||
|
|
||||
{
|
||||
currentNode=createCompositeNode(grammarAccess.getTypeAccess().getEntityParserRuleCall_1(), currentNode);
|
||||
}
|
||||
this_Entity_1=ruleEntity
|
||||
{
|
||||
$current = $this_Entity_1.current;
|
||||
currentNode = currentNode.getParent();
|
||||
}
|
||||
|
||||
|
|
||||
{
|
||||
currentNode=createCompositeNode(grammarAccess.getTypeAccess().getCampaignTypeParserRuleCall_2(), currentNode);
|
||||
}
|
||||
this_CampaignType_2=ruleCampaignType
|
||||
{
|
||||
$current = $this_CampaignType_2.current;
|
||||
currentNode = currentNode.getParent();
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleSimpleType
|
||||
entryRuleSimpleType returns [EObject current=null] :
|
||||
{ currentNode = createCompositeNode(grammarAccess.getSimpleTypeRule(), currentNode); }
|
||||
iv_ruleSimpleType=ruleSimpleType
|
||||
{ $current=$iv_ruleSimpleType.current; }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule SimpleType
|
||||
ruleSimpleType returns [EObject current=null]
|
||||
@init { EObject temp=null; setCurrentLookahead(); resetLookahead();
|
||||
}
|
||||
@after { resetLookahead();
|
||||
lastConsumedNode = currentNode;
|
||||
}:
|
||||
('type'
|
||||
{
|
||||
createLeafNode(grammarAccess.getSimpleTypeAccess().getTypeKeyword_0(), null);
|
||||
}
|
||||
(
|
||||
|
||||
lv_name_1= RULE_ID
|
||||
{
|
||||
createLeafNode(grammarAccess.getSimpleTypeAccess().getNameIDTerminalRuleCall_1_0(), "name");
|
||||
}
|
||||
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getSimpleTypeRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode, $current);
|
||||
}
|
||||
|
||||
try {
|
||||
set($current, "name", lv_name_1, "ID", lastConsumedNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
}
|
||||
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleCampaignType
|
||||
entryRuleCampaignType returns [EObject current=null] :
|
||||
{ currentNode = createCompositeNode(grammarAccess.getCampaignTypeRule(), currentNode); }
|
||||
iv_ruleCampaignType=ruleCampaignType
|
||||
{ $current=$iv_ruleCampaignType.current; }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule CampaignType
|
||||
ruleCampaignType returns [EObject current=null]
|
||||
@init { EObject temp=null; setCurrentLookahead(); resetLookahead();
|
||||
}
|
||||
@after { resetLookahead();
|
||||
lastConsumedNode = currentNode;
|
||||
}:
|
||||
('[campaign]'
|
||||
{
|
||||
createLeafNode(grammarAccess.getCampaignTypeAccess().getCampaignKeyword_0(), null);
|
||||
}
|
||||
(
|
||||
|
||||
lv_name_1= RULE_ID
|
||||
{
|
||||
createLeafNode(grammarAccess.getCampaignTypeAccess().getNameIDTerminalRuleCall_1_0(), "name");
|
||||
}
|
||||
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getCampaignTypeRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode, $current);
|
||||
}
|
||||
|
||||
try {
|
||||
set($current, "name", lv_name_1, "ID", lastConsumedNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
}
|
||||
|
||||
)?'[/campaign]'
|
||||
{
|
||||
createLeafNode(grammarAccess.getCampaignTypeAccess().getCampaignKeyword_2(), null);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleEntity
|
||||
entryRuleEntity returns [EObject current=null] :
|
||||
{ currentNode = createCompositeNode(grammarAccess.getEntityRule(), currentNode); }
|
||||
iv_ruleEntity=ruleEntity
|
||||
{ $current=$iv_ruleEntity.current; }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Entity
|
||||
ruleEntity returns [EObject current=null]
|
||||
@init { EObject temp=null; setCurrentLookahead(); resetLookahead();
|
||||
}
|
||||
@after { resetLookahead();
|
||||
lastConsumedNode = currentNode;
|
||||
}:
|
||||
('entity'
|
||||
{
|
||||
createLeafNode(grammarAccess.getEntityAccess().getEntityKeyword_0(), null);
|
||||
}
|
||||
(
|
||||
|
||||
lv_name_1= RULE_ID
|
||||
{
|
||||
createLeafNode(grammarAccess.getEntityAccess().getNameIDTerminalRuleCall_1_0(), "name");
|
||||
}
|
||||
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getEntityRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode, $current);
|
||||
}
|
||||
|
||||
try {
|
||||
set($current, "name", lv_name_1, "ID", lastConsumedNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
}
|
||||
|
||||
)('extends'
|
||||
{
|
||||
createLeafNode(grammarAccess.getEntityAccess().getExtendsKeyword_2_0(), null);
|
||||
}
|
||||
(
|
||||
|
||||
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getEntityRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode, $current);
|
||||
}
|
||||
}
|
||||
RULE_ID
|
||||
{
|
||||
createLeafNode(grammarAccess.getEntityAccess().getExtendsEntityCrossReference_2_1_0(), "extends");
|
||||
}
|
||||
|
||||
// TODO assign feature to currentNode
|
||||
|
||||
))?'{'
|
||||
{
|
||||
createLeafNode(grammarAccess.getEntityAccess().getLeftCurlyBracketKeyword_3(), null);
|
||||
}
|
||||
(
|
||||
|
||||
|
||||
{
|
||||
currentNode=createCompositeNode(grammarAccess.getEntityAccess().getPropertiesPropertyParserRuleCall_4_0(), currentNode);
|
||||
}
|
||||
lv_properties_5=ruleProperty
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getEntityRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode.getParent(), $current);
|
||||
}
|
||||
|
||||
try {
|
||||
add($current, "properties", lv_properties_5, "Property", currentNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
currentNode = currentNode.getParent();
|
||||
}
|
||||
|
||||
)*'}'
|
||||
{
|
||||
createLeafNode(grammarAccess.getEntityAccess().getRightCurlyBracketKeyword_5(), null);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Entry rule entryRuleProperty
|
||||
entryRuleProperty returns [EObject current=null] :
|
||||
{ currentNode = createCompositeNode(grammarAccess.getPropertyRule(), currentNode); }
|
||||
iv_ruleProperty=ruleProperty
|
||||
{ $current=$iv_ruleProperty.current; }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Property
|
||||
ruleProperty returns [EObject current=null]
|
||||
@init { EObject temp=null; setCurrentLookahead(); resetLookahead();
|
||||
}
|
||||
@after { resetLookahead();
|
||||
lastConsumedNode = currentNode;
|
||||
}:
|
||||
('property'
|
||||
{
|
||||
createLeafNode(grammarAccess.getPropertyAccess().getPropertyKeyword_0(), null);
|
||||
}
|
||||
(
|
||||
|
||||
lv_name_1= RULE_ID
|
||||
{
|
||||
createLeafNode(grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_1_0(), "name");
|
||||
}
|
||||
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getPropertyRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode, $current);
|
||||
}
|
||||
|
||||
try {
|
||||
set($current, "name", lv_name_1, "ID", lastConsumedNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
}
|
||||
|
||||
)':'
|
||||
{
|
||||
createLeafNode(grammarAccess.getPropertyAccess().getColonKeyword_2(), null);
|
||||
}
|
||||
(
|
||||
|
||||
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getPropertyRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode, $current);
|
||||
}
|
||||
}
|
||||
RULE_ID
|
||||
{
|
||||
createLeafNode(grammarAccess.getPropertyAccess().getTypeTypeCrossReference_3_0(), "type");
|
||||
}
|
||||
|
||||
// TODO assign feature to currentNode
|
||||
|
||||
)(
|
||||
|
||||
lv_many_4='[]'
|
||||
{
|
||||
createLeafNode(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_0(), "many");
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = factory.create(grammarAccess.getPropertyRule().getType().getClassifier());
|
||||
associateNodeWithAstElement(currentNode, $current);
|
||||
}
|
||||
|
||||
try {
|
||||
set($current, "many", true, "[]", lastConsumedNode);
|
||||
} catch (ValueConverterException vce) {
|
||||
handleValueConverterException(vce);
|
||||
}
|
||||
}
|
||||
|
||||
)?);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
RULE_STRING : ('"' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'"')))* '"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'\'')))* '\'');
|
||||
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
RULE_ANY_OTHER : .;
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
RULE_ID=5
|
||||
RULE_STRING=4
|
||||
RULE_ANY_OTHER=10
|
||||
RULE_INT=6
|
||||
RULE_WS=9
|
||||
RULE_SL_COMMENT=8
|
||||
RULE_ML_COMMENT=7
|
||||
'property'=19
|
||||
'entity'=15
|
||||
'}'=18
|
||||
':'=20
|
||||
'extends'=16
|
||||
'type'=12
|
||||
'{'=17
|
||||
'[/campaign]'=14
|
||||
'[campaign]'=13
|
||||
'[]'=21
|
||||
'import'=11
|
Binary file not shown.
Binary file not shown.
|
@ -1,43 +0,0 @@
|
|||
lexer grammar InternalWml;
|
||||
@header {
|
||||
package org.wesnoth.parser.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
}
|
||||
|
||||
T11 : 'import' ;
|
||||
T12 : 'type' ;
|
||||
T13 : '[campaign]' ;
|
||||
T14 : '[/campaign]' ;
|
||||
T15 : 'entity' ;
|
||||
T16 : 'extends' ;
|
||||
T17 : '{' ;
|
||||
T18 : '}' ;
|
||||
T19 : 'property' ;
|
||||
T20 : ':' ;
|
||||
T21 : '[]' ;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide/src-gen/org/wesnoth/parser/antlr/internal/InternalWml.g" 503
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide/src-gen/org/wesnoth/parser/antlr/internal/InternalWml.g" 505
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide/src-gen/org/wesnoth/parser/antlr/internal/InternalWml.g" 507
|
||||
RULE_STRING : ('"' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'"')))* '"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'\'')))* '\'');
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide/src-gen/org/wesnoth/parser/antlr/internal/InternalWml.g" 509
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide/src-gen/org/wesnoth/parser/antlr/internal/InternalWml.g" 511
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide/src-gen/org/wesnoth/parser/antlr/internal/InternalWml.g" 513
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
// $ANTLR src "../org.wesnoth.wml.ide/src-gen/org/wesnoth/parser/antlr/internal/InternalWml.g" 515
|
||||
RULE_ANY_OTHER : .;
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue