added the 3rd party library used by the plugin editor...
...(for download see LIBRARIES.txt) commented out the "marking feature"
This commit is contained in:
parent
ead3d0be5b
commit
0a6509b8c4
184 changed files with 16076 additions and 2 deletions
1
utils/java/eclipse_plugin/LIBRARIES.txt
Normal file
1
utils/java/eclipse_plugin/LIBRARIES.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Xtext - http://www.eclipse.org/Xtext/download/
|
|
@ -10,6 +10,9 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.eclipse.core.resources,
|
||||
org.eclipse.ui.ide,
|
||||
org.eclipse.jface.text;bundle-version="3.5.2",
|
||||
org.eclipse.ui.editors;bundle-version="3.5.0"
|
||||
org.eclipse.ui.editors;bundle-version="3.5.0",
|
||||
org.wesnoth.wml.ide;bundle-version="1.0.0",
|
||||
org.wesnoth.wml.ide.generator;bundle-version="1.0.0",
|
||||
org.wesnoth.wml.ide.ui;bundle-version="1.0.0"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
|
|
@ -147,13 +147,13 @@ public class SampleBuilder extends IncrementalProjectBuilder {
|
|||
}
|
||||
|
||||
void checkXML(IResource resource) {
|
||||
Logger.print("got a _main.cfg file");
|
||||
// dummy condition
|
||||
if (resource instanceof IFile && resource.getName().equals("_main.cfg")) {
|
||||
try {
|
||||
IFile file = (IFile) resource;
|
||||
deleteMarkers(file);
|
||||
|
||||
/*
|
||||
IMarker[] resIMarkers = file.findMarkers(MARKER_TYPE, false, IResource.DEPTH_ZERO);
|
||||
Logger.print("found markers: " + resIMarkers.length);
|
||||
|
||||
|
@ -182,6 +182,7 @@ public class SampleBuilder extends IncrementalProjectBuilder {
|
|||
marker.setAttribute(IMarker.LINE_NUMBER, token.getLine());
|
||||
marker.setAttribute(IMarker.SEVERITY,token.getType().toMarkerSeverity());
|
||||
}
|
||||
*/
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
9
utils/java/org.wesnoth.wml.ide.generator/.classpath
Normal file
9
utils/java/org.wesnoth.wml.ide.generator/.classpath
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="src-gen"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.wesnoth.wml.ide"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
utils/java/org.wesnoth.wml.ide.generator/.project
Normal file
28
utils/java/org.wesnoth.wml.ide.generator/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.wesnoth.wml.ide.generator</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,16 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: org.wesnoth.wml.ide.generator
|
||||
Bundle-Vendor: My Company
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-SymbolicName: org.wesnoth.wml.ide.generator; singleton:=true
|
||||
Eclipse-RegisterBuddy: org.eclipse.xtext.log4j
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.wesnoth.wml.ide;visibility:=reexport,
|
||||
org.eclipse.xpand;visibility:=reexport,
|
||||
org.eclipse.xtend;visibility:=reexport,
|
||||
org.eclipse.xtext;visibility:=reexport,
|
||||
org.eclipse.emf.mwe.core;visibility:=reexport,
|
||||
org.eclipse.emf.mwe.utils;visibility:=reexport,
|
||||
org.eclipse.xtend.typesystem.emf;visibility:=reexport
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* This is an example model
|
||||
*/
|
||||
type String
|
||||
|
||||
entity Leaf extends Composable {
|
||||
property name: String
|
||||
}
|
||||
|
||||
entity Composite extends Composable {
|
||||
property content: Composable[]
|
||||
}
|
||||
|
||||
entity Composable {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
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(", ")
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
«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»
|
|
@ -0,0 +1,20 @@
|
|||
<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>
|
|
@ -0,0 +1,4 @@
|
|||
source.. = src/,src-gen/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* This is an example model
|
||||
*/
|
||||
type String
|
||||
|
||||
entity Leaf extends Composable {
|
||||
property name: String
|
||||
}
|
||||
|
||||
entity Composite extends Composable {
|
||||
property content: Composable[]
|
||||
}
|
||||
|
||||
entity Composable {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
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(", ")
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
«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»
|
|
@ -0,0 +1,20 @@
|
|||
<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>
|
8
utils/java/org.wesnoth.wml.ide.ui/.classpath
Normal file
8
utils/java/org.wesnoth.wml.ide.ui/.classpath
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="src-gen"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
utils/java/org.wesnoth.wml.ide.ui/.project
Normal file
28
utils/java/org.wesnoth.wml.ide.ui/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.wesnoth.wml.ide.ui</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
25
utils/java/org.wesnoth.wml.ide.ui/META-INF/MANIFEST.MF
Normal file
25
utils/java/org.wesnoth.wml.ide.ui/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,25 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: org.wesnoth.wml.ide.ui
|
||||
Bundle-Vendor: My Company
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-SymbolicName: org.wesnoth.wml.ide.ui; singleton:=true
|
||||
Eclipse-RegisterBuddy: org.eclipse.xtext.log4j
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.wesnoth.wml.ide;visibility:=reexport,
|
||||
org.eclipse.xtext.ui.core,
|
||||
org.eclipse.xtext.ui.common,
|
||||
org.eclipse.xtext.log4j;bundle-version="1.2.15",
|
||||
org.eclipse.ui.editors;bundle-version="3.5.0",
|
||||
org.eclipse.ui.ide;bundle-version="3.5.0",
|
||||
org.eclipse.ui,
|
||||
org.antlr.runtime
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Export-Package: org.wesnoth,
|
||||
org.wesnoth.contentassist,
|
||||
org.wesnoth.contentassist.antlr,
|
||||
org.wesnoth.contentassist.antlr.internal;x-internal:=true,
|
||||
org.wesnoth.internal;x-internal:=true,
|
||||
org.wesnoth.labeling,
|
||||
org.wesnoth.outline
|
||||
Bundle-Activator: org.wesnoth.internal.WmlActivator
|
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.
|
@ -0,0 +1,928 @@
|
|||
/*
|
||||
* 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 : .;
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
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.
|
@ -0,0 +1,43 @@
|
|||
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.
4
utils/java/org.wesnoth.wml.ide.ui/build.properties
Normal file
4
utils/java/org.wesnoth.wml.ide.ui/build.properties
Normal file
|
@ -0,0 +1,4 @@
|
|||
source.. = src/,src-gen/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
117
utils/java/org.wesnoth.wml.ide.ui/plugin.xml
Normal file
117
utils/java/org.wesnoth.wml.ide.ui/plugin.xml
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
|
||||
<plugin>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.editors">
|
||||
<editor
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.XtextEditor"
|
||||
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
|
||||
default="true"
|
||||
extensions="cfg"
|
||||
id="org.wesnoth.Wml"
|
||||
name="Wml Editor">
|
||||
</editor>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclarationHandler"
|
||||
commandId="org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclaration">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="org.wesnoth.Wml.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.handler.ValidateActionHandler"
|
||||
commandId="org.wesnoth.Wml.validate">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="org.wesnoth.Wml.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="org.eclipse.core.expressions.definitions">
|
||||
<definition id="org.wesnoth.Wml.Editor.opened">
|
||||
<and>
|
||||
<reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
|
||||
<with variable="activeEditor">
|
||||
<test property="org.eclipse.xtext.ui.core.editor.XtextEditor.languageName"
|
||||
value="org.wesnoth.Wml"
|
||||
forcePluginActivation="true"/>
|
||||
</with>
|
||||
</and>
|
||||
</definition>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.preferences.LanguageRootPreferencePage"
|
||||
id="org.wesnoth.Wml"
|
||||
name="Wml"
|
||||
category="org.eclipse.xtext.languages">
|
||||
<keywordReference id="org.wesnoth.ui.keyword_Wml"/>
|
||||
</page>
|
||||
<page
|
||||
category="org.wesnoth.Wml"
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.common.editor.syntaxcoloring.SyntaxColoringPreferencePage"
|
||||
id="org.wesnoth.Wml.coloring"
|
||||
name="Syntax Coloring">
|
||||
<keywordReference id="org.wesnoth.ui.keyword_Wml"/>
|
||||
</page>
|
||||
<page
|
||||
category="org.wesnoth.Wml"
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.common.editor.templates.XtextTemplatePreferencePage"
|
||||
id="org.wesnoth.Wml.templates"
|
||||
name="Templates">
|
||||
<keywordReference id="org.wesnoth.ui.keyword_Wml"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.keywords">
|
||||
<keyword
|
||||
id="org.wesnoth.ui.keyword_Wml"
|
||||
label="Wml"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<command
|
||||
description="Trigger expensive validation"
|
||||
id="org.wesnoth.Wml.validate"
|
||||
name="Validate">
|
||||
</command>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="popup:#TextEditorContext?after=group.open">
|
||||
<command
|
||||
commandId="org.wesnoth.Wml.validate"
|
||||
style="push"
|
||||
tooltip="Trigger expensive validation">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference
|
||||
definitionId="org.wesnoth.Wml.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
|
||||
<!-- adding resource factories -->
|
||||
|
||||
<extension
|
||||
point="org.eclipse.emf.ecore.extension_parser">
|
||||
<parser
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.resource.XtextResourceFactory"
|
||||
type="cfg">
|
||||
</parser>
|
||||
</extension>
|
||||
|
||||
|
||||
|
||||
|
||||
</plugin>
|
117
utils/java/org.wesnoth.wml.ide.ui/plugin.xml_gen
Normal file
117
utils/java/org.wesnoth.wml.ide.ui/plugin.xml_gen
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
|
||||
<plugin>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.editors">
|
||||
<editor
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.XtextEditor"
|
||||
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
|
||||
default="true"
|
||||
extensions="cfg"
|
||||
id="org.wesnoth.Wml"
|
||||
name="Wml Editor">
|
||||
</editor>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclarationHandler"
|
||||
commandId="org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclaration">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="org.wesnoth.Wml.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.handler.ValidateActionHandler"
|
||||
commandId="org.wesnoth.Wml.validate">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="org.wesnoth.Wml.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="org.eclipse.core.expressions.definitions">
|
||||
<definition id="org.wesnoth.Wml.Editor.opened">
|
||||
<and>
|
||||
<reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
|
||||
<with variable="activeEditor">
|
||||
<test property="org.eclipse.xtext.ui.core.editor.XtextEditor.languageName"
|
||||
value="org.wesnoth.Wml"
|
||||
forcePluginActivation="true"/>
|
||||
</with>
|
||||
</and>
|
||||
</definition>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.preferences.LanguageRootPreferencePage"
|
||||
id="org.wesnoth.Wml"
|
||||
name="Wml"
|
||||
category="org.eclipse.xtext.languages">
|
||||
<keywordReference id="org.wesnoth.ui.keyword_Wml"/>
|
||||
</page>
|
||||
<page
|
||||
category="org.wesnoth.Wml"
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.common.editor.syntaxcoloring.SyntaxColoringPreferencePage"
|
||||
id="org.wesnoth.Wml.coloring"
|
||||
name="Syntax Coloring">
|
||||
<keywordReference id="org.wesnoth.ui.keyword_Wml"/>
|
||||
</page>
|
||||
<page
|
||||
category="org.wesnoth.Wml"
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.ui.common.editor.templates.XtextTemplatePreferencePage"
|
||||
id="org.wesnoth.Wml.templates"
|
||||
name="Templates">
|
||||
<keywordReference id="org.wesnoth.ui.keyword_Wml"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.keywords">
|
||||
<keyword
|
||||
id="org.wesnoth.ui.keyword_Wml"
|
||||
label="Wml"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<command
|
||||
description="Trigger expensive validation"
|
||||
id="org.wesnoth.Wml.validate"
|
||||
name="Validate">
|
||||
</command>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="popup:#TextEditorContext?after=group.open">
|
||||
<command
|
||||
commandId="org.wesnoth.Wml.validate"
|
||||
style="push"
|
||||
tooltip="Trigger expensive validation">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference
|
||||
definitionId="org.wesnoth.Wml.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
|
||||
<!-- adding resource factories -->
|
||||
|
||||
<extension
|
||||
point="org.eclipse.emf.ecore.extension_parser">
|
||||
<parser
|
||||
class="org.wesnoth.WmlExecutableExtensionFactory:org.eclipse.xtext.resource.XtextResourceFactory"
|
||||
type="cfg">
|
||||
</parser>
|
||||
</extension>
|
||||
|
||||
|
||||
|
||||
|
||||
</plugin>
|
|
@ -0,0 +1,166 @@
|
|||
|
||||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth;
|
||||
|
||||
import org.wesnoth.WmlRuntimeModule;
|
||||
|
||||
/**
|
||||
* Manual modifications go to {org.wesnoth.WmlUiModule}
|
||||
*/
|
||||
public abstract class AbstractWmlUiModule extends WmlRuntimeModule {
|
||||
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.ILocationInFileProvider> bindILocationInFileProvider() {
|
||||
return org.eclipse.xtext.ui.core.DefaultLocationInFileProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.jface.text.hyperlink.IHyperlinkDetector> bindIHyperlinkDetector() {
|
||||
return org.eclipse.xtext.ui.common.editor.hyperlinking.DefaultHyperlinkDetector.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.jface.text.reconciler.IReconciler> bindIReconciler() {
|
||||
return org.eclipse.xtext.ui.core.editor.reconciler.XtextReconciler.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.toggleComments.ISingleLineCommentHelper> bindISingleLineCommentHelper() {
|
||||
return org.eclipse.xtext.ui.common.editor.toggleComments.DefaultSingleLineCommentHelper.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.common.editor.outline.ITreeProvider> bindITreeProvider() {
|
||||
return org.eclipse.xtext.ui.common.editor.outline.transformer.TransformingTreeProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.ui.views.contentoutline.IContentOutlinePage> bindIContentOutlinePage() {
|
||||
return org.eclipse.xtext.ui.common.editor.outline.XtextContentOutlinePage.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.common.editor.outline.actions.IActionBarContributor> bindIActionBarContributor() {
|
||||
return org.eclipse.xtext.ui.common.editor.outline.actions.IActionBarContributor.DefaultActionBarContributor.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.syntaxcoloring.IHighlightingHelper> bindIHighlightingHelper() {
|
||||
return org.eclipse.xtext.ui.common.editor.syntaxcoloring.HighlightingHelper.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.emf.common.notify.AdapterFactory> bindAdapterFactory() {
|
||||
return org.eclipse.xtext.ui.core.InjectableAdapterFactory.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider> bindAdapterFactoryLabelProvider() {
|
||||
return org.eclipse.xtext.ui.core.InjectableAdapterFactoryLabelProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public org.eclipse.emf.edit.provider.ComposedAdapterFactory.Descriptor.Registry bindComposedAdapterFactory$Descriptor$RegistryToInstance() {
|
||||
return org.eclipse.emf.edit.provider.ComposedAdapterFactory.Descriptor.Registry.INSTANCE;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentAssistantFactory> bindIContentAssistantFactory() {
|
||||
return org.eclipse.xtext.ui.common.editor.contentassist.DefaultContentAssistantFactory.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.jface.text.contentassist.IContentAssistProcessor> bindIContentAssistProcessor() {
|
||||
return org.eclipse.xtext.ui.core.editor.contentassist.XtextContentAssistProcessor.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalPostProcessor> bindICompletionProposalPostProcessor() {
|
||||
return org.eclipse.xtext.ui.common.editor.contentassist.DefaultCompletionProposalPostProcessor.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IFollowElementCalculator> bindIFollowElementCalculator() {
|
||||
return org.eclipse.xtext.ui.common.editor.contentassist.DefaultFollowElementCalculator.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.ITemplateProposalProvider> bindITemplateProposalProvider() {
|
||||
return org.eclipse.xtext.ui.common.editor.templates.DefaultTemplateProposalProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.jface.text.templates.persistence.TemplateStore> bindTemplateStore() {
|
||||
return org.eclipse.xtext.ui.common.editor.templates.XtextTemplateStore.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.jface.text.templates.ContextTypeRegistry> bindContextTypeRegistry() {
|
||||
return org.eclipse.xtext.ui.common.editor.templates.XtextTemplateContextTypeRegistry.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.formatting.IContentFormatterFactory> bindIContentFormatterFactory() {
|
||||
return org.eclipse.xtext.ui.core.editor.formatting.ContentFormatterFactory.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.utils.ValidationJob.Factory> bindValidationJob$Factory() {
|
||||
return org.eclipse.xtext.ui.core.editor.utils.DefaultValidationJobFactory.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.IXtextResourceChecker> bindIXtextResourceChecker() {
|
||||
return org.eclipse.xtext.ui.core.editor.DefaultXtextResourceChecker.class;
|
||||
}
|
||||
|
||||
// contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment
|
||||
public Class<? extends org.eclipse.jface.text.rules.ITokenScanner> bindITokenScanner() {
|
||||
return org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.AntlrTokenScanner.class;
|
||||
}
|
||||
|
||||
// contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalConflictHelper> bindIProposalConflictHelper() {
|
||||
return org.eclipse.xtext.ui.common.editor.contentassist.antlr.AntlrProposalConflictHelper.class;
|
||||
}
|
||||
|
||||
// contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.IDamagerRepairer> bindIDamagerRepairer() {
|
||||
return org.eclipse.xtext.ui.core.editor.XtextDamagerRepairer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment
|
||||
public Class<? extends org.eclipse.jface.viewers.ILabelProvider> bindILabelProvider() {
|
||||
return org.wesnoth.labeling.WmlLabelProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.outline.TransformerFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.common.editor.outline.transformer.ISemanticModelTransformer> bindISemanticModelTransformer() {
|
||||
return org.wesnoth.outline.WmlTransformer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.outline.OutlineNodeAdapterFactoryFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.common.editor.outline.actions.IContentOutlineNodeAdapterFactory> bindIContentOutlineNodeAdapterFactory() {
|
||||
return org.wesnoth.outline.WmlOutlineNodeAdapterFactory.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.ui.generator.contentAssist.JavaBasedContentAssistFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
|
||||
return org.wesnoth.contentassist.WmlProposalProvider.class;
|
||||
}
|
||||
|
||||
// contributed by de.itemis.xtext.antlr.XtextAntlrUiGeneratorFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext.Factory> bindContentAssistContext$Factory() {
|
||||
return org.eclipse.xtext.ui.common.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.class;
|
||||
}
|
||||
|
||||
// contributed by de.itemis.xtext.antlr.XtextAntlrUiGeneratorFragment
|
||||
public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.antlr.IContentAssistParser> bindIContentAssistParser() {
|
||||
return org.wesnoth.contentassist.antlr.WmlParser.class;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
|
||||
package org.wesnoth;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExecutableExtension;
|
||||
import org.eclipse.core.runtime.IExecutableExtensionFactory;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
import com.google.inject.Injector;
|
||||
|
||||
/**
|
||||
* generated
|
||||
*/
|
||||
public class WmlExecutableExtensionFactory implements IExecutableExtensionFactory, IExecutableExtension {
|
||||
|
||||
private Logger log = Logger.getLogger(WmlExecutableExtensionFactory.class);
|
||||
private String clazzName;
|
||||
private IConfigurationElement config;
|
||||
|
||||
public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
|
||||
throws CoreException {
|
||||
if (data instanceof String) {
|
||||
clazzName = (String) data;
|
||||
this.config = config;
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("couldn't handle passed data : "+data);
|
||||
}
|
||||
}
|
||||
|
||||
public Object create() throws CoreException {
|
||||
org.wesnoth.internal.WmlActivator instance = org.wesnoth.internal.WmlActivator.getInstance();
|
||||
if (instance == null)
|
||||
throw new IllegalStateException("The bundle has not yet been activated. Make sure the Manifest.MF contains 'Bundle-ActivationPolicy: lazy'.");
|
||||
Bundle bundle = instance.getBundle();
|
||||
try {
|
||||
final Class<?> clazz = bundle.loadClass(clazzName);
|
||||
final Injector injector = org.wesnoth.internal.WmlActivator.getInstance().getInjector("org.wesnoth.Wml");
|
||||
final Object result = injector.getInstance(clazz);
|
||||
if (result instanceof IExecutableExtension)
|
||||
((IExecutableExtension) result).setInitializationData(config, null, null);
|
||||
return result;
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e);
|
||||
throw new CoreException(new Status(Status.ERROR, bundle.getSymbolicName(), e.getMessage(),e));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth.contentassist;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.common.contentassist.TerminalsProposalProvider;
|
||||
import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
|
||||
import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
|
||||
|
||||
/**
|
||||
* Represents a generated, default implementation of interface {@link IProposalProvider}.
|
||||
* Methods are dynamically dispatched on the first parameter, i.e., you can override them
|
||||
* with a more concrete subtype.
|
||||
*/
|
||||
public class AbstractWmlProposalProvider extends TerminalsProposalProvider {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(AbstractWmlProposalProvider.class);
|
||||
|
||||
public void completeModel_Imports(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeModel_Imports feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeModel_Elements(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeModel_Elements feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeImport_ImportURI(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeImport_ImportURI feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeSimpleType_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeSimpleType_Name feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeCampaignType_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeCampaignType_Name feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeEntity_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeEntity_Name feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeEntity_Extends(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeEntity_Extends feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeEntity_Properties(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeEntity_Properties feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeProperty_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeProperty_Name feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeProperty_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeProperty_Type feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
|
||||
}
|
||||
public void completeProperty_Many(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("completeProperty_Many feature '" + assignment.getFeature() + "' terminal '"
|
||||
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
|
||||
+ context.getPrefix() + "'");
|
||||
}
|
||||
// subclasses may override
|
||||
}
|
||||
|
||||
public void complete_Model(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("complete_Model '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
|
||||
+ "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
|
||||
}
|
||||
// subclasses may override
|
||||
}
|
||||
public void complete_Import(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("complete_Import '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
|
||||
+ "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
|
||||
}
|
||||
// subclasses may override
|
||||
}
|
||||
public void complete_Type(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("complete_Type '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
|
||||
+ "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
|
||||
}
|
||||
// subclasses may override
|
||||
}
|
||||
public void complete_SimpleType(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("complete_SimpleType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
|
||||
+ "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
|
||||
}
|
||||
// subclasses may override
|
||||
}
|
||||
public void complete_CampaignType(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("complete_CampaignType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
|
||||
+ "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
|
||||
}
|
||||
// subclasses may override
|
||||
}
|
||||
public void complete_Entity(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("complete_Entity '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
|
||||
+ "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
|
||||
}
|
||||
// subclasses may override
|
||||
}
|
||||
public void complete_Property(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("complete_Property '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
|
||||
+ "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
|
||||
}
|
||||
// subclasses may override
|
||||
}
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth.contentassist.antlr;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.antlr.runtime.CharStream;
|
||||
import org.antlr.runtime.RecognitionException;
|
||||
import org.eclipse.xtext.AbstractElement;
|
||||
import org.eclipse.xtext.ui.common.editor.contentassist.antlr.AbstractContentAssistParser;
|
||||
import org.eclipse.xtext.ui.common.editor.contentassist.antlr.FollowElement;
|
||||
import org.eclipse.xtext.ui.common.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.wesnoth.services.WmlGrammarAccess;
|
||||
|
||||
public class WmlParser extends AbstractContentAssistParser {
|
||||
|
||||
@Inject
|
||||
private WmlGrammarAccess grammarAccess;
|
||||
|
||||
private Map<AbstractElement, String> nameMappings;
|
||||
|
||||
@Override
|
||||
protected org.wesnoth.contentassist.antlr.internal.InternalWmlLexer createLexer(CharStream stream) {
|
||||
return new org.wesnoth.contentassist.antlr.internal.InternalWmlLexer(stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected org.wesnoth.contentassist.antlr.internal.InternalWmlParser createParser() {
|
||||
org.wesnoth.contentassist.antlr.internal.InternalWmlParser result = new org.wesnoth.contentassist.antlr.internal.InternalWmlParser(null);
|
||||
result.setGrammarAccess(grammarAccess);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRuleName(AbstractElement element) {
|
||||
if (nameMappings == null) {
|
||||
nameMappings = new HashMap<AbstractElement, String>() {
|
||||
{
|
||||
put(grammarAccess.getTypeAccess().getAlternatives(), "rule__Type__Alternatives");
|
||||
put(grammarAccess.getModelAccess().getGroup(), "rule__Model__Group__0");
|
||||
put(grammarAccess.getImportAccess().getGroup(), "rule__Import__Group__0");
|
||||
put(grammarAccess.getSimpleTypeAccess().getGroup(), "rule__SimpleType__Group__0");
|
||||
put(grammarAccess.getCampaignTypeAccess().getGroup(), "rule__CampaignType__Group__0");
|
||||
put(grammarAccess.getEntityAccess().getGroup(), "rule__Entity__Group__0");
|
||||
put(grammarAccess.getEntityAccess().getGroup_2(), "rule__Entity__Group_2__0");
|
||||
put(grammarAccess.getPropertyAccess().getGroup(), "rule__Property__Group__0");
|
||||
put(grammarAccess.getModelAccess().getImportsAssignment_0(), "rule__Model__ImportsAssignment_0");
|
||||
put(grammarAccess.getModelAccess().getElementsAssignment_1(), "rule__Model__ElementsAssignment_1");
|
||||
put(grammarAccess.getImportAccess().getImportURIAssignment_1(), "rule__Import__ImportURIAssignment_1");
|
||||
put(grammarAccess.getSimpleTypeAccess().getNameAssignment_1(), "rule__SimpleType__NameAssignment_1");
|
||||
put(grammarAccess.getCampaignTypeAccess().getNameAssignment_1(), "rule__CampaignType__NameAssignment_1");
|
||||
put(grammarAccess.getEntityAccess().getNameAssignment_1(), "rule__Entity__NameAssignment_1");
|
||||
put(grammarAccess.getEntityAccess().getExtendsAssignment_2_1(), "rule__Entity__ExtendsAssignment_2_1");
|
||||
put(grammarAccess.getEntityAccess().getPropertiesAssignment_4(), "rule__Entity__PropertiesAssignment_4");
|
||||
put(grammarAccess.getPropertyAccess().getNameAssignment_1(), "rule__Property__NameAssignment_1");
|
||||
put(grammarAccess.getPropertyAccess().getTypeAssignment_3(), "rule__Property__TypeAssignment_3");
|
||||
put(grammarAccess.getPropertyAccess().getManyAssignment_4(), "rule__Property__ManyAssignment_4");
|
||||
}
|
||||
};
|
||||
}
|
||||
return nameMappings.get(element);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
|
||||
try {
|
||||
org.wesnoth.contentassist.antlr.internal.InternalWmlParser typedParser = (org.wesnoth.contentassist.antlr.internal.InternalWmlParser) parser;
|
||||
typedParser.entryRuleModel();
|
||||
return typedParser.getFollowElements();
|
||||
} catch(RecognitionException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getInitialHiddenTokens() {
|
||||
return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
|
||||
}
|
||||
|
||||
public WmlGrammarAccess getGrammarAccess() {
|
||||
return this.grammarAccess;
|
||||
}
|
||||
|
||||
public void setGrammarAccess(WmlGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,928 @@
|
|||
/*
|
||||
* 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 : .;
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
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
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,43 @@
|
|||
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 : .;
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
|
||||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth.internal;
|
||||
|
||||
import org.eclipse.xtext.ui.common.service.UIPluginModule;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Generated
|
||||
*/
|
||||
public class WmlActivator extends AbstractUIPlugin {
|
||||
|
||||
private Map<String,Injector> injectors = new HashMap<String,Injector>();
|
||||
private static WmlActivator INSTANCE;
|
||||
|
||||
public Injector getInjector(String languageName) {
|
||||
return injectors.get(languageName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
INSTANCE = this;
|
||||
|
||||
injectors.put("org.wesnoth.Wml", Guice.createInjector(
|
||||
new org.wesnoth.WmlUiModule(),
|
||||
createUIPluginModule()
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
public static WmlActivator getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
protected UIPluginModule createUIPluginModule() {
|
||||
return new UIPluginModule(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth;
|
||||
|
||||
/**
|
||||
* Use this class to register components to be used within the IDE.
|
||||
*/
|
||||
public class WmlUiModule extends org.wesnoth.AbstractWmlUiModule {
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth.contentassist;
|
||||
|
||||
import org.wesnoth.contentassist.AbstractWmlProposalProvider;
|
||||
/**
|
||||
* see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#contentAssist on how to customize content assistant
|
||||
*/
|
||||
public class WmlProposalProvider extends AbstractWmlProposalProvider {
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth.labeling;
|
||||
|
||||
import org.eclipse.xtext.ui.core.DefaultLabelProvider;
|
||||
|
||||
/**
|
||||
* see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#labelProvider
|
||||
*/
|
||||
public class WmlLabelProvider extends DefaultLabelProvider {
|
||||
/*
|
||||
|
||||
//Labels and icons can be computed like this:
|
||||
|
||||
String text(MyModel ele) {
|
||||
return "my "+ele.getName();
|
||||
}
|
||||
|
||||
String image(MyModel ele) {
|
||||
return "MyModel.gif";
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth.outline;
|
||||
|
||||
import org.eclipse.xtext.ui.common.editor.outline.actions.DefaultContentOutlineNodeAdapterFactory;
|
||||
|
||||
public class WmlOutlineNodeAdapterFactory extends DefaultContentOutlineNodeAdapterFactory {
|
||||
|
||||
private static final Class[] types = {
|
||||
// provide list of classes to adapt to, e.g.:
|
||||
// Entity.class
|
||||
// Service.class
|
||||
};
|
||||
|
||||
@Override
|
||||
public Class[] getAdapterList() {
|
||||
return types;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.wesnoth.outline;
|
||||
|
||||
import org.eclipse.xtext.ui.common.editor.outline.transformer.AbstractDeclarativeSemanticModelTransformer;
|
||||
|
||||
/**
|
||||
* customization of the default outline structure
|
||||
*
|
||||
*/
|
||||
public class WmlTransformer extends AbstractDeclarativeSemanticModelTransformer {
|
||||
|
||||
}
|
8
utils/java/org.wesnoth.wml.ide/.classpath
Normal file
8
utils/java/org.wesnoth.wml.ide/.classpath
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="src-gen"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
utils/java/org.wesnoth.wml.ide/.project
Normal file
28
utils/java/org.wesnoth.wml.ide/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.wesnoth.wml.ide</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
31
utils/java/org.wesnoth.wml.ide/META-INF/MANIFEST.MF
Normal file
31
utils/java/org.wesnoth.wml.ide/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,31 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: org.wesnoth.wml.ide
|
||||
Bundle-Vendor: My Company
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-SymbolicName: org.wesnoth.wml.ide; singleton:=true
|
||||
Eclipse-RegisterBuddy: org.eclipse.xtext.log4j
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.eclipse.xtext,
|
||||
org.eclipse.xtext.generator;resolution:=optional,
|
||||
de.itemis.xtext.antlr;resolution:=optional,
|
||||
org.apache.commons.logging;resolution:=optional,
|
||||
org.eclipse.emf.codegen.ecore;resolution:=optional,
|
||||
org.eclipse.xtext.log4j;resolution:=optional,
|
||||
org.eclipse.emf.mwe.utils;resolution:=optional,
|
||||
org.eclipse.emf.mwe.core;resolution:=optional,
|
||||
com.ibm.icu;resolution:=optional,
|
||||
org.eclipse.xtext.xtend;resolution:=optional,
|
||||
org.eclipse.xtext.util,
|
||||
org.eclipse.emf.ecore,
|
||||
org.eclipse.emf.common,
|
||||
org.antlr.runtime
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Export-Package: org.wesnoth,
|
||||
org.wesnoth.services,
|
||||
org.wesnoth.wml,
|
||||
org.wesnoth.wml.impl,
|
||||
org.wesnoth.wml.util,
|
||||
org.wesnoth.parseTreeConstruction,
|
||||
org.wesnoth.parser.antlr,
|
||||
org.wesnoth.validation
|
Binary file not shown.
|
@ -0,0 +1,77 @@
|
|||
<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>
|
|
@ -0,0 +1,3 @@
|
|||
grammarURI=classpath:/org/wesnoth/Wml.xtext
|
||||
file.extensions=cfg
|
||||
projectName=org.wesnoth.wml.ide
|
30
utils/java/org.wesnoth.wml.ide/bin/org/wesnoth/Wml.ecore
Normal file
30
utils/java/org.wesnoth.wml.ide/bin/org/wesnoth/Wml.ecore
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?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>
|
33
utils/java/org.wesnoth.wml.ide/bin/org/wesnoth/Wml.genmodel
Normal file
33
utils/java/org.wesnoth.wml.ide/bin/org/wesnoth/Wml.genmodel
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?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>
|
266
utils/java/org.wesnoth.wml.ide/bin/org/wesnoth/Wml.xmi
Normal file
266
utils/java/org.wesnoth.wml.ide/bin/org/wesnoth/Wml.xmi
Normal file
|
@ -0,0 +1,266 @@
|
|||
<?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>
|
28
utils/java/org.wesnoth.wml.ide/bin/org/wesnoth/Wml.xtext
Normal file
28
utils/java/org.wesnoth.wml.ide/bin/org/wesnoth/Wml.xtext
Normal file
|
@ -0,0 +1,28 @@
|
|||
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.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue