mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
Occurrence highlighting of nested references
#1090 Signed-off-by: Mark Christiaens <mark.christiaens@sigasi.com>
This commit is contained in:
parent
35f9e08f60
commit
528c10aa90
50 changed files with 6761 additions and 5 deletions
|
@ -0,0 +1,47 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2019 Sigasi N.V. (http://www.sigasi.com) and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*******************************************************************************/
|
||||
package org.eclipse.xtext.ide.tests.server
|
||||
|
||||
import org.eclipse.xtext.testing.AbstractLanguageServerTest
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Class for testing the highlighting of reference that refer to the object in which they are embedded.
|
||||
*/
|
||||
class DocumentHighlightTest2 extends AbstractLanguageServerTest {
|
||||
|
||||
new() {
|
||||
super('nestedRefs');
|
||||
}
|
||||
|
||||
@Test
|
||||
def void testHighlightDeclarationWithNestedReference() {
|
||||
testDocumentHighlight[
|
||||
model = '''
|
||||
decl myDecl end myDecl;
|
||||
''';
|
||||
|
||||
line = 0
|
||||
column = '''decl myDec'''.length;
|
||||
expectedDocumentHighlight = 'W [[0, 5] .. [0, 11]] | R [[0, 16] .. [0, 22]]';
|
||||
];
|
||||
}
|
||||
|
||||
@Test
|
||||
def void testHighlightNestedReferenceInsideDeclaration() {
|
||||
testDocumentHighlight[
|
||||
model = '''
|
||||
decl myDecl end myDecl;
|
||||
''';
|
||||
|
||||
line = 0
|
||||
column = '''decl myDecl end myDe'''.length;
|
||||
expectedDocumentHighlight = 'W [[0, 5] .. [0, 11]] | R [[0, 16] .. [0, 22]]';
|
||||
];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.server;
|
||||
|
||||
import org.eclipse.xtend2.lib.StringConcatenation;
|
||||
import org.eclipse.xtext.testing.AbstractLanguageServerTest;
|
||||
import org.eclipse.xtext.testing.DocumentHighlightConfiguration;
|
||||
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Class for testing the highlighting of reference that refer to the object in which they are embedded.
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class DocumentHighlightTest2 extends AbstractLanguageServerTest {
|
||||
public DocumentHighlightTest2() {
|
||||
super("nestedRefs");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHighlightDeclarationWithNestedReference() {
|
||||
final Procedure1<DocumentHighlightConfiguration> _function = (DocumentHighlightConfiguration it) -> {
|
||||
StringConcatenation _builder = new StringConcatenation();
|
||||
_builder.append("decl myDecl end myDecl;");
|
||||
_builder.newLine();
|
||||
it.setModel(_builder.toString());
|
||||
it.setLine(0);
|
||||
StringConcatenation _builder_1 = new StringConcatenation();
|
||||
_builder_1.append("decl myDec");
|
||||
it.setColumn(_builder_1.length());
|
||||
it.setExpectedDocumentHighlight("W [[0, 5] .. [0, 11]] | R [[0, 16] .. [0, 22]]");
|
||||
};
|
||||
this.testDocumentHighlight(_function);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHighlightNestedReferenceInsideDeclaration() {
|
||||
final Procedure1<DocumentHighlightConfiguration> _function = (DocumentHighlightConfiguration it) -> {
|
||||
StringConcatenation _builder = new StringConcatenation();
|
||||
_builder.append("decl myDecl end myDecl;");
|
||||
_builder.newLine();
|
||||
it.setModel(_builder.toString());
|
||||
it.setLine(0);
|
||||
StringConcatenation _builder_1 = new StringConcatenation();
|
||||
_builder_1.append("decl myDecl end myDe");
|
||||
it.setColumn(_builder_1.length());
|
||||
it.setExpectedDocumentHighlight("W [[0, 5] .. [0, 11]] | R [[0, 16] .. [0, 22]]");
|
||||
};
|
||||
this.testDocumentHighlight(_function);
|
||||
}
|
||||
}
|
|
@ -26,6 +26,7 @@ import org.eclipse.xtext.findReferences.TargetURIs;
|
|||
import org.eclipse.xtext.ide.server.Document;
|
||||
import org.eclipse.xtext.ide.util.DocumentHighlightComparator;
|
||||
import org.eclipse.xtext.nodemodel.ICompositeNode;
|
||||
import org.eclipse.xtext.nodemodel.INode;
|
||||
import org.eclipse.xtext.parser.IParseResult;
|
||||
import org.eclipse.xtext.resource.EObjectAtOffsetHelper;
|
||||
import org.eclipse.xtext.resource.ILocationInFileProvider;
|
||||
|
@ -34,6 +35,7 @@ import org.eclipse.xtext.resource.XtextResource;
|
|||
import org.eclipse.xtext.util.CancelIndicator;
|
||||
import org.eclipse.xtext.util.ITextRegion;
|
||||
import org.eclipse.xtext.util.ITextRegionWithLineInformation;
|
||||
import org.eclipse.xtext.util.TextRegion;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Supplier;
|
||||
|
@ -187,10 +189,29 @@ public class DefaultDocumentHighlightService implements IDocumentHighlightServic
|
|||
return false;
|
||||
}
|
||||
|
||||
// This code handles the special case where your language has constructs that can refer to
|
||||
// themselves. For example "function MyFunction begin ... end MyFunction" defines the function "MyFunction" and
|
||||
// terminates its implementation block with an additional repetition of the word "MyFunction". Normally, when
|
||||
// you are positioned on a selected element, you only want to highlight that selected element when you are
|
||||
// positioned directly on top of the name of the selected element. However, when the selected element can refer
|
||||
// to itself then there are references inside the element that must trigger highlighting. In the example,
|
||||
// we also want to highlight "MyFunction" when we are positioned on the "end MyFunction".
|
||||
|
||||
INode crossReferenceNode = offsetHelper.getCrossReferenceNode(resource, new TextRegion(offset, 0));
|
||||
|
||||
if (crossReferenceNode != null) {
|
||||
EObject crossReferencedElement = offsetHelper.getCrossReferencedElement(crossReferenceNode);
|
||||
|
||||
if (crossReferencedElement != null && crossReferencedElement == selectedElement) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
final EObject containedElement = offsetHelper.resolveContainedElementAt(resource, offset);
|
||||
// Special handling to avoid such cases when the selection is not
|
||||
// exactly on the desired element.
|
||||
if (selectedElement == containedElement) {
|
||||
// When the cursor is positioned in the selected element, then we only want to highlight the selected element
|
||||
// when we are directly on top of the name (the significant text region) of that element.
|
||||
|
||||
if (selectedElement == containedElement) {
|
||||
final ITextRegion region = locationInFileProvider.getSignificantTextRegion(containedElement);
|
||||
return !isNullOrEmpty(region)
|
||||
// Region is comparable to a selection in an editor,
|
||||
|
|
|
@ -18,7 +18,9 @@ Export-Package: org.eclipse.xtext.testlanguages.backtracking.ide.contentassist.a
|
|||
org.eclipse.xtext.testlanguages.noJdt.ide.contentassist.antlr.internal,
|
||||
org.eclipse.xtext.testlanguages.xtextgrammar.ide;x-friends:="org.eclipse.xtext.ide.tests",
|
||||
org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr,
|
||||
org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal
|
||||
org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.ide.contentassist.antlr.internal,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.ide.contentassist.antlr
|
||||
Require-Bundle: org.eclipse.xtext.ide;visibility:=reexport,
|
||||
org.eclipse.xtext.testlanguages,
|
||||
org.eclipse.xtext.testing,
|
||||
|
|
|
@ -4,3 +4,4 @@ org.eclipse.xtext.testlanguages.backtracking.ide.ExBeeLangTestLanguageIdeSetup
|
|||
org.eclipse.xtext.testlanguages.noJdt.ide.NoJdtTestLanguageIdeSetup
|
||||
org.eclipse.xtext.testlanguages.xtextgrammar.ide.XtextGrammarTestLanguageIdeSetup
|
||||
org.eclipse.xtext.testlanguages.fileAware.ide.FileAwareTestLanguageIdeSetup
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.ide.NestedRefsTestLanguageIdeSetup
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.ide;
|
||||
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.name.Names;
|
||||
import org.eclipse.xtext.ide.DefaultIdeModule;
|
||||
import org.eclipse.xtext.ide.LexerIdeBindings;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.FQNPrefixMatcher;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.IProposalConflictHelper;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.AntlrProposalConflictHelper;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.IContentAssistParser;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer;
|
||||
import org.eclipse.xtext.ide.refactoring.IRenameStrategy2;
|
||||
import org.eclipse.xtext.ide.server.rename.IRenameService2;
|
||||
import org.eclipse.xtext.ide.server.rename.RenameService2;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.ide.contentassist.antlr.NestedRefsTestLanguageParser;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.ide.contentassist.antlr.internal.InternalNestedRefsTestLanguageLexer;
|
||||
|
||||
/**
|
||||
* Manual modifications go to {@link NestedRefsTestLanguageIdeModule}.
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public abstract class AbstractNestedRefsTestLanguageIdeModule extends DefaultIdeModule {
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public void configureContentAssistLexer(Binder binder) {
|
||||
binder.bind(Lexer.class)
|
||||
.annotatedWith(Names.named(LexerIdeBindings.CONTENT_ASSIST))
|
||||
.to(InternalNestedRefsTestLanguageLexer.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IContentAssistParser> bindIContentAssistParser() {
|
||||
return NestedRefsTestLanguageParser.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IProposalConflictHelper> bindIProposalConflictHelper() {
|
||||
return AntlrProposalConflictHelper.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2
|
||||
public Class<? extends IPrefixMatcher> bindIPrefixMatcher() {
|
||||
return FQNPrefixMatcher.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2
|
||||
public Class<? extends IRenameService2> bindIRenameService2() {
|
||||
return RenameService2.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2
|
||||
public Class<? extends IRenameStrategy2> bindIRenameStrategy2() {
|
||||
return IRenameStrategy2.DefaultImpl.class;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.ide.contentassist.antlr;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import java.util.Map;
|
||||
import org.eclipse.xtext.AbstractElement;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.ide.contentassist.antlr.internal.InternalNestedRefsTestLanguageParser;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.services.NestedRefsTestLanguageGrammarAccess;
|
||||
|
||||
public class NestedRefsTestLanguageParser extends AbstractContentAssistParser {
|
||||
|
||||
@Singleton
|
||||
public static final class NameMappings {
|
||||
|
||||
private final Map<AbstractElement, String> mappings;
|
||||
|
||||
@Inject
|
||||
public NameMappings(NestedRefsTestLanguageGrammarAccess grammarAccess) {
|
||||
ImmutableMap.Builder<AbstractElement, String> builder = ImmutableMap.builder();
|
||||
init(builder, grammarAccess);
|
||||
this.mappings = builder.build();
|
||||
}
|
||||
|
||||
public String getRuleName(AbstractElement element) {
|
||||
return mappings.get(element);
|
||||
}
|
||||
|
||||
private static void init(ImmutableMap.Builder<AbstractElement, String> builder, NestedRefsTestLanguageGrammarAccess grammarAccess) {
|
||||
builder.put(grammarAccess.getSelfReferingDeclAccess().getGroup(), "rule__SelfReferingDecl__Group__0");
|
||||
builder.put(grammarAccess.getQualifiedNameAccess().getGroup(), "rule__QualifiedName__Group__0");
|
||||
builder.put(grammarAccess.getQualifiedNameAccess().getGroup_1(), "rule__QualifiedName__Group_1__0");
|
||||
builder.put(grammarAccess.getDocAccess().getDeclarationsAssignment(), "rule__Doc__DeclarationsAssignment");
|
||||
builder.put(grammarAccess.getSelfReferingDeclAccess().getNameAssignment_1(), "rule__SelfReferingDecl__NameAssignment_1");
|
||||
builder.put(grammarAccess.getSelfReferingDeclAccess().getSelfRefAssignment_3(), "rule__SelfReferingDecl__SelfRefAssignment_3");
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
private NameMappings nameMappings;
|
||||
|
||||
@Inject
|
||||
private NestedRefsTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Override
|
||||
protected InternalNestedRefsTestLanguageParser createParser() {
|
||||
InternalNestedRefsTestLanguageParser result = new InternalNestedRefsTestLanguageParser(null);
|
||||
result.setGrammarAccess(grammarAccess);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRuleName(AbstractElement element) {
|
||||
return nameMappings.getRuleName(element);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getInitialHiddenTokens() {
|
||||
return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
|
||||
}
|
||||
|
||||
public NestedRefsTestLanguageGrammarAccess getGrammarAccess() {
|
||||
return this.grammarAccess;
|
||||
}
|
||||
|
||||
public void setGrammarAccess(NestedRefsTestLanguageGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
|
||||
public NameMappings getNameMappings() {
|
||||
return nameMappings;
|
||||
}
|
||||
|
||||
public void setNameMappings(NameMappings nameMappings) {
|
||||
this.nameMappings = nameMappings;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.ide.contentassist.antlr;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import org.eclipse.xtext.AbstractRule;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.FollowElement;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
|
||||
import org.eclipse.xtext.ide.editor.partialEditing.IPartialEditingContentAssistParser;
|
||||
import org.eclipse.xtext.util.PolymorphicDispatcher;
|
||||
|
||||
public class PartialNestedRefsTestLanguageContentAssistParser extends NestedRefsTestLanguageParser implements IPartialEditingContentAssistParser {
|
||||
|
||||
private AbstractRule rule;
|
||||
|
||||
@Override
|
||||
public void initializeFor(AbstractRule rule) {
|
||||
this.rule = rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
|
||||
if (rule == null || rule.eIsProxy())
|
||||
return Collections.emptyList();
|
||||
String methodName = "entryRule" + rule.getName();
|
||||
PolymorphicDispatcher<Collection<FollowElement>> dispatcher =
|
||||
new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser));
|
||||
dispatcher.invoke();
|
||||
return parser.getFollowElements();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,431 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
grammar InternalNestedRefsTestLanguage;
|
||||
|
||||
options {
|
||||
superClass=AbstractInternalContentAssistParser;
|
||||
}
|
||||
|
||||
@lexer::header {
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.ide.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.ide.editor.contentassist.antlr.internal.Lexer;
|
||||
}
|
||||
|
||||
@parser::header {
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.ide.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.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.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.DFA;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.services.NestedRefsTestLanguageGrammarAccess;
|
||||
|
||||
}
|
||||
@parser::members {
|
||||
private NestedRefsTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
public void setGrammarAccess(NestedRefsTestLanguageGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Grammar getGrammar() {
|
||||
return grammarAccess.getGrammar();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getValueForTokenName(String tokenName) {
|
||||
return tokenName;
|
||||
}
|
||||
}
|
||||
|
||||
// Entry rule entryRuleDoc
|
||||
entryRuleDoc
|
||||
:
|
||||
{ before(grammarAccess.getDocRule()); }
|
||||
ruleDoc
|
||||
{ after(grammarAccess.getDocRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Doc
|
||||
ruleDoc
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getDocAccess().getDeclarationsAssignment()); }
|
||||
(rule__Doc__DeclarationsAssignment)*
|
||||
{ after(grammarAccess.getDocAccess().getDeclarationsAssignment()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
// Entry rule entryRuleSelfReferingDecl
|
||||
entryRuleSelfReferingDecl
|
||||
:
|
||||
{ before(grammarAccess.getSelfReferingDeclRule()); }
|
||||
ruleSelfReferingDecl
|
||||
{ after(grammarAccess.getSelfReferingDeclRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule SelfReferingDecl
|
||||
ruleSelfReferingDecl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getGroup()); }
|
||||
(rule__SelfReferingDecl__Group__0)
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getGroup()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
// Entry rule entryRuleQualifiedName
|
||||
entryRuleQualifiedName
|
||||
:
|
||||
{ before(grammarAccess.getQualifiedNameRule()); }
|
||||
ruleQualifiedName
|
||||
{ after(grammarAccess.getQualifiedNameRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule QualifiedName
|
||||
ruleQualifiedName
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getQualifiedNameAccess().getGroup()); }
|
||||
(rule__QualifiedName__Group__0)
|
||||
{ after(grammarAccess.getQualifiedNameAccess().getGroup()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__SelfReferingDecl__Group__0__Impl
|
||||
rule__SelfReferingDecl__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__0__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getDeclKeyword_0()); }
|
||||
'decl'
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getDeclKeyword_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__SelfReferingDecl__Group__1__Impl
|
||||
rule__SelfReferingDecl__Group__2
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__1__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getNameAssignment_1()); }
|
||||
(rule__SelfReferingDecl__NameAssignment_1)
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getNameAssignment_1()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__2
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__SelfReferingDecl__Group__2__Impl
|
||||
rule__SelfReferingDecl__Group__3
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__2__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getEndKeyword_2()); }
|
||||
'end'
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getEndKeyword_2()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__3
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__SelfReferingDecl__Group__3__Impl
|
||||
rule__SelfReferingDecl__Group__4
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__3__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getSelfRefAssignment_3()); }
|
||||
(rule__SelfReferingDecl__SelfRefAssignment_3)
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getSelfRefAssignment_3()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__4
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__SelfReferingDecl__Group__4__Impl
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__Group__4__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getSemicolonKeyword_4()); }
|
||||
';'
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getSemicolonKeyword_4()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__QualifiedName__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__QualifiedName__Group__0__Impl
|
||||
rule__QualifiedName__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__QualifiedName__Group__0__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0()); }
|
||||
RULE_ID
|
||||
{ after(grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__QualifiedName__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__QualifiedName__Group__1__Impl
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__QualifiedName__Group__1__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getQualifiedNameAccess().getGroup_1()); }
|
||||
(rule__QualifiedName__Group_1__0)*
|
||||
{ after(grammarAccess.getQualifiedNameAccess().getGroup_1()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__QualifiedName__Group_1__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__QualifiedName__Group_1__0__Impl
|
||||
rule__QualifiedName__Group_1__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__QualifiedName__Group_1__0__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getQualifiedNameAccess().getFullStopKeyword_1_0()); }
|
||||
'.'
|
||||
{ after(grammarAccess.getQualifiedNameAccess().getFullStopKeyword_1_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__QualifiedName__Group_1__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__QualifiedName__Group_1__1__Impl
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__QualifiedName__Group_1__1__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_1()); }
|
||||
RULE_ID
|
||||
{ after(grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_1()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Doc__DeclarationsAssignment
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getDocAccess().getDeclarationsSelfReferingDeclParserRuleCall_0()); }
|
||||
ruleSelfReferingDecl
|
||||
{ after(grammarAccess.getDocAccess().getDeclarationsSelfReferingDeclParserRuleCall_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__NameAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getNameQualifiedNameParserRuleCall_1_0()); }
|
||||
ruleQualifiedName
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getNameQualifiedNameParserRuleCall_1_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__SelfReferingDecl__SelfRefAssignment_3
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getSelfRefSelfReferingDeclCrossReference_3_0()); }
|
||||
(
|
||||
{ before(grammarAccess.getSelfReferingDeclAccess().getSelfRefSelfReferingDeclQualifiedNameParserRuleCall_3_0_1()); }
|
||||
ruleQualifiedName
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getSelfRefSelfReferingDeclQualifiedNameParserRuleCall_3_0_1()); }
|
||||
)
|
||||
{ after(grammarAccess.getSelfReferingDeclAccess().getSelfRefSelfReferingDeclCrossReference_3_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\'');
|
||||
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
RULE_ANY_OTHER : .;
|
|
@ -0,0 +1,15 @@
|
|||
'.'=14
|
||||
';'=13
|
||||
'decl'=11
|
||||
'end'=12
|
||||
RULE_ANY_OTHER=10
|
||||
RULE_ID=4
|
||||
RULE_INT=5
|
||||
RULE_ML_COMMENT=7
|
||||
RULE_SL_COMMENT=8
|
||||
RULE_STRING=6
|
||||
RULE_WS=9
|
||||
T__11=11
|
||||
T__12=12
|
||||
T__13=13
|
||||
T__14=14
|
|
@ -0,0 +1,848 @@
|
|||
package org.eclipse.xtext.testlanguages.nestedRefs.ide.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.ide.editor.contentassist.antlr.internal.Lexer;
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class InternalNestedRefsTestLanguageLexer extends Lexer {
|
||||
public static final int RULE_ID=4;
|
||||
public static final int RULE_WS=9;
|
||||
public static final int RULE_STRING=6;
|
||||
public static final int RULE_ANY_OTHER=10;
|
||||
public static final int RULE_SL_COMMENT=8;
|
||||
public static final int RULE_INT=5;
|
||||
public static final int T__11=11;
|
||||
public static final int RULE_ML_COMMENT=7;
|
||||
public static final int T__12=12;
|
||||
public static final int T__13=13;
|
||||
public static final int T__14=14;
|
||||
public static final int EOF=-1;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
public InternalNestedRefsTestLanguageLexer() {;}
|
||||
public InternalNestedRefsTestLanguageLexer(CharStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalNestedRefsTestLanguageLexer(CharStream input, RecognizerSharedState state) {
|
||||
super(input,state);
|
||||
|
||||
}
|
||||
public String getGrammarFileName() { return "InternalNestedRefsTestLanguage.g"; }
|
||||
|
||||
// $ANTLR start "T__11"
|
||||
public final void mT__11() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__11;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:11:7: ( 'decl' )
|
||||
// InternalNestedRefsTestLanguage.g:11:9: 'decl'
|
||||
{
|
||||
match("decl");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__11"
|
||||
|
||||
// $ANTLR start "T__12"
|
||||
public final void mT__12() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__12;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:12:7: ( 'end' )
|
||||
// InternalNestedRefsTestLanguage.g:12:9: 'end'
|
||||
{
|
||||
match("end");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__12"
|
||||
|
||||
// $ANTLR start "T__13"
|
||||
public final void mT__13() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__13;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:13:7: ( ';' )
|
||||
// InternalNestedRefsTestLanguage.g:13:9: ';'
|
||||
{
|
||||
match(';');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__13"
|
||||
|
||||
// $ANTLR start "T__14"
|
||||
public final void mT__14() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__14;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:14:7: ( '.' )
|
||||
// InternalNestedRefsTestLanguage.g:14:9: '.'
|
||||
{
|
||||
match('.');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__14"
|
||||
|
||||
// $ANTLR start "RULE_ID"
|
||||
public final void mRULE_ID() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ID;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:419:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
|
||||
// InternalNestedRefsTestLanguage.g:419:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:419:11: ( '^' )?
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( (LA1_0=='^') ) {
|
||||
alt1=1;
|
||||
}
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:419:11: '^'
|
||||
{
|
||||
match('^');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:419:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:
|
||||
{
|
||||
if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ID"
|
||||
|
||||
// $ANTLR start "RULE_INT"
|
||||
public final void mRULE_INT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_INT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:421:10: ( ( '0' .. '9' )+ )
|
||||
// InternalNestedRefsTestLanguage.g:421:12: ( '0' .. '9' )+
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:421:12: ( '0' .. '9' )+
|
||||
int cnt3=0;
|
||||
loop3:
|
||||
do {
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( ((LA3_0>='0' && LA3_0<='9')) ) {
|
||||
alt3=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:421:13: '0' .. '9'
|
||||
{
|
||||
matchRange('0','9');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt3 >= 1 ) break loop3;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(3, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt3++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_INT"
|
||||
|
||||
// $ANTLR start "RULE_STRING"
|
||||
public final void mRULE_STRING() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_STRING;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:423:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
|
||||
// InternalNestedRefsTestLanguage.g:423:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:423:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
int alt6=2;
|
||||
int LA6_0 = input.LA(1);
|
||||
|
||||
if ( (LA6_0=='\"') ) {
|
||||
alt6=1;
|
||||
}
|
||||
else if ( (LA6_0=='\'') ) {
|
||||
alt6=2;
|
||||
}
|
||||
else {
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 6, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
switch (alt6) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:423:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
|
||||
{
|
||||
match('\"');
|
||||
// InternalNestedRefsTestLanguage.g:423:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
|
||||
loop4:
|
||||
do {
|
||||
int alt4=3;
|
||||
int LA4_0 = input.LA(1);
|
||||
|
||||
if ( (LA4_0=='\\') ) {
|
||||
alt4=1;
|
||||
}
|
||||
else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) {
|
||||
alt4=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:423:21: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalNestedRefsTestLanguage.g:423:28: ~ ( ( '\\\\' | '\"' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop4;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\"');
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalNestedRefsTestLanguage.g:423:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
|
||||
{
|
||||
match('\'');
|
||||
// InternalNestedRefsTestLanguage.g:423:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
|
||||
loop5:
|
||||
do {
|
||||
int alt5=3;
|
||||
int LA5_0 = input.LA(1);
|
||||
|
||||
if ( (LA5_0=='\\') ) {
|
||||
alt5=1;
|
||||
}
|
||||
else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) {
|
||||
alt5=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:423:54: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalNestedRefsTestLanguage.g:423:61: ~ ( ( '\\\\' | '\\'' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop5;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\'');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_STRING"
|
||||
|
||||
// $ANTLR start "RULE_ML_COMMENT"
|
||||
public final void mRULE_ML_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ML_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:425:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
|
||||
// InternalNestedRefsTestLanguage.g:425:19: '/*' ( options {greedy=false; } : . )* '*/'
|
||||
{
|
||||
match("/*");
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:425:24: ( options {greedy=false; } : . )*
|
||||
loop7:
|
||||
do {
|
||||
int alt7=2;
|
||||
int LA7_0 = input.LA(1);
|
||||
|
||||
if ( (LA7_0=='*') ) {
|
||||
int LA7_1 = input.LA(2);
|
||||
|
||||
if ( (LA7_1=='/') ) {
|
||||
alt7=2;
|
||||
}
|
||||
else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt7) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:425:52: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop7;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match("*/");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ML_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_SL_COMMENT"
|
||||
public final void mRULE_SL_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_SL_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:427:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
|
||||
// InternalNestedRefsTestLanguage.g:427:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
|
||||
{
|
||||
match("//");
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:427:24: (~ ( ( '\\n' | '\\r' ) ) )*
|
||||
loop8:
|
||||
do {
|
||||
int alt8=2;
|
||||
int LA8_0 = input.LA(1);
|
||||
|
||||
if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) {
|
||||
alt8=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt8) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:427:24: ~ ( ( '\\n' | '\\r' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop8;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:427:40: ( ( '\\r' )? '\\n' )?
|
||||
int alt10=2;
|
||||
int LA10_0 = input.LA(1);
|
||||
|
||||
if ( (LA10_0=='\n'||LA10_0=='\r') ) {
|
||||
alt10=1;
|
||||
}
|
||||
switch (alt10) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:427:41: ( '\\r' )? '\\n'
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:427:41: ( '\\r' )?
|
||||
int alt9=2;
|
||||
int LA9_0 = input.LA(1);
|
||||
|
||||
if ( (LA9_0=='\r') ) {
|
||||
alt9=1;
|
||||
}
|
||||
switch (alt9) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:427:41: '\\r'
|
||||
{
|
||||
match('\r');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
match('\n');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_SL_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_WS"
|
||||
public final void mRULE_WS() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_WS;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:429:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
||||
// InternalNestedRefsTestLanguage.g:429:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:429:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
int cnt11=0;
|
||||
loop11:
|
||||
do {
|
||||
int alt11=2;
|
||||
int LA11_0 = input.LA(1);
|
||||
|
||||
if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
|
||||
alt11=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt11) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:
|
||||
{
|
||||
if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt11 >= 1 ) break loop11;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(11, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt11++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_WS"
|
||||
|
||||
// $ANTLR start "RULE_ANY_OTHER"
|
||||
public final void mRULE_ANY_OTHER() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ANY_OTHER;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:431:16: ( . )
|
||||
// InternalNestedRefsTestLanguage.g:431:18: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ANY_OTHER"
|
||||
|
||||
public void mTokens() throws RecognitionException {
|
||||
// InternalNestedRefsTestLanguage.g:1:8: ( T__11 | T__12 | T__13 | T__14 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
|
||||
int alt12=11;
|
||||
alt12 = dfa12.predict(input);
|
||||
switch (alt12) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:1:10: T__11
|
||||
{
|
||||
mT__11();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalNestedRefsTestLanguage.g:1:16: T__12
|
||||
{
|
||||
mT__12();
|
||||
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// InternalNestedRefsTestLanguage.g:1:22: T__13
|
||||
{
|
||||
mT__13();
|
||||
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// InternalNestedRefsTestLanguage.g:1:28: T__14
|
||||
{
|
||||
mT__14();
|
||||
|
||||
}
|
||||
break;
|
||||
case 5 :
|
||||
// InternalNestedRefsTestLanguage.g:1:34: RULE_ID
|
||||
{
|
||||
mRULE_ID();
|
||||
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
// InternalNestedRefsTestLanguage.g:1:42: RULE_INT
|
||||
{
|
||||
mRULE_INT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 7 :
|
||||
// InternalNestedRefsTestLanguage.g:1:51: RULE_STRING
|
||||
{
|
||||
mRULE_STRING();
|
||||
|
||||
}
|
||||
break;
|
||||
case 8 :
|
||||
// InternalNestedRefsTestLanguage.g:1:63: RULE_ML_COMMENT
|
||||
{
|
||||
mRULE_ML_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 9 :
|
||||
// InternalNestedRefsTestLanguage.g:1:79: RULE_SL_COMMENT
|
||||
{
|
||||
mRULE_SL_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 10 :
|
||||
// InternalNestedRefsTestLanguage.g:1:95: RULE_WS
|
||||
{
|
||||
mRULE_WS();
|
||||
|
||||
}
|
||||
break;
|
||||
case 11 :
|
||||
// InternalNestedRefsTestLanguage.g:1:103: RULE_ANY_OTHER
|
||||
{
|
||||
mRULE_ANY_OTHER();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected DFA12 dfa12 = new DFA12(this);
|
||||
static final String DFA12_eotS =
|
||||
"\1\uffff\2\16\2\uffff\1\14\2\uffff\3\14\2\uffff\1\16\1\uffff\1\16\7\uffff\1\16\1\32\1\33\2\uffff";
|
||||
static final String DFA12_eofS =
|
||||
"\34\uffff";
|
||||
static final String DFA12_minS =
|
||||
"\1\0\1\145\1\156\2\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\143\1\uffff\1\144\7\uffff\1\154\2\60\2\uffff";
|
||||
static final String DFA12_maxS =
|
||||
"\1\uffff\1\145\1\156\2\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\143\1\uffff\1\144\7\uffff\1\154\2\172\2\uffff";
|
||||
static final String DFA12_acceptS =
|
||||
"\3\uffff\1\3\1\4\1\uffff\1\5\1\6\3\uffff\1\12\1\13\1\uffff\1\5\1\uffff\1\3\1\4\1\6\1\7\1\10\1\11\1\12\3\uffff\1\2\1\1";
|
||||
static final String DFA12_specialS =
|
||||
"\1\0\7\uffff\1\1\1\2\22\uffff}>";
|
||||
static final String[] DFA12_transitionS = {
|
||||
"\11\14\2\13\2\14\1\13\22\14\1\13\1\14\1\10\4\14\1\11\6\14\1\4\1\12\12\7\1\14\1\3\5\14\32\6\3\14\1\5\1\6\1\14\3\6\1\1\1\2\25\6\uff85\14",
|
||||
"\1\15",
|
||||
"\1\17",
|
||||
"",
|
||||
"",
|
||||
"\32\16\4\uffff\1\16\1\uffff\32\16",
|
||||
"",
|
||||
"",
|
||||
"\0\23",
|
||||
"\0\23",
|
||||
"\1\24\4\uffff\1\25",
|
||||
"",
|
||||
"",
|
||||
"\1\27",
|
||||
"",
|
||||
"\1\30",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"\1\31",
|
||||
"\12\16\7\uffff\32\16\4\uffff\1\16\1\uffff\32\16",
|
||||
"\12\16\7\uffff\32\16\4\uffff\1\16\1\uffff\32\16",
|
||||
"",
|
||||
""
|
||||
};
|
||||
|
||||
static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
|
||||
static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
|
||||
static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
|
||||
static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
|
||||
static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
|
||||
static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
|
||||
static final short[][] DFA12_transition;
|
||||
|
||||
static {
|
||||
int numStates = DFA12_transitionS.length;
|
||||
DFA12_transition = new short[numStates][];
|
||||
for (int i=0; i<numStates; i++) {
|
||||
DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
class DFA12 extends DFA {
|
||||
|
||||
public DFA12(BaseRecognizer recognizer) {
|
||||
this.recognizer = recognizer;
|
||||
this.decisionNumber = 12;
|
||||
this.eot = DFA12_eot;
|
||||
this.eof = DFA12_eof;
|
||||
this.min = DFA12_min;
|
||||
this.max = DFA12_max;
|
||||
this.accept = DFA12_accept;
|
||||
this.special = DFA12_special;
|
||||
this.transition = DFA12_transition;
|
||||
}
|
||||
public String getDescription() {
|
||||
return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
|
||||
}
|
||||
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
|
||||
IntStream input = _input;
|
||||
int _s = s;
|
||||
switch ( s ) {
|
||||
case 0 :
|
||||
int LA12_0 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( (LA12_0=='d') ) {s = 1;}
|
||||
|
||||
else if ( (LA12_0=='e') ) {s = 2;}
|
||||
|
||||
else if ( (LA12_0==';') ) {s = 3;}
|
||||
|
||||
else if ( (LA12_0=='.') ) {s = 4;}
|
||||
|
||||
else if ( (LA12_0=='^') ) {s = 5;}
|
||||
|
||||
else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='a' && LA12_0<='c')||(LA12_0>='f' && LA12_0<='z')) ) {s = 6;}
|
||||
|
||||
else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 7;}
|
||||
|
||||
else if ( (LA12_0=='\"') ) {s = 8;}
|
||||
|
||||
else if ( (LA12_0=='\'') ) {s = 9;}
|
||||
|
||||
else if ( (LA12_0=='/') ) {s = 10;}
|
||||
|
||||
else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 11;}
|
||||
|
||||
else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='-')||LA12_0==':'||(LA12_0>='<' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFF')) ) {s = 12;}
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 1 :
|
||||
int LA12_8 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_8>='\u0000' && LA12_8<='\uFFFF')) ) {s = 19;}
|
||||
|
||||
else s = 12;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 2 :
|
||||
int LA12_9 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_9>='\u0000' && LA12_9<='\uFFFF')) ) {s = 19;}
|
||||
|
||||
else s = 12;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
}
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException(getDescription(), 12, _s, input);
|
||||
error(nvae);
|
||||
throw nvae;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.ide;
|
||||
|
||||
|
||||
/**
|
||||
* Use this class to register ide components.
|
||||
*/
|
||||
public class NestedRefsTestLanguageIdeModule extends AbstractNestedRefsTestLanguageIdeModule {
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.ide;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguageRuntimeModule;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguageStandaloneSetup;
|
||||
import org.eclipse.xtext.util.Modules2;
|
||||
|
||||
/**
|
||||
* Initialization support for running Xtext languages as language servers.
|
||||
*/
|
||||
public class NestedRefsTestLanguageIdeSetup extends NestedRefsTestLanguageStandaloneSetup {
|
||||
|
||||
@Override
|
||||
public Injector createInjector() {
|
||||
return Guice.createInjector(Modules2.mixin(new NestedRefsTestLanguageRuntimeModule(), new NestedRefsTestLanguageIdeModule()));
|
||||
}
|
||||
|
||||
}
|
|
@ -75,5 +75,17 @@ Export-Package: org.eclipse.xtext.testlanguages.backtracking,
|
|||
org.eclipse.xtext.testlanguages.fileAware.scoping,
|
||||
org.eclipse.xtext.testlanguages.fileAware,
|
||||
org.eclipse.xtext.testlanguages.fileAware.generator,
|
||||
org.eclipse.xtext.testlanguages.fileAware.tests;x-internal=true
|
||||
org.eclipse.xtext.testlanguages.fileAware.tests;x-internal=true,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.scoping,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.generator,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.services,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.internal,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.validation,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.serializer,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.util,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.formatting2,
|
||||
org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl
|
||||
Automatic-Module-Name: org.eclipse.xtext.testlanguages
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?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="nestedRefs" nsURI="http://www.eclipse.org/xtext/testlanguage/NestedRefs"
|
||||
nsPrefix="nestedRefs">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Doc">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
|
||||
eType="#//SelfReferingDecl" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="SelfReferingDecl">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="selfRef" eType="#//SelfReferingDecl"/>
|
||||
</eClassifiers>
|
||||
</ecore:EPackage>
|
|
@ -0,0 +1,17 @@
|
|||
<?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" copyrightText="generated by Xtext" modelDirectory="/org.eclipse.xtext.testlanguages/src-gen"
|
||||
modelPluginID="org.eclipse.xtext.testlanguages" forceOverwrite="true" modelName="NestedRefsTestLanguage"
|
||||
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
|
||||
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.9">
|
||||
<genPackages prefix="NestedRefs" basePackage="org.eclipse.xtext.testlanguages.nestedRefs"
|
||||
disposableProviderFactory="true" fileExtensions="nestedRefs" ecorePackage="NestedRefsTestLanguage.ecore#/">
|
||||
<genClasses ecoreClass="NestedRefsTestLanguage.ecore#//Doc">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference NestedRefsTestLanguage.ecore#//Doc/declarations"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="NestedRefsTestLanguage.ecore#//SelfReferingDecl">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute NestedRefsTestLanguage.ecore#//SelfReferingDecl/name"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference NestedRefsTestLanguage.ecore#//SelfReferingDecl/selfRef"/>
|
||||
</genClasses>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
|
@ -25,4 +25,10 @@
|
|||
class = "org.eclipse.xtext.testlanguages.fileAware.fileAware.FileAwarePackage"
|
||||
genModel = "model/generated/FileAwareTestLanguage.genmodel" />
|
||||
</extension>
|
||||
<extension point="org.eclipse.emf.ecore.generated_package">
|
||||
<package
|
||||
uri = "http://www.eclipse.org/xtext/testlanguage/NestedRefs"
|
||||
class = "org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage"
|
||||
genModel = "model/generated/NestedRefsTestLanguage.genmodel" />
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -0,0 +1,194 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs;
|
||||
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.name.Names;
|
||||
import java.util.Properties;
|
||||
import org.eclipse.xtext.Constants;
|
||||
import org.eclipse.xtext.IGrammarAccess;
|
||||
import org.eclipse.xtext.generator.IGenerator2;
|
||||
import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider;
|
||||
import org.eclipse.xtext.naming.IQualifiedNameProvider;
|
||||
import org.eclipse.xtext.parser.IParser;
|
||||
import org.eclipse.xtext.parser.ITokenToStringConverter;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter;
|
||||
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
|
||||
import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
import org.eclipse.xtext.parser.antlr.LexerBindings;
|
||||
import org.eclipse.xtext.parser.antlr.LexerProvider;
|
||||
import org.eclipse.xtext.resource.IContainer;
|
||||
import org.eclipse.xtext.resource.IResourceDescriptions;
|
||||
import org.eclipse.xtext.resource.containers.IAllContainersState;
|
||||
import org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider;
|
||||
import org.eclipse.xtext.resource.containers.StateBasedContainerManager;
|
||||
import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider;
|
||||
import org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions;
|
||||
import org.eclipse.xtext.scoping.IGlobalScopeProvider;
|
||||
import org.eclipse.xtext.scoping.IScopeProvider;
|
||||
import org.eclipse.xtext.scoping.IgnoreCaseLinking;
|
||||
import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
|
||||
import org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider;
|
||||
import org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider;
|
||||
import org.eclipse.xtext.serializer.ISerializer;
|
||||
import org.eclipse.xtext.serializer.impl.Serializer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer;
|
||||
import org.eclipse.xtext.service.DefaultRuntimeModule;
|
||||
import org.eclipse.xtext.service.SingletonBinding;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.generator.NestedRefsTestLanguageGenerator;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.NestedRefsTestLanguageAntlrTokenFileProvider;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.NestedRefsTestLanguageParser;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.internal.InternalNestedRefsTestLanguageLexer;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.scoping.NestedRefsTestLanguageScopeProvider;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.serializer.NestedRefsTestLanguageSemanticSequencer;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.serializer.NestedRefsTestLanguageSyntacticSequencer;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.services.NestedRefsTestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.validation.NestedRefsTestLanguageValidator;
|
||||
|
||||
/**
|
||||
* Manual modifications go to {@link NestedRefsTestLanguageRuntimeModule}.
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public abstract class AbstractNestedRefsTestLanguageRuntimeModule extends DefaultRuntimeModule {
|
||||
|
||||
protected Properties properties = null;
|
||||
|
||||
@Override
|
||||
public void configure(Binder binder) {
|
||||
properties = tryBindProperties(binder, "org/eclipse/xtext/testlanguages/nestedRefs/NestedRefsTestLanguage.properties");
|
||||
super.configure(binder);
|
||||
}
|
||||
|
||||
public void configureLanguageName(Binder binder) {
|
||||
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage");
|
||||
}
|
||||
|
||||
public void configureFileExtensions(Binder binder) {
|
||||
if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
|
||||
binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("nestedRefs");
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
|
||||
public ClassLoader bindClassLoaderToInstance() {
|
||||
return getClass().getClassLoader();
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
|
||||
public Class<? extends IGrammarAccess> bindIGrammarAccess() {
|
||||
return NestedRefsTestLanguageGrammarAccess.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
|
||||
return NestedRefsTestLanguageSemanticSequencer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
|
||||
return NestedRefsTestLanguageSyntacticSequencer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISerializer> bindISerializer() {
|
||||
return Serializer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IParser> bindIParser() {
|
||||
return NestedRefsTestLanguageParser.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends ITokenToStringConverter> bindITokenToStringConverter() {
|
||||
return AntlrTokenToStringConverter.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
|
||||
return NestedRefsTestLanguageAntlrTokenFileProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends Lexer> bindLexer() {
|
||||
return InternalNestedRefsTestLanguageLexer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
|
||||
return AntlrTokenDefProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Provider<? extends InternalNestedRefsTestLanguageLexer> provideInternalNestedRefsTestLanguageLexer() {
|
||||
return LexerProvider.create(InternalNestedRefsTestLanguageLexer.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public void configureRuntimeLexer(Binder binder) {
|
||||
binder.bind(Lexer.class)
|
||||
.annotatedWith(Names.named(LexerBindings.RUNTIME))
|
||||
.to(InternalNestedRefsTestLanguageLexer.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2
|
||||
@SingletonBinding(eager=true)
|
||||
public Class<? extends NestedRefsTestLanguageValidator> bindNestedRefsTestLanguageValidator() {
|
||||
return NestedRefsTestLanguageValidator.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
||||
public Class<? extends IScopeProvider> bindIScopeProvider() {
|
||||
return NestedRefsTestLanguageScopeProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
||||
public void configureIScopeProviderDelegate(Binder binder) {
|
||||
binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ImportedNamespaceAwareLocalScopeProvider.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
||||
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
|
||||
return DefaultGlobalScopeProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
||||
public void configureIgnoreCaseLinking(Binder binder) {
|
||||
binder.bindConstant().annotatedWith(IgnoreCaseLinking.class).to(false);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2
|
||||
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
|
||||
return DefaultDeclarativeQualifiedNameProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
|
||||
public Class<? extends IContainer.Manager> bindIContainer$Manager() {
|
||||
return StateBasedContainerManager.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
|
||||
public Class<? extends IAllContainersState.Provider> bindIAllContainersState$Provider() {
|
||||
return ResourceSetBasedAllContainersStateProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
|
||||
public void configureIResourceDescriptions(Binder binder) {
|
||||
binder.bind(IResourceDescriptions.class).to(ResourceSetBasedResourceDescriptions.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
|
||||
public void configureIResourceDescriptionsPersisted(Binder binder) {
|
||||
binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2
|
||||
public Class<? extends IGenerator2> bindIGenerator2() {
|
||||
return NestedRefsTestLanguageGenerator.class;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.xtext.ISetup;
|
||||
import org.eclipse.xtext.common.TerminalsStandaloneSetup;
|
||||
import org.eclipse.xtext.resource.IResourceFactory;
|
||||
import org.eclipse.xtext.resource.IResourceServiceProvider;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class NestedRefsTestLanguageStandaloneSetupGenerated implements ISetup {
|
||||
|
||||
@Override
|
||||
public Injector createInjectorAndDoEMFRegistration() {
|
||||
TerminalsStandaloneSetup.doSetup();
|
||||
|
||||
Injector injector = createInjector();
|
||||
register(injector);
|
||||
return injector;
|
||||
}
|
||||
|
||||
public Injector createInjector() {
|
||||
return Guice.createInjector(new NestedRefsTestLanguageRuntimeModule());
|
||||
}
|
||||
|
||||
public void register(Injector injector) {
|
||||
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/testlanguage/NestedRefs")) {
|
||||
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/testlanguage/NestedRefs", NestedRefsPackage.eINSTANCE);
|
||||
}
|
||||
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
|
||||
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
|
||||
|
||||
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("nestedRefs", resourceFactory);
|
||||
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("nestedRefs", serviceProvider);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Doc</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc#getDeclarations <em>Declarations</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage#getDoc()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Doc extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Declarations</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Declarations</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Declarations</em>' containment reference list.
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage#getDoc_Declarations()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<SelfReferingDecl> getDeclarations();
|
||||
|
||||
} // Doc
|
|
@ -0,0 +1,53 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs;
|
||||
|
||||
import org.eclipse.emf.ecore.EFactory;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Factory</b> for the model.
|
||||
* It provides a create method for each non-abstract class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage
|
||||
* @generated
|
||||
*/
|
||||
public interface NestedRefsFactory extends EFactory
|
||||
{
|
||||
/**
|
||||
* The singleton instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
NestedRefsFactory eINSTANCE = org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.NestedRefsFactoryImpl.init();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Doc</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Doc</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Doc createDoc();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Self Refering Decl</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Self Refering Decl</em>'.
|
||||
* @generated
|
||||
*/
|
||||
SelfReferingDecl createSelfReferingDecl();
|
||||
|
||||
/**
|
||||
* Returns the package supported by this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the package supported by this factory.
|
||||
* @generated
|
||||
*/
|
||||
NestedRefsPackage getNestedRefsPackage();
|
||||
|
||||
} //NestedRefsFactory
|
|
@ -0,0 +1,248 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Package</b> for the model.
|
||||
* It contains accessors for the meta objects to represent
|
||||
* <ul>
|
||||
* <li>each class,</li>
|
||||
* <li>each feature of each class,</li>
|
||||
* <li>each enum,</li>
|
||||
* <li>and each data type</li>
|
||||
* </ul>
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsFactory
|
||||
* @model kind="package"
|
||||
* @generated
|
||||
*/
|
||||
public interface NestedRefsPackage extends EPackage
|
||||
{
|
||||
/**
|
||||
* The package name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNAME = "nestedRefs";
|
||||
|
||||
/**
|
||||
* The package namespace URI.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNS_URI = "http://www.eclipse.org/xtext/testlanguage/NestedRefs";
|
||||
|
||||
/**
|
||||
* The package namespace name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNS_PREFIX = "nestedRefs";
|
||||
|
||||
/**
|
||||
* The singleton instance of the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
NestedRefsPackage eINSTANCE = org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.NestedRefsPackageImpl.init();
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.DocImpl <em>Doc</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.DocImpl
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.NestedRefsPackageImpl#getDoc()
|
||||
* @generated
|
||||
*/
|
||||
int DOC = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Declarations</b></em>' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int DOC__DECLARATIONS = 0;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Doc</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int DOC_FEATURE_COUNT = 1;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.SelfReferingDeclImpl <em>Self Refering Decl</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.SelfReferingDeclImpl
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.NestedRefsPackageImpl#getSelfReferingDecl()
|
||||
* @generated
|
||||
*/
|
||||
int SELF_REFERING_DECL = 1;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int SELF_REFERING_DECL__NAME = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Self Ref</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int SELF_REFERING_DECL__SELF_REF = 1;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Self Refering Decl</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int SELF_REFERING_DECL_FEATURE_COUNT = 2;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc <em>Doc</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Doc</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc
|
||||
* @generated
|
||||
*/
|
||||
EClass getDoc();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the containment reference list '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc#getDeclarations <em>Declarations</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the containment reference list '<em>Declarations</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc#getDeclarations()
|
||||
* @see #getDoc()
|
||||
* @generated
|
||||
*/
|
||||
EReference getDoc_Declarations();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl <em>Self Refering Decl</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Self Refering Decl</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl
|
||||
* @generated
|
||||
*/
|
||||
EClass getSelfReferingDecl();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl#getName <em>Name</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Name</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl#getName()
|
||||
* @see #getSelfReferingDecl()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getSelfReferingDecl_Name();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the reference '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl#getSelfRef <em>Self Ref</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the reference '<em>Self Ref</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl#getSelfRef()
|
||||
* @see #getSelfReferingDecl()
|
||||
* @generated
|
||||
*/
|
||||
EReference getSelfReferingDecl_SelfRef();
|
||||
|
||||
/**
|
||||
* Returns the factory that creates the instances of the model.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the factory that creates the instances of the model.
|
||||
* @generated
|
||||
*/
|
||||
NestedRefsFactory getNestedRefsFactory();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* Defines literals for the meta objects that represent
|
||||
* <ul>
|
||||
* <li>each class,</li>
|
||||
* <li>each feature of each class,</li>
|
||||
* <li>each enum,</li>
|
||||
* <li>and each data type</li>
|
||||
* </ul>
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
interface Literals
|
||||
{
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.DocImpl <em>Doc</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.DocImpl
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.NestedRefsPackageImpl#getDoc()
|
||||
* @generated
|
||||
*/
|
||||
EClass DOC = eINSTANCE.getDoc();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Declarations</b></em>' containment reference list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference DOC__DECLARATIONS = eINSTANCE.getDoc_Declarations();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.SelfReferingDeclImpl <em>Self Refering Decl</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.SelfReferingDeclImpl
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.NestedRefsPackageImpl#getSelfReferingDecl()
|
||||
* @generated
|
||||
*/
|
||||
EClass SELF_REFERING_DECL = eINSTANCE.getSelfReferingDecl();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute SELF_REFERING_DECL__NAME = eINSTANCE.getSelfReferingDecl_Name();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Self Ref</b></em>' reference feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference SELF_REFERING_DECL__SELF_REF = eINSTANCE.getSelfReferingDecl_SelfRef();
|
||||
|
||||
}
|
||||
|
||||
} //NestedRefsPackage
|
|
@ -0,0 +1,79 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Self Refering Decl</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl#getSelfRef <em>Self Ref</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage#getSelfReferingDecl()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface SelfReferingDecl extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Name</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage#getSelfReferingDecl_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Self Ref</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Self Ref</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Self Ref</em>' reference.
|
||||
* @see #setSelfRef(SelfReferingDecl)
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage#getSelfReferingDecl_SelfRef()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
SelfReferingDecl getSelfRef();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl#getSelfRef <em>Self Ref</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Self Ref</em>' reference.
|
||||
* @see #getSelfRef()
|
||||
* @generated
|
||||
*/
|
||||
void setSelfRef(SelfReferingDecl value);
|
||||
|
||||
} // SelfReferingDecl
|
|
@ -0,0 +1,168 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Doc</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.DocImpl#getDeclarations <em>Declarations</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class DocImpl extends MinimalEObjectImpl.Container implements Doc
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getDeclarations() <em>Declarations</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDeclarations()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<SelfReferingDecl> declarations;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected DocImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return NestedRefsPackage.Literals.DOC;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<SelfReferingDecl> getDeclarations()
|
||||
{
|
||||
if (declarations == null)
|
||||
{
|
||||
declarations = new EObjectContainmentEList<SelfReferingDecl>(SelfReferingDecl.class, this, NestedRefsPackage.DOC__DECLARATIONS);
|
||||
}
|
||||
return declarations;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.DOC__DECLARATIONS:
|
||||
return ((InternalEList<?>)getDeclarations()).basicRemove(otherEnd, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.DOC__DECLARATIONS:
|
||||
return getDeclarations();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.DOC__DECLARATIONS:
|
||||
getDeclarations().clear();
|
||||
getDeclarations().addAll((Collection<? extends SelfReferingDecl>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.DOC__DECLARATIONS:
|
||||
getDeclarations().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.DOC__DECLARATIONS:
|
||||
return declarations != null && !declarations.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
} //DocImpl
|
|
@ -0,0 +1,119 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.plugin.EcorePlugin;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Factory</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class NestedRefsFactoryImpl extends EFactoryImpl implements NestedRefsFactory
|
||||
{
|
||||
/**
|
||||
* Creates the default factory implementation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static NestedRefsFactory init()
|
||||
{
|
||||
try
|
||||
{
|
||||
NestedRefsFactory theNestedRefsFactory = (NestedRefsFactory)EPackage.Registry.INSTANCE.getEFactory(NestedRefsPackage.eNS_URI);
|
||||
if (theNestedRefsFactory != null)
|
||||
{
|
||||
return theNestedRefsFactory;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
EcorePlugin.INSTANCE.log(exception);
|
||||
}
|
||||
return new NestedRefsFactoryImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public NestedRefsFactoryImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EObject create(EClass eClass)
|
||||
{
|
||||
switch (eClass.getClassifierID())
|
||||
{
|
||||
case NestedRefsPackage.DOC: return createDoc();
|
||||
case NestedRefsPackage.SELF_REFERING_DECL: return createSelfReferingDecl();
|
||||
default:
|
||||
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Doc createDoc()
|
||||
{
|
||||
DocImpl doc = new DocImpl();
|
||||
return doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SelfReferingDecl createSelfReferingDecl()
|
||||
{
|
||||
SelfReferingDeclImpl selfReferingDecl = new SelfReferingDeclImpl();
|
||||
return selfReferingDecl;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public NestedRefsPackage getNestedRefsPackage()
|
||||
{
|
||||
return (NestedRefsPackage)getEPackage();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @deprecated
|
||||
* @generated
|
||||
*/
|
||||
@Deprecated
|
||||
public static NestedRefsPackage getPackage()
|
||||
{
|
||||
return NestedRefsPackage.eINSTANCE;
|
||||
}
|
||||
|
||||
} //NestedRefsFactoryImpl
|
|
@ -0,0 +1,233 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EPackageImpl;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsFactory;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Package</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class NestedRefsPackageImpl extends EPackageImpl implements NestedRefsPackage
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass docEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass selfReferingDeclEClass = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of the model <b>Package</b>, registered with
|
||||
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
|
||||
* package URI value.
|
||||
* <p>Note: the correct way to create the package is via the static
|
||||
* factory method {@link #init init()}, which also performs
|
||||
* initialization of the package, or returns the registered package,
|
||||
* if one already exists.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.emf.ecore.EPackage.Registry
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage#eNS_URI
|
||||
* @see #init()
|
||||
* @generated
|
||||
*/
|
||||
private NestedRefsPackageImpl()
|
||||
{
|
||||
super(eNS_URI, NestedRefsFactory.eINSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static boolean isInited = false;
|
||||
|
||||
/**
|
||||
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
|
||||
*
|
||||
* <p>This method is used to initialize {@link NestedRefsPackage#eINSTANCE} when that field is accessed.
|
||||
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #eNS_URI
|
||||
* @see #createPackageContents()
|
||||
* @see #initializePackageContents()
|
||||
* @generated
|
||||
*/
|
||||
public static NestedRefsPackage init()
|
||||
{
|
||||
if (isInited) return (NestedRefsPackage)EPackage.Registry.INSTANCE.getEPackage(NestedRefsPackage.eNS_URI);
|
||||
|
||||
// Obtain or create and register package
|
||||
NestedRefsPackageImpl theNestedRefsPackage = (NestedRefsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof NestedRefsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new NestedRefsPackageImpl());
|
||||
|
||||
isInited = true;
|
||||
|
||||
// Create package meta-data objects
|
||||
theNestedRefsPackage.createPackageContents();
|
||||
|
||||
// Initialize created meta-data
|
||||
theNestedRefsPackage.initializePackageContents();
|
||||
|
||||
// Mark meta-data to indicate it can't be changed
|
||||
theNestedRefsPackage.freeze();
|
||||
|
||||
|
||||
// Update the registry and return the package
|
||||
EPackage.Registry.INSTANCE.put(NestedRefsPackage.eNS_URI, theNestedRefsPackage);
|
||||
return theNestedRefsPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getDoc()
|
||||
{
|
||||
return docEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getDoc_Declarations()
|
||||
{
|
||||
return (EReference)docEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getSelfReferingDecl()
|
||||
{
|
||||
return selfReferingDeclEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getSelfReferingDecl_Name()
|
||||
{
|
||||
return (EAttribute)selfReferingDeclEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getSelfReferingDecl_SelfRef()
|
||||
{
|
||||
return (EReference)selfReferingDeclEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public NestedRefsFactory getNestedRefsFactory()
|
||||
{
|
||||
return (NestedRefsFactory)getEFactoryInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isCreated = false;
|
||||
|
||||
/**
|
||||
* Creates the meta-model objects for the package. This method is
|
||||
* guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void createPackageContents()
|
||||
{
|
||||
if (isCreated) return;
|
||||
isCreated = true;
|
||||
|
||||
// Create classes and their features
|
||||
docEClass = createEClass(DOC);
|
||||
createEReference(docEClass, DOC__DECLARATIONS);
|
||||
|
||||
selfReferingDeclEClass = createEClass(SELF_REFERING_DECL);
|
||||
createEAttribute(selfReferingDeclEClass, SELF_REFERING_DECL__NAME);
|
||||
createEReference(selfReferingDeclEClass, SELF_REFERING_DECL__SELF_REF);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isInitialized = false;
|
||||
|
||||
/**
|
||||
* Complete the initialization of the package and its meta-model. This
|
||||
* method is guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void initializePackageContents()
|
||||
{
|
||||
if (isInitialized) return;
|
||||
isInitialized = true;
|
||||
|
||||
// Initialize package
|
||||
setName(eNAME);
|
||||
setNsPrefix(eNS_PREFIX);
|
||||
setNsURI(eNS_URI);
|
||||
|
||||
// Create type parameters
|
||||
|
||||
// Set bounds for type parameters
|
||||
|
||||
// Add supertypes to classes
|
||||
|
||||
// Initialize classes and features; add operations and parameters
|
||||
initEClass(docEClass, Doc.class, "Doc", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getDoc_Declarations(), this.getSelfReferingDecl(), null, "declarations", null, 0, -1, Doc.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(selfReferingDeclEClass, SelfReferingDecl.class, "SelfReferingDecl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getSelfReferingDecl_Name(), ecorePackage.getEString(), "name", null, 0, 1, SelfReferingDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getSelfReferingDecl_SelfRef(), this.getSelfReferingDecl(), null, "selfRef", null, 0, 1, SelfReferingDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
// Create resource
|
||||
createResource(eNS_URI);
|
||||
}
|
||||
|
||||
} //NestedRefsPackageImpl
|
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Self Refering Decl</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.SelfReferingDeclImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.impl.SelfReferingDeclImpl#getSelfRef <em>Self Ref</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class SelfReferingDeclImpl extends MinimalEObjectImpl.Container implements SelfReferingDecl
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getSelfRef() <em>Self Ref</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getSelfRef()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected SelfReferingDecl selfRef;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected SelfReferingDeclImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return NestedRefsPackage.Literals.SELF_REFERING_DECL;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, NestedRefsPackage.SELF_REFERING_DECL__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SelfReferingDecl getSelfRef()
|
||||
{
|
||||
if (selfRef != null && selfRef.eIsProxy())
|
||||
{
|
||||
InternalEObject oldSelfRef = (InternalEObject)selfRef;
|
||||
selfRef = (SelfReferingDecl)eResolveProxy(oldSelfRef);
|
||||
if (selfRef != oldSelfRef)
|
||||
{
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedRefsPackage.SELF_REFERING_DECL__SELF_REF, oldSelfRef, selfRef));
|
||||
}
|
||||
}
|
||||
return selfRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SelfReferingDecl basicGetSelfRef()
|
||||
{
|
||||
return selfRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setSelfRef(SelfReferingDecl newSelfRef)
|
||||
{
|
||||
SelfReferingDecl oldSelfRef = selfRef;
|
||||
selfRef = newSelfRef;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, NestedRefsPackage.SELF_REFERING_DECL__SELF_REF, oldSelfRef, selfRef));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.SELF_REFERING_DECL__NAME:
|
||||
return getName();
|
||||
case NestedRefsPackage.SELF_REFERING_DECL__SELF_REF:
|
||||
if (resolve) return getSelfRef();
|
||||
return basicGetSelfRef();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.SELF_REFERING_DECL__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
case NestedRefsPackage.SELF_REFERING_DECL__SELF_REF:
|
||||
setSelfRef((SelfReferingDecl)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.SELF_REFERING_DECL__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case NestedRefsPackage.SELF_REFERING_DECL__SELF_REF:
|
||||
setSelfRef((SelfReferingDecl)null);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case NestedRefsPackage.SELF_REFERING_DECL__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case NestedRefsPackage.SELF_REFERING_DECL__SELF_REF:
|
||||
return selfRef != null;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //SelfReferingDeclImpl
|
|
@ -0,0 +1,153 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.util;
|
||||
|
||||
import org.eclipse.emf.common.notify.Adapter;
|
||||
import org.eclipse.emf.common.notify.Notifier;
|
||||
|
||||
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Adapter Factory</b> for the model.
|
||||
* It provides an adapter <code>createXXX</code> method for each class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage
|
||||
* @generated
|
||||
*/
|
||||
public class NestedRefsAdapterFactory extends AdapterFactoryImpl
|
||||
{
|
||||
/**
|
||||
* The cached model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static NestedRefsPackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the adapter factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public NestedRefsAdapterFactory()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = NestedRefsPackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this factory is applicable for the type of the object.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @return whether this factory is applicable for the type of the object.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean isFactoryForType(Object object)
|
||||
{
|
||||
if (object == modelPackage)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (object instanceof EObject)
|
||||
{
|
||||
return ((EObject)object).eClass().getEPackage() == modelPackage;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The switch that delegates to the <code>createXXX</code> methods.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected NestedRefsSwitch<Adapter> modelSwitch =
|
||||
new NestedRefsSwitch<Adapter>()
|
||||
{
|
||||
@Override
|
||||
public Adapter caseDoc(Doc object)
|
||||
{
|
||||
return createDocAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseSelfReferingDecl(SelfReferingDecl object)
|
||||
{
|
||||
return createSelfReferingDeclAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter defaultCase(EObject object)
|
||||
{
|
||||
return createEObjectAdapter();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates an adapter for the <code>target</code>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param target the object to adapt.
|
||||
* @return the adapter for the <code>target</code>.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createAdapter(Notifier target)
|
||||
{
|
||||
return modelSwitch.doSwitch((EObject)target);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc <em>Doc</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createDocAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl <em>Self Refering Decl</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createSelfReferingDeclAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for the default case.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createEObjectAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //NestedRefsAdapterFactory
|
|
@ -0,0 +1,143 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.util;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.util.Switch;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Switch</b> for the model's inheritance hierarchy.
|
||||
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
|
||||
* to invoke the <code>caseXXX</code> method for each class of the model,
|
||||
* starting with the actual class of the object
|
||||
* and proceeding up the inheritance hierarchy
|
||||
* until a non-null result is returned,
|
||||
* which is the result of the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage
|
||||
* @generated
|
||||
*/
|
||||
public class NestedRefsSwitch<T> extends Switch<T>
|
||||
{
|
||||
/**
|
||||
* The cached model package
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static NestedRefsPackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public NestedRefsSwitch()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = NestedRefsPackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether this is a switch for the given package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param ePackage the package in question.
|
||||
* @return whether this is a switch for the given package.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected boolean isSwitchFor(EPackage ePackage)
|
||||
{
|
||||
return ePackage == modelPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected T doSwitch(int classifierID, EObject theEObject)
|
||||
{
|
||||
switch (classifierID)
|
||||
{
|
||||
case NestedRefsPackage.DOC:
|
||||
{
|
||||
Doc doc = (Doc)theEObject;
|
||||
T result = caseDoc(doc);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case NestedRefsPackage.SELF_REFERING_DECL:
|
||||
{
|
||||
SelfReferingDecl selfReferingDecl = (SelfReferingDecl)theEObject;
|
||||
T result = caseSelfReferingDecl(selfReferingDecl);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
default: return defaultCase(theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Doc</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Doc</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseDoc(Doc object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Self Refering Decl</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Self Refering Decl</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseSelfReferingDecl(SelfReferingDecl object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch, but this is the last case anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public T defaultCase(EObject object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //NestedRefsSwitch
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
|
||||
|
||||
public class NestedRefsTestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider {
|
||||
|
||||
@Override
|
||||
public InputStream getAntlrTokenFile() {
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
return classLoader.getResourceAsStream("org/eclipse/xtext/testlanguages/nestedRefs/parser/antlr/internal/InternalNestedRefsTestLanguage.tokens");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.internal.InternalNestedRefsTestLanguageParser;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.services.NestedRefsTestLanguageGrammarAccess;
|
||||
|
||||
public class NestedRefsTestLanguageParser extends AbstractAntlrParser {
|
||||
|
||||
@Inject
|
||||
private NestedRefsTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Override
|
||||
protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
|
||||
tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected InternalNestedRefsTestLanguageParser createParser(XtextTokenStream stream) {
|
||||
return new InternalNestedRefsTestLanguageParser(stream, getGrammarAccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultRuleName() {
|
||||
return "Doc";
|
||||
}
|
||||
|
||||
public NestedRefsTestLanguageGrammarAccess getGrammarAccess() {
|
||||
return this.grammarAccess;
|
||||
}
|
||||
|
||||
public void setGrammarAccess(NestedRefsTestLanguageGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,217 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
grammar InternalNestedRefsTestLanguage;
|
||||
|
||||
options {
|
||||
superClass=AbstractInternalAntlrParser;
|
||||
}
|
||||
|
||||
@lexer::header {
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
}
|
||||
|
||||
@parser::header {
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.internal;
|
||||
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.services.NestedRefsTestLanguageGrammarAccess;
|
||||
|
||||
}
|
||||
|
||||
@parser::members {
|
||||
|
||||
private NestedRefsTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
public InternalNestedRefsTestLanguageParser(TokenStream input, NestedRefsTestLanguageGrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.grammarAccess = grammarAccess;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "Doc";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NestedRefsTestLanguageGrammarAccess getGrammarAccess() {
|
||||
return grammarAccess;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@rulecatch {
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
}
|
||||
|
||||
// Entry rule entryRuleDoc
|
||||
entryRuleDoc returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getDocRule()); }
|
||||
iv_ruleDoc=ruleDoc
|
||||
{ $current=$iv_ruleDoc.current; }
|
||||
EOF;
|
||||
|
||||
// Rule Doc
|
||||
ruleDoc returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getDocAccess().getDeclarationsSelfReferingDeclParserRuleCall_0());
|
||||
}
|
||||
lv_declarations_0_0=ruleSelfReferingDecl
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElementForParent(grammarAccess.getDocRule());
|
||||
}
|
||||
add(
|
||||
$current,
|
||||
"declarations",
|
||||
lv_declarations_0_0,
|
||||
"org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage.SelfReferingDecl");
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)*
|
||||
;
|
||||
|
||||
// Entry rule entryRuleSelfReferingDecl
|
||||
entryRuleSelfReferingDecl returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getSelfReferingDeclRule()); }
|
||||
iv_ruleSelfReferingDecl=ruleSelfReferingDecl
|
||||
{ $current=$iv_ruleSelfReferingDecl.current; }
|
||||
EOF;
|
||||
|
||||
// Rule SelfReferingDecl
|
||||
ruleSelfReferingDecl returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
otherlv_0='decl'
|
||||
{
|
||||
newLeafNode(otherlv_0, grammarAccess.getSelfReferingDeclAccess().getDeclKeyword_0());
|
||||
}
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getSelfReferingDeclAccess().getNameQualifiedNameParserRuleCall_1_0());
|
||||
}
|
||||
lv_name_1_0=ruleQualifiedName
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElementForParent(grammarAccess.getSelfReferingDeclRule());
|
||||
}
|
||||
set(
|
||||
$current,
|
||||
"name",
|
||||
lv_name_1_0,
|
||||
"org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage.QualifiedName");
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)
|
||||
otherlv_2='end'
|
||||
{
|
||||
newLeafNode(otherlv_2, grammarAccess.getSelfReferingDeclAccess().getEndKeyword_2());
|
||||
}
|
||||
(
|
||||
(
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getSelfReferingDeclRule());
|
||||
}
|
||||
}
|
||||
{
|
||||
newCompositeNode(grammarAccess.getSelfReferingDeclAccess().getSelfRefSelfReferingDeclCrossReference_3_0());
|
||||
}
|
||||
ruleQualifiedName
|
||||
{
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)
|
||||
otherlv_4=';'
|
||||
{
|
||||
newLeafNode(otherlv_4, grammarAccess.getSelfReferingDeclAccess().getSemicolonKeyword_4());
|
||||
}
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRuleQualifiedName
|
||||
entryRuleQualifiedName returns [String current=null]:
|
||||
{ newCompositeNode(grammarAccess.getQualifiedNameRule()); }
|
||||
iv_ruleQualifiedName=ruleQualifiedName
|
||||
{ $current=$iv_ruleQualifiedName.current.getText(); }
|
||||
EOF;
|
||||
|
||||
// Rule QualifiedName
|
||||
ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
this_ID_0=RULE_ID
|
||||
{
|
||||
$current.merge(this_ID_0);
|
||||
}
|
||||
{
|
||||
newLeafNode(this_ID_0, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0());
|
||||
}
|
||||
(
|
||||
kw='.'
|
||||
{
|
||||
$current.merge(kw);
|
||||
newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getFullStopKeyword_1_0());
|
||||
}
|
||||
this_ID_2=RULE_ID
|
||||
{
|
||||
$current.merge(this_ID_2);
|
||||
}
|
||||
{
|
||||
newLeafNode(this_ID_2, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_1());
|
||||
}
|
||||
)*
|
||||
)
|
||||
;
|
||||
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\'');
|
||||
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
RULE_ANY_OTHER : .;
|
|
@ -0,0 +1,15 @@
|
|||
'.'=14
|
||||
';'=13
|
||||
'decl'=11
|
||||
'end'=12
|
||||
RULE_ANY_OTHER=10
|
||||
RULE_ID=4
|
||||
RULE_INT=5
|
||||
RULE_ML_COMMENT=7
|
||||
RULE_SL_COMMENT=8
|
||||
RULE_STRING=6
|
||||
RULE_WS=9
|
||||
T__11=11
|
||||
T__12=12
|
||||
T__13=13
|
||||
T__14=14
|
|
@ -0,0 +1,848 @@
|
|||
package org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class InternalNestedRefsTestLanguageLexer extends Lexer {
|
||||
public static final int RULE_ID=4;
|
||||
public static final int RULE_WS=9;
|
||||
public static final int RULE_STRING=6;
|
||||
public static final int RULE_ANY_OTHER=10;
|
||||
public static final int RULE_SL_COMMENT=8;
|
||||
public static final int RULE_INT=5;
|
||||
public static final int T__11=11;
|
||||
public static final int RULE_ML_COMMENT=7;
|
||||
public static final int T__12=12;
|
||||
public static final int T__13=13;
|
||||
public static final int T__14=14;
|
||||
public static final int EOF=-1;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
public InternalNestedRefsTestLanguageLexer() {;}
|
||||
public InternalNestedRefsTestLanguageLexer(CharStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalNestedRefsTestLanguageLexer(CharStream input, RecognizerSharedState state) {
|
||||
super(input,state);
|
||||
|
||||
}
|
||||
public String getGrammarFileName() { return "InternalNestedRefsTestLanguage.g"; }
|
||||
|
||||
// $ANTLR start "T__11"
|
||||
public final void mT__11() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__11;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:11:7: ( 'decl' )
|
||||
// InternalNestedRefsTestLanguage.g:11:9: 'decl'
|
||||
{
|
||||
match("decl");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__11"
|
||||
|
||||
// $ANTLR start "T__12"
|
||||
public final void mT__12() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__12;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:12:7: ( 'end' )
|
||||
// InternalNestedRefsTestLanguage.g:12:9: 'end'
|
||||
{
|
||||
match("end");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__12"
|
||||
|
||||
// $ANTLR start "T__13"
|
||||
public final void mT__13() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__13;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:13:7: ( ';' )
|
||||
// InternalNestedRefsTestLanguage.g:13:9: ';'
|
||||
{
|
||||
match(';');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__13"
|
||||
|
||||
// $ANTLR start "T__14"
|
||||
public final void mT__14() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__14;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:14:7: ( '.' )
|
||||
// InternalNestedRefsTestLanguage.g:14:9: '.'
|
||||
{
|
||||
match('.');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__14"
|
||||
|
||||
// $ANTLR start "RULE_ID"
|
||||
public final void mRULE_ID() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ID;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:205:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
|
||||
// InternalNestedRefsTestLanguage.g:205:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:205:11: ( '^' )?
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( (LA1_0=='^') ) {
|
||||
alt1=1;
|
||||
}
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:205:11: '^'
|
||||
{
|
||||
match('^');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:205:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:
|
||||
{
|
||||
if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ID"
|
||||
|
||||
// $ANTLR start "RULE_INT"
|
||||
public final void mRULE_INT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_INT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:207:10: ( ( '0' .. '9' )+ )
|
||||
// InternalNestedRefsTestLanguage.g:207:12: ( '0' .. '9' )+
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:207:12: ( '0' .. '9' )+
|
||||
int cnt3=0;
|
||||
loop3:
|
||||
do {
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( ((LA3_0>='0' && LA3_0<='9')) ) {
|
||||
alt3=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:207:13: '0' .. '9'
|
||||
{
|
||||
matchRange('0','9');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt3 >= 1 ) break loop3;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(3, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt3++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_INT"
|
||||
|
||||
// $ANTLR start "RULE_STRING"
|
||||
public final void mRULE_STRING() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_STRING;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:209:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
|
||||
// InternalNestedRefsTestLanguage.g:209:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:209:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
int alt6=2;
|
||||
int LA6_0 = input.LA(1);
|
||||
|
||||
if ( (LA6_0=='\"') ) {
|
||||
alt6=1;
|
||||
}
|
||||
else if ( (LA6_0=='\'') ) {
|
||||
alt6=2;
|
||||
}
|
||||
else {
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 6, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
switch (alt6) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:209:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
|
||||
{
|
||||
match('\"');
|
||||
// InternalNestedRefsTestLanguage.g:209:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
|
||||
loop4:
|
||||
do {
|
||||
int alt4=3;
|
||||
int LA4_0 = input.LA(1);
|
||||
|
||||
if ( (LA4_0=='\\') ) {
|
||||
alt4=1;
|
||||
}
|
||||
else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) {
|
||||
alt4=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:209:21: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalNestedRefsTestLanguage.g:209:28: ~ ( ( '\\\\' | '\"' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop4;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\"');
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalNestedRefsTestLanguage.g:209:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
|
||||
{
|
||||
match('\'');
|
||||
// InternalNestedRefsTestLanguage.g:209:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
|
||||
loop5:
|
||||
do {
|
||||
int alt5=3;
|
||||
int LA5_0 = input.LA(1);
|
||||
|
||||
if ( (LA5_0=='\\') ) {
|
||||
alt5=1;
|
||||
}
|
||||
else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) {
|
||||
alt5=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:209:54: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalNestedRefsTestLanguage.g:209:61: ~ ( ( '\\\\' | '\\'' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop5;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\'');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_STRING"
|
||||
|
||||
// $ANTLR start "RULE_ML_COMMENT"
|
||||
public final void mRULE_ML_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ML_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:211:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
|
||||
// InternalNestedRefsTestLanguage.g:211:19: '/*' ( options {greedy=false; } : . )* '*/'
|
||||
{
|
||||
match("/*");
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:211:24: ( options {greedy=false; } : . )*
|
||||
loop7:
|
||||
do {
|
||||
int alt7=2;
|
||||
int LA7_0 = input.LA(1);
|
||||
|
||||
if ( (LA7_0=='*') ) {
|
||||
int LA7_1 = input.LA(2);
|
||||
|
||||
if ( (LA7_1=='/') ) {
|
||||
alt7=2;
|
||||
}
|
||||
else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt7) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:211:52: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop7;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match("*/");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ML_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_SL_COMMENT"
|
||||
public final void mRULE_SL_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_SL_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:213:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
|
||||
// InternalNestedRefsTestLanguage.g:213:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
|
||||
{
|
||||
match("//");
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:213:24: (~ ( ( '\\n' | '\\r' ) ) )*
|
||||
loop8:
|
||||
do {
|
||||
int alt8=2;
|
||||
int LA8_0 = input.LA(1);
|
||||
|
||||
if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) {
|
||||
alt8=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt8) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:213:24: ~ ( ( '\\n' | '\\r' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop8;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:213:40: ( ( '\\r' )? '\\n' )?
|
||||
int alt10=2;
|
||||
int LA10_0 = input.LA(1);
|
||||
|
||||
if ( (LA10_0=='\n'||LA10_0=='\r') ) {
|
||||
alt10=1;
|
||||
}
|
||||
switch (alt10) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:213:41: ( '\\r' )? '\\n'
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:213:41: ( '\\r' )?
|
||||
int alt9=2;
|
||||
int LA9_0 = input.LA(1);
|
||||
|
||||
if ( (LA9_0=='\r') ) {
|
||||
alt9=1;
|
||||
}
|
||||
switch (alt9) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:213:41: '\\r'
|
||||
{
|
||||
match('\r');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
match('\n');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_SL_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_WS"
|
||||
public final void mRULE_WS() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_WS;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:215:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
||||
// InternalNestedRefsTestLanguage.g:215:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:215:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
int cnt11=0;
|
||||
loop11:
|
||||
do {
|
||||
int alt11=2;
|
||||
int LA11_0 = input.LA(1);
|
||||
|
||||
if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
|
||||
alt11=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt11) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:
|
||||
{
|
||||
if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt11 >= 1 ) break loop11;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(11, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt11++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_WS"
|
||||
|
||||
// $ANTLR start "RULE_ANY_OTHER"
|
||||
public final void mRULE_ANY_OTHER() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ANY_OTHER;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalNestedRefsTestLanguage.g:217:16: ( . )
|
||||
// InternalNestedRefsTestLanguage.g:217:18: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ANY_OTHER"
|
||||
|
||||
public void mTokens() throws RecognitionException {
|
||||
// InternalNestedRefsTestLanguage.g:1:8: ( T__11 | T__12 | T__13 | T__14 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
|
||||
int alt12=11;
|
||||
alt12 = dfa12.predict(input);
|
||||
switch (alt12) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:1:10: T__11
|
||||
{
|
||||
mT__11();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalNestedRefsTestLanguage.g:1:16: T__12
|
||||
{
|
||||
mT__12();
|
||||
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// InternalNestedRefsTestLanguage.g:1:22: T__13
|
||||
{
|
||||
mT__13();
|
||||
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// InternalNestedRefsTestLanguage.g:1:28: T__14
|
||||
{
|
||||
mT__14();
|
||||
|
||||
}
|
||||
break;
|
||||
case 5 :
|
||||
// InternalNestedRefsTestLanguage.g:1:34: RULE_ID
|
||||
{
|
||||
mRULE_ID();
|
||||
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
// InternalNestedRefsTestLanguage.g:1:42: RULE_INT
|
||||
{
|
||||
mRULE_INT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 7 :
|
||||
// InternalNestedRefsTestLanguage.g:1:51: RULE_STRING
|
||||
{
|
||||
mRULE_STRING();
|
||||
|
||||
}
|
||||
break;
|
||||
case 8 :
|
||||
// InternalNestedRefsTestLanguage.g:1:63: RULE_ML_COMMENT
|
||||
{
|
||||
mRULE_ML_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 9 :
|
||||
// InternalNestedRefsTestLanguage.g:1:79: RULE_SL_COMMENT
|
||||
{
|
||||
mRULE_SL_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 10 :
|
||||
// InternalNestedRefsTestLanguage.g:1:95: RULE_WS
|
||||
{
|
||||
mRULE_WS();
|
||||
|
||||
}
|
||||
break;
|
||||
case 11 :
|
||||
// InternalNestedRefsTestLanguage.g:1:103: RULE_ANY_OTHER
|
||||
{
|
||||
mRULE_ANY_OTHER();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected DFA12 dfa12 = new DFA12(this);
|
||||
static final String DFA12_eotS =
|
||||
"\1\uffff\2\16\2\uffff\1\14\2\uffff\3\14\2\uffff\1\16\1\uffff\1\16\7\uffff\1\16\1\32\1\33\2\uffff";
|
||||
static final String DFA12_eofS =
|
||||
"\34\uffff";
|
||||
static final String DFA12_minS =
|
||||
"\1\0\1\145\1\156\2\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\143\1\uffff\1\144\7\uffff\1\154\2\60\2\uffff";
|
||||
static final String DFA12_maxS =
|
||||
"\1\uffff\1\145\1\156\2\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\143\1\uffff\1\144\7\uffff\1\154\2\172\2\uffff";
|
||||
static final String DFA12_acceptS =
|
||||
"\3\uffff\1\3\1\4\1\uffff\1\5\1\6\3\uffff\1\12\1\13\1\uffff\1\5\1\uffff\1\3\1\4\1\6\1\7\1\10\1\11\1\12\3\uffff\1\2\1\1";
|
||||
static final String DFA12_specialS =
|
||||
"\1\0\7\uffff\1\1\1\2\22\uffff}>";
|
||||
static final String[] DFA12_transitionS = {
|
||||
"\11\14\2\13\2\14\1\13\22\14\1\13\1\14\1\10\4\14\1\11\6\14\1\4\1\12\12\7\1\14\1\3\5\14\32\6\3\14\1\5\1\6\1\14\3\6\1\1\1\2\25\6\uff85\14",
|
||||
"\1\15",
|
||||
"\1\17",
|
||||
"",
|
||||
"",
|
||||
"\32\16\4\uffff\1\16\1\uffff\32\16",
|
||||
"",
|
||||
"",
|
||||
"\0\23",
|
||||
"\0\23",
|
||||
"\1\24\4\uffff\1\25",
|
||||
"",
|
||||
"",
|
||||
"\1\27",
|
||||
"",
|
||||
"\1\30",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"\1\31",
|
||||
"\12\16\7\uffff\32\16\4\uffff\1\16\1\uffff\32\16",
|
||||
"\12\16\7\uffff\32\16\4\uffff\1\16\1\uffff\32\16",
|
||||
"",
|
||||
""
|
||||
};
|
||||
|
||||
static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
|
||||
static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
|
||||
static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
|
||||
static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
|
||||
static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
|
||||
static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
|
||||
static final short[][] DFA12_transition;
|
||||
|
||||
static {
|
||||
int numStates = DFA12_transitionS.length;
|
||||
DFA12_transition = new short[numStates][];
|
||||
for (int i=0; i<numStates; i++) {
|
||||
DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
class DFA12 extends DFA {
|
||||
|
||||
public DFA12(BaseRecognizer recognizer) {
|
||||
this.recognizer = recognizer;
|
||||
this.decisionNumber = 12;
|
||||
this.eot = DFA12_eot;
|
||||
this.eof = DFA12_eof;
|
||||
this.min = DFA12_min;
|
||||
this.max = DFA12_max;
|
||||
this.accept = DFA12_accept;
|
||||
this.special = DFA12_special;
|
||||
this.transition = DFA12_transition;
|
||||
}
|
||||
public String getDescription() {
|
||||
return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
|
||||
}
|
||||
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
|
||||
IntStream input = _input;
|
||||
int _s = s;
|
||||
switch ( s ) {
|
||||
case 0 :
|
||||
int LA12_0 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( (LA12_0=='d') ) {s = 1;}
|
||||
|
||||
else if ( (LA12_0=='e') ) {s = 2;}
|
||||
|
||||
else if ( (LA12_0==';') ) {s = 3;}
|
||||
|
||||
else if ( (LA12_0=='.') ) {s = 4;}
|
||||
|
||||
else if ( (LA12_0=='^') ) {s = 5;}
|
||||
|
||||
else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='a' && LA12_0<='c')||(LA12_0>='f' && LA12_0<='z')) ) {s = 6;}
|
||||
|
||||
else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 7;}
|
||||
|
||||
else if ( (LA12_0=='\"') ) {s = 8;}
|
||||
|
||||
else if ( (LA12_0=='\'') ) {s = 9;}
|
||||
|
||||
else if ( (LA12_0=='/') ) {s = 10;}
|
||||
|
||||
else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 11;}
|
||||
|
||||
else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='-')||LA12_0==':'||(LA12_0>='<' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFF')) ) {s = 12;}
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 1 :
|
||||
int LA12_8 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_8>='\u0000' && LA12_8<='\uFFFF')) ) {s = 19;}
|
||||
|
||||
else s = 12;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 2 :
|
||||
int LA12_9 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_9>='\u0000' && LA12_9<='\uFFFF')) ) {s = 19;}
|
||||
|
||||
else s = 12;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
}
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException(getDescription(), 12, _s, input);
|
||||
error(nvae);
|
||||
throw nvae;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,479 @@
|
|||
package org.eclipse.xtext.testlanguages.nestedRefs.parser.antlr.internal;
|
||||
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.services.NestedRefsTestLanguageGrammarAccess;
|
||||
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class InternalNestedRefsTestLanguageParser extends AbstractInternalAntlrParser {
|
||||
public static final String[] tokenNames = new String[] {
|
||||
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'decl'", "'end'", "';'", "'.'"
|
||||
};
|
||||
public static final int RULE_ID=4;
|
||||
public static final int RULE_WS=9;
|
||||
public static final int RULE_STRING=6;
|
||||
public static final int RULE_ANY_OTHER=10;
|
||||
public static final int RULE_SL_COMMENT=8;
|
||||
public static final int RULE_INT=5;
|
||||
public static final int T__11=11;
|
||||
public static final int RULE_ML_COMMENT=7;
|
||||
public static final int T__12=12;
|
||||
public static final int T__13=13;
|
||||
public static final int T__14=14;
|
||||
public static final int EOF=-1;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
|
||||
public InternalNestedRefsTestLanguageParser(TokenStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalNestedRefsTestLanguageParser(TokenStream input, RecognizerSharedState state) {
|
||||
super(input, state);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String[] getTokenNames() { return InternalNestedRefsTestLanguageParser.tokenNames; }
|
||||
public String getGrammarFileName() { return "InternalNestedRefsTestLanguage.g"; }
|
||||
|
||||
|
||||
|
||||
private NestedRefsTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
public InternalNestedRefsTestLanguageParser(TokenStream input, NestedRefsTestLanguageGrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.grammarAccess = grammarAccess;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "Doc";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NestedRefsTestLanguageGrammarAccess getGrammarAccess() {
|
||||
return grammarAccess;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleDoc"
|
||||
// InternalNestedRefsTestLanguage.g:64:1: entryRuleDoc returns [EObject current=null] : iv_ruleDoc= ruleDoc EOF ;
|
||||
public final EObject entryRuleDoc() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleDoc = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalNestedRefsTestLanguage.g:64:44: (iv_ruleDoc= ruleDoc EOF )
|
||||
// InternalNestedRefsTestLanguage.g:65:2: iv_ruleDoc= ruleDoc EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getDocRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_ruleDoc=ruleDoc();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleDoc;
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleDoc"
|
||||
|
||||
|
||||
// $ANTLR start "ruleDoc"
|
||||
// InternalNestedRefsTestLanguage.g:71:1: ruleDoc returns [EObject current=null] : ( (lv_declarations_0_0= ruleSelfReferingDecl ) )* ;
|
||||
public final EObject ruleDoc() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject lv_declarations_0_0 = null;
|
||||
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalNestedRefsTestLanguage.g:77:2: ( ( (lv_declarations_0_0= ruleSelfReferingDecl ) )* )
|
||||
// InternalNestedRefsTestLanguage.g:78:2: ( (lv_declarations_0_0= ruleSelfReferingDecl ) )*
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:78:2: ( (lv_declarations_0_0= ruleSelfReferingDecl ) )*
|
||||
loop1:
|
||||
do {
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( (LA1_0==11) ) {
|
||||
alt1=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:79:3: (lv_declarations_0_0= ruleSelfReferingDecl )
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:79:3: (lv_declarations_0_0= ruleSelfReferingDecl )
|
||||
// InternalNestedRefsTestLanguage.g:80:4: lv_declarations_0_0= ruleSelfReferingDecl
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getDocAccess().getDeclarationsSelfReferingDeclParserRuleCall_0());
|
||||
|
||||
pushFollow(FOLLOW_3);
|
||||
lv_declarations_0_0=ruleSelfReferingDecl();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElementForParent(grammarAccess.getDocRule());
|
||||
}
|
||||
add(
|
||||
current,
|
||||
"declarations",
|
||||
lv_declarations_0_0,
|
||||
"org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage.SelfReferingDecl");
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop1;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleDoc"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleSelfReferingDecl"
|
||||
// InternalNestedRefsTestLanguage.g:100:1: entryRuleSelfReferingDecl returns [EObject current=null] : iv_ruleSelfReferingDecl= ruleSelfReferingDecl EOF ;
|
||||
public final EObject entryRuleSelfReferingDecl() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleSelfReferingDecl = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalNestedRefsTestLanguage.g:100:57: (iv_ruleSelfReferingDecl= ruleSelfReferingDecl EOF )
|
||||
// InternalNestedRefsTestLanguage.g:101:2: iv_ruleSelfReferingDecl= ruleSelfReferingDecl EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getSelfReferingDeclRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_ruleSelfReferingDecl=ruleSelfReferingDecl();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleSelfReferingDecl;
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleSelfReferingDecl"
|
||||
|
||||
|
||||
// $ANTLR start "ruleSelfReferingDecl"
|
||||
// InternalNestedRefsTestLanguage.g:107:1: ruleSelfReferingDecl returns [EObject current=null] : (otherlv_0= 'decl' ( (lv_name_1_0= ruleQualifiedName ) ) otherlv_2= 'end' ( ( ruleQualifiedName ) ) otherlv_4= ';' ) ;
|
||||
public final EObject ruleSelfReferingDecl() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
Token otherlv_0=null;
|
||||
Token otherlv_2=null;
|
||||
Token otherlv_4=null;
|
||||
AntlrDatatypeRuleToken lv_name_1_0 = null;
|
||||
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalNestedRefsTestLanguage.g:113:2: ( (otherlv_0= 'decl' ( (lv_name_1_0= ruleQualifiedName ) ) otherlv_2= 'end' ( ( ruleQualifiedName ) ) otherlv_4= ';' ) )
|
||||
// InternalNestedRefsTestLanguage.g:114:2: (otherlv_0= 'decl' ( (lv_name_1_0= ruleQualifiedName ) ) otherlv_2= 'end' ( ( ruleQualifiedName ) ) otherlv_4= ';' )
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:114:2: (otherlv_0= 'decl' ( (lv_name_1_0= ruleQualifiedName ) ) otherlv_2= 'end' ( ( ruleQualifiedName ) ) otherlv_4= ';' )
|
||||
// InternalNestedRefsTestLanguage.g:115:3: otherlv_0= 'decl' ( (lv_name_1_0= ruleQualifiedName ) ) otherlv_2= 'end' ( ( ruleQualifiedName ) ) otherlv_4= ';'
|
||||
{
|
||||
otherlv_0=(Token)match(input,11,FOLLOW_4);
|
||||
|
||||
newLeafNode(otherlv_0, grammarAccess.getSelfReferingDeclAccess().getDeclKeyword_0());
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:119:3: ( (lv_name_1_0= ruleQualifiedName ) )
|
||||
// InternalNestedRefsTestLanguage.g:120:4: (lv_name_1_0= ruleQualifiedName )
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:120:4: (lv_name_1_0= ruleQualifiedName )
|
||||
// InternalNestedRefsTestLanguage.g:121:5: lv_name_1_0= ruleQualifiedName
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getSelfReferingDeclAccess().getNameQualifiedNameParserRuleCall_1_0());
|
||||
|
||||
pushFollow(FOLLOW_5);
|
||||
lv_name_1_0=ruleQualifiedName();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElementForParent(grammarAccess.getSelfReferingDeclRule());
|
||||
}
|
||||
set(
|
||||
current,
|
||||
"name",
|
||||
lv_name_1_0,
|
||||
"org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage.QualifiedName");
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
otherlv_2=(Token)match(input,12,FOLLOW_4);
|
||||
|
||||
newLeafNode(otherlv_2, grammarAccess.getSelfReferingDeclAccess().getEndKeyword_2());
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:142:3: ( ( ruleQualifiedName ) )
|
||||
// InternalNestedRefsTestLanguage.g:143:4: ( ruleQualifiedName )
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:143:4: ( ruleQualifiedName )
|
||||
// InternalNestedRefsTestLanguage.g:144:5: ruleQualifiedName
|
||||
{
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getSelfReferingDeclRule());
|
||||
}
|
||||
|
||||
|
||||
newCompositeNode(grammarAccess.getSelfReferingDeclAccess().getSelfRefSelfReferingDeclCrossReference_3_0());
|
||||
|
||||
pushFollow(FOLLOW_6);
|
||||
ruleQualifiedName();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
otherlv_4=(Token)match(input,13,FOLLOW_2);
|
||||
|
||||
newLeafNode(otherlv_4, grammarAccess.getSelfReferingDeclAccess().getSemicolonKeyword_4());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleSelfReferingDecl"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleQualifiedName"
|
||||
// InternalNestedRefsTestLanguage.g:166:1: entryRuleQualifiedName returns [String current=null] : iv_ruleQualifiedName= ruleQualifiedName EOF ;
|
||||
public final String entryRuleQualifiedName() throws RecognitionException {
|
||||
String current = null;
|
||||
|
||||
AntlrDatatypeRuleToken iv_ruleQualifiedName = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalNestedRefsTestLanguage.g:166:53: (iv_ruleQualifiedName= ruleQualifiedName EOF )
|
||||
// InternalNestedRefsTestLanguage.g:167:2: iv_ruleQualifiedName= ruleQualifiedName EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getQualifiedNameRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_ruleQualifiedName=ruleQualifiedName();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleQualifiedName.getText();
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleQualifiedName"
|
||||
|
||||
|
||||
// $ANTLR start "ruleQualifiedName"
|
||||
// InternalNestedRefsTestLanguage.g:173:1: ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) ;
|
||||
public final AntlrDatatypeRuleToken ruleQualifiedName() throws RecognitionException {
|
||||
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
|
||||
|
||||
Token this_ID_0=null;
|
||||
Token kw=null;
|
||||
Token this_ID_2=null;
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalNestedRefsTestLanguage.g:179:2: ( (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) )
|
||||
// InternalNestedRefsTestLanguage.g:180:2: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* )
|
||||
{
|
||||
// InternalNestedRefsTestLanguage.g:180:2: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* )
|
||||
// InternalNestedRefsTestLanguage.g:181:3: this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )*
|
||||
{
|
||||
this_ID_0=(Token)match(input,RULE_ID,FOLLOW_7);
|
||||
|
||||
current.merge(this_ID_0);
|
||||
|
||||
|
||||
newLeafNode(this_ID_0, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0());
|
||||
|
||||
// InternalNestedRefsTestLanguage.g:188:3: (kw= '.' this_ID_2= RULE_ID )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( (LA2_0==14) ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalNestedRefsTestLanguage.g:189:4: kw= '.' this_ID_2= RULE_ID
|
||||
{
|
||||
kw=(Token)match(input,14,FOLLOW_4);
|
||||
|
||||
current.merge(kw);
|
||||
newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getFullStopKeyword_1_0());
|
||||
|
||||
this_ID_2=(Token)match(input,RULE_ID,FOLLOW_7);
|
||||
|
||||
current.merge(this_ID_2);
|
||||
|
||||
|
||||
newLeafNode(this_ID_2, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_1());
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleQualifiedName"
|
||||
|
||||
// Delegated rules
|
||||
|
||||
|
||||
|
||||
|
||||
public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L});
|
||||
public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L});
|
||||
public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000000000000802L});
|
||||
public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000000010L});
|
||||
public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000001000L});
|
||||
public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000002000L});
|
||||
public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000004002L});
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.scoping;
|
||||
|
||||
import org.eclipse.xtext.scoping.impl.DelegatingScopeProvider;
|
||||
|
||||
public abstract class AbstractNestedRefsTestLanguageScopeProvider extends DelegatingScopeProvider {
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.serializer;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.util.Set;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.xtext.Action;
|
||||
import org.eclipse.xtext.Parameter;
|
||||
import org.eclipse.xtext.ParserRule;
|
||||
import org.eclipse.xtext.serializer.ISerializationContext;
|
||||
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
|
||||
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.Doc;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.SelfReferingDecl;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.services.NestedRefsTestLanguageGrammarAccess;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class NestedRefsTestLanguageSemanticSequencer extends AbstractDelegatingSemanticSequencer {
|
||||
|
||||
@Inject
|
||||
private NestedRefsTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Override
|
||||
public void sequence(ISerializationContext context, EObject semanticObject) {
|
||||
EPackage epackage = semanticObject.eClass().getEPackage();
|
||||
ParserRule rule = context.getParserRule();
|
||||
Action action = context.getAssignedAction();
|
||||
Set<Parameter> parameters = context.getEnabledBooleanParameters();
|
||||
if (epackage == NestedRefsPackage.eINSTANCE)
|
||||
switch (semanticObject.eClass().getClassifierID()) {
|
||||
case NestedRefsPackage.DOC:
|
||||
sequence_Doc(context, (Doc) semanticObject);
|
||||
return;
|
||||
case NestedRefsPackage.SELF_REFERING_DECL:
|
||||
sequence_SelfReferingDecl(context, (SelfReferingDecl) semanticObject);
|
||||
return;
|
||||
}
|
||||
if (errorAcceptor != null)
|
||||
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
|
||||
}
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* Doc returns Doc
|
||||
*
|
||||
* Constraint:
|
||||
* declarations+=SelfReferingDecl+
|
||||
*/
|
||||
protected void sequence_Doc(ISerializationContext context, Doc semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* SelfReferingDecl returns SelfReferingDecl
|
||||
*
|
||||
* Constraint:
|
||||
* (name=QualifiedName selfRef=[SelfReferingDecl|QualifiedName])
|
||||
*/
|
||||
protected void sequence_SelfReferingDecl(ISerializationContext context, SelfReferingDecl semanticObject) {
|
||||
if (errorAcceptor != null) {
|
||||
if (transientValues.isValueTransient(semanticObject, NestedRefsPackage.Literals.SELF_REFERING_DECL__NAME) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, NestedRefsPackage.Literals.SELF_REFERING_DECL__NAME));
|
||||
if (transientValues.isValueTransient(semanticObject, NestedRefsPackage.Literals.SELF_REFERING_DECL__SELF_REF) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, NestedRefsPackage.Literals.SELF_REFERING_DECL__SELF_REF));
|
||||
}
|
||||
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
|
||||
feeder.accept(grammarAccess.getSelfReferingDeclAccess().getNameQualifiedNameParserRuleCall_1_0(), semanticObject.getName());
|
||||
feeder.accept(grammarAccess.getSelfReferingDeclAccess().getSelfRefSelfReferingDeclQualifiedNameParserRuleCall_3_0_1(), semanticObject.eGet(NestedRefsPackage.Literals.SELF_REFERING_DECL__SELF_REF, false));
|
||||
feeder.finish();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.serializer;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.util.List;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.IGrammarAccess;
|
||||
import org.eclipse.xtext.RuleCall;
|
||||
import org.eclipse.xtext.nodemodel.INode;
|
||||
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
|
||||
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
|
||||
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
|
||||
import org.eclipse.xtext.testlanguages.nestedRefs.services.NestedRefsTestLanguageGrammarAccess;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class NestedRefsTestLanguageSyntacticSequencer extends AbstractSyntacticSequencer {
|
||||
|
||||
protected NestedRefsTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Inject
|
||||
protected void init(IGrammarAccess access) {
|
||||
grammarAccess = (NestedRefsTestLanguageGrammarAccess) access;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
|
||||
if (transition.getAmbiguousSyntaxes().isEmpty()) return;
|
||||
List<INode> transitionNodes = collectNodes(fromNode, toNode);
|
||||
for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
|
||||
List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
|
||||
acceptNodes(getLastNavigableState(), syntaxNodes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.services;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import java.util.List;
|
||||
import org.eclipse.xtext.Assignment;
|
||||
import org.eclipse.xtext.CrossReference;
|
||||
import org.eclipse.xtext.Grammar;
|
||||
import org.eclipse.xtext.GrammarUtil;
|
||||
import org.eclipse.xtext.Group;
|
||||
import org.eclipse.xtext.Keyword;
|
||||
import org.eclipse.xtext.ParserRule;
|
||||
import org.eclipse.xtext.RuleCall;
|
||||
import org.eclipse.xtext.TerminalRule;
|
||||
import org.eclipse.xtext.common.services.TerminalsGrammarAccess;
|
||||
import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder;
|
||||
import org.eclipse.xtext.service.GrammarProvider;
|
||||
|
||||
@Singleton
|
||||
public class NestedRefsTestLanguageGrammarAccess extends AbstractGrammarElementFinder {
|
||||
|
||||
public class DocElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage.Doc");
|
||||
private final Assignment cDeclarationsAssignment = (Assignment)rule.eContents().get(1);
|
||||
private final RuleCall cDeclarationsSelfReferingDeclParserRuleCall_0 = (RuleCall)cDeclarationsAssignment.eContents().get(0);
|
||||
|
||||
//Doc:
|
||||
// declarations+=SelfReferingDecl*;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//declarations+=SelfReferingDecl*
|
||||
public Assignment getDeclarationsAssignment() { return cDeclarationsAssignment; }
|
||||
|
||||
//SelfReferingDecl
|
||||
public RuleCall getDeclarationsSelfReferingDeclParserRuleCall_0() { return cDeclarationsSelfReferingDeclParserRuleCall_0; }
|
||||
}
|
||||
public class SelfReferingDeclElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage.SelfReferingDecl");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final Keyword cDeclKeyword_0 = (Keyword)cGroup.eContents().get(0);
|
||||
private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
|
||||
private final RuleCall cNameQualifiedNameParserRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
|
||||
private final Keyword cEndKeyword_2 = (Keyword)cGroup.eContents().get(2);
|
||||
private final Assignment cSelfRefAssignment_3 = (Assignment)cGroup.eContents().get(3);
|
||||
private final CrossReference cSelfRefSelfReferingDeclCrossReference_3_0 = (CrossReference)cSelfRefAssignment_3.eContents().get(0);
|
||||
private final RuleCall cSelfRefSelfReferingDeclQualifiedNameParserRuleCall_3_0_1 = (RuleCall)cSelfRefSelfReferingDeclCrossReference_3_0.eContents().get(1);
|
||||
private final Keyword cSemicolonKeyword_4 = (Keyword)cGroup.eContents().get(4);
|
||||
|
||||
//SelfReferingDecl:
|
||||
// 'decl' name=QualifiedName 'end' selfRef=[SelfReferingDecl|QualifiedName] ';';
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//'decl' name=QualifiedName 'end' selfRef=[SelfReferingDecl|QualifiedName] ';'
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//'decl'
|
||||
public Keyword getDeclKeyword_0() { return cDeclKeyword_0; }
|
||||
|
||||
//name=QualifiedName
|
||||
public Assignment getNameAssignment_1() { return cNameAssignment_1; }
|
||||
|
||||
//QualifiedName
|
||||
public RuleCall getNameQualifiedNameParserRuleCall_1_0() { return cNameQualifiedNameParserRuleCall_1_0; }
|
||||
|
||||
//'end'
|
||||
public Keyword getEndKeyword_2() { return cEndKeyword_2; }
|
||||
|
||||
//selfRef=[SelfReferingDecl|QualifiedName]
|
||||
public Assignment getSelfRefAssignment_3() { return cSelfRefAssignment_3; }
|
||||
|
||||
//[SelfReferingDecl|QualifiedName]
|
||||
public CrossReference getSelfRefSelfReferingDeclCrossReference_3_0() { return cSelfRefSelfReferingDeclCrossReference_3_0; }
|
||||
|
||||
//QualifiedName
|
||||
public RuleCall getSelfRefSelfReferingDeclQualifiedNameParserRuleCall_3_0_1() { return cSelfRefSelfReferingDeclQualifiedNameParserRuleCall_3_0_1; }
|
||||
|
||||
//';'
|
||||
public Keyword getSemicolonKeyword_4() { return cSemicolonKeyword_4; }
|
||||
}
|
||||
public class QualifiedNameElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage.QualifiedName");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final RuleCall cIDTerminalRuleCall_0 = (RuleCall)cGroup.eContents().get(0);
|
||||
private final Group cGroup_1 = (Group)cGroup.eContents().get(1);
|
||||
private final Keyword cFullStopKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0);
|
||||
private final RuleCall cIDTerminalRuleCall_1_1 = (RuleCall)cGroup_1.eContents().get(1);
|
||||
|
||||
//QualifiedName:
|
||||
// ID ('.' ID)*;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//ID ('.' ID)*
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//ID
|
||||
public RuleCall getIDTerminalRuleCall_0() { return cIDTerminalRuleCall_0; }
|
||||
|
||||
//('.' ID)*
|
||||
public Group getGroup_1() { return cGroup_1; }
|
||||
|
||||
//'.'
|
||||
public Keyword getFullStopKeyword_1_0() { return cFullStopKeyword_1_0; }
|
||||
|
||||
//ID
|
||||
public RuleCall getIDTerminalRuleCall_1_1() { return cIDTerminalRuleCall_1_1; }
|
||||
}
|
||||
|
||||
|
||||
private final DocElements pDoc;
|
||||
private final SelfReferingDeclElements pSelfReferingDecl;
|
||||
private final QualifiedNameElements pQualifiedName;
|
||||
|
||||
private final Grammar grammar;
|
||||
|
||||
private final TerminalsGrammarAccess gaTerminals;
|
||||
|
||||
@Inject
|
||||
public NestedRefsTestLanguageGrammarAccess(GrammarProvider grammarProvider,
|
||||
TerminalsGrammarAccess gaTerminals) {
|
||||
this.grammar = internalFindGrammar(grammarProvider);
|
||||
this.gaTerminals = gaTerminals;
|
||||
this.pDoc = new DocElements();
|
||||
this.pSelfReferingDecl = new SelfReferingDeclElements();
|
||||
this.pQualifiedName = new QualifiedNameElements();
|
||||
}
|
||||
|
||||
protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
|
||||
Grammar grammar = grammarProvider.getGrammar(this);
|
||||
while (grammar != null) {
|
||||
if ("org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage".equals(grammar.getName())) {
|
||||
return grammar;
|
||||
}
|
||||
List<Grammar> grammars = grammar.getUsedGrammars();
|
||||
if (!grammars.isEmpty()) {
|
||||
grammar = grammars.iterator().next();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return grammar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Grammar getGrammar() {
|
||||
return grammar;
|
||||
}
|
||||
|
||||
|
||||
public TerminalsGrammarAccess getTerminalsGrammarAccess() {
|
||||
return gaTerminals;
|
||||
}
|
||||
|
||||
|
||||
//Doc:
|
||||
// declarations+=SelfReferingDecl*;
|
||||
public DocElements getDocAccess() {
|
||||
return pDoc;
|
||||
}
|
||||
|
||||
public ParserRule getDocRule() {
|
||||
return getDocAccess().getRule();
|
||||
}
|
||||
|
||||
//SelfReferingDecl:
|
||||
// 'decl' name=QualifiedName 'end' selfRef=[SelfReferingDecl|QualifiedName] ';';
|
||||
public SelfReferingDeclElements getSelfReferingDeclAccess() {
|
||||
return pSelfReferingDecl;
|
||||
}
|
||||
|
||||
public ParserRule getSelfReferingDeclRule() {
|
||||
return getSelfReferingDeclAccess().getRule();
|
||||
}
|
||||
|
||||
//QualifiedName:
|
||||
// ID ('.' ID)*;
|
||||
public QualifiedNameElements getQualifiedNameAccess() {
|
||||
return pQualifiedName;
|
||||
}
|
||||
|
||||
public ParserRule getQualifiedNameRule() {
|
||||
return getQualifiedNameAccess().getRule();
|
||||
}
|
||||
|
||||
//terminal ID:
|
||||
// '^'? ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | '0'..'9')*;
|
||||
public TerminalRule getIDRule() {
|
||||
return gaTerminals.getIDRule();
|
||||
}
|
||||
|
||||
//terminal INT returns ecore::EInt:
|
||||
// '0'..'9'+;
|
||||
public TerminalRule getINTRule() {
|
||||
return gaTerminals.getINTRule();
|
||||
}
|
||||
|
||||
//terminal STRING:
|
||||
// '"' ('\\' . | !('\\' | '"'))* '"' |
|
||||
// "'" ('\\' . | !('\\' | "'"))* "'";
|
||||
public TerminalRule getSTRINGRule() {
|
||||
return gaTerminals.getSTRINGRule();
|
||||
}
|
||||
|
||||
//terminal ML_COMMENT:
|
||||
// '/*'->'*/';
|
||||
public TerminalRule getML_COMMENTRule() {
|
||||
return gaTerminals.getML_COMMENTRule();
|
||||
}
|
||||
|
||||
//terminal SL_COMMENT:
|
||||
// '//' !('\n' | '\r')* ('\r'? '\n')?;
|
||||
public TerminalRule getSL_COMMENTRule() {
|
||||
return gaTerminals.getSL_COMMENTRule();
|
||||
}
|
||||
|
||||
//terminal WS:
|
||||
// ' ' | '\t' | '\r' | '\n'+;
|
||||
public TerminalRule getWSRule() {
|
||||
return gaTerminals.getWSRule();
|
||||
}
|
||||
|
||||
//terminal ANY_OTHER:
|
||||
// .;
|
||||
public TerminalRule getANY_OTHERRule() {
|
||||
return gaTerminals.getANY_OTHERRule();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.validation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.xtext.validation.AbstractDeclarativeValidator;
|
||||
|
||||
public abstract class AbstractNestedRefsTestLanguageValidator extends AbstractDeclarativeValidator {
|
||||
|
||||
@Override
|
||||
protected List<EPackage> getEPackages() {
|
||||
List<EPackage> result = new ArrayList<EPackage>();
|
||||
result.add(org.eclipse.xtext.testlanguages.nestedRefs.nestedRefs.NestedRefsPackage.eINSTANCE);
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -43,5 +43,6 @@ Workflow {
|
|||
language = @noJdt.NoJdtTestLanguage {}
|
||||
language = @xtextgrammar.XtextGrammarTestLanguage {}
|
||||
language = @fileAware.FileAwareTestLanguage {}
|
||||
language = @nestedRefs.NestedRefsTestLanguage {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
module org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage
|
||||
|
||||
import org.eclipse.xtext.xtext.generator.*
|
||||
|
||||
var grammarURI = "classpath:/org/eclipse/xtext/testlanguages/nestedRefs/NestedRefsTestLanguage.xtext"
|
||||
var fileExtensions = "nestedRefs"
|
||||
|
||||
XtextGeneratorLanguage {
|
||||
grammarUri = grammarURI
|
||||
fileExtensions = fileExtensions
|
||||
|
||||
// Java API to access grammar elements (required by several other fragments)
|
||||
fragment = grammarAccess.GrammarAccessFragment2 auto-inject {}
|
||||
|
||||
// generates Java API for the generated EPackages
|
||||
fragment = ecore.EMFGeneratorFragment2 auto-inject {
|
||||
emfRuntimeVersion = "2.9"
|
||||
}
|
||||
|
||||
// serializer 2.0
|
||||
fragment = serializer.SerializerFragment2 auto-inject {
|
||||
generateStub = false
|
||||
}
|
||||
|
||||
// a custom ResourceFactory for use with EMF
|
||||
fragment = resourceFactory.ResourceFactoryFragment2 auto-inject {}
|
||||
|
||||
// The antlr parser generator fragment.
|
||||
fragment = parser.antlr.XtextAntlrGeneratorFragment2 auto-inject {
|
||||
// options = {
|
||||
// backtrack = true
|
||||
// }
|
||||
}
|
||||
|
||||
// Xtend-based API for validation
|
||||
fragment = validation.ValidatorFragment2 auto-inject {
|
||||
// composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
|
||||
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
|
||||
}
|
||||
|
||||
// old scoping and exporting API
|
||||
// fragment = scoping.ImportURIScopingFragment auto-inject {}
|
||||
// fragment = exporting.SimpleNamesFragment auto-inject {}
|
||||
|
||||
// scoping and exporting API
|
||||
fragment = scoping.ImportNamespacesScopingFragment2 auto-inject {}
|
||||
fragment = exporting.QualifiedNamesFragment2 auto-inject {}
|
||||
fragment = builder.BuilderIntegrationFragment2 auto-inject {}
|
||||
|
||||
// generator API
|
||||
fragment = generator.GeneratorFragment2 auto-inject {}
|
||||
|
||||
// labeling API
|
||||
fragment = ui.labeling.LabelProviderFragment2 auto-inject {}
|
||||
|
||||
// outline API
|
||||
fragment = ui.outline.OutlineTreeProviderFragment2 auto-inject {}
|
||||
fragment = ui.outline.QuickOutlineFragment2 auto-inject {}
|
||||
|
||||
// quickfix API
|
||||
fragment = ui.quickfix.QuickfixProviderFragment2 auto-inject {}
|
||||
|
||||
// content assist API
|
||||
fragment = ui.contentAssist.ContentAssistFragment2 auto-inject {}
|
||||
|
||||
// rename refactoring
|
||||
fragment = ui.refactoring.RefactorElementNameFragment2 auto-inject {}
|
||||
|
||||
// provides a preference page for template proposals
|
||||
fragment = ui.templates.CodetemplatesGeneratorFragment2 auto-inject {}
|
||||
|
||||
// provides a compare view
|
||||
fragment = ui.compare.CompareFragment2 auto-inject {}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* A language that has rules that can refer to themselves
|
||||
*/
|
||||
|
||||
grammar org.eclipse.xtext.testlanguages.nestedRefs.NestedRefsTestLanguage with org.eclipse.xtext.common.Terminals
|
||||
|
||||
generate nestedRefs "http://www.eclipse.org/xtext/testlanguage/NestedRefs"
|
||||
|
||||
Doc:
|
||||
(declarations += SelfReferingDecl)*;
|
||||
|
||||
SelfReferingDecl:
|
||||
'decl' name=QualifiedName 'end' selfRef=[SelfReferingDecl|QualifiedName] ';';
|
||||
|
||||
QualifiedName:
|
||||
ID ('.' ID)*;
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs;
|
||||
|
||||
|
||||
/**
|
||||
* Use this class to register components to be used at runtime / without the Equinox extension registry.
|
||||
*/
|
||||
public class NestedRefsTestLanguageRuntimeModule extends AbstractNestedRefsTestLanguageRuntimeModule {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs;
|
||||
|
||||
|
||||
/**
|
||||
* Initialization support for running Xtext languages without Equinox extension registry.
|
||||
*/
|
||||
public class NestedRefsTestLanguageStandaloneSetup extends NestedRefsTestLanguageStandaloneSetupGenerated {
|
||||
|
||||
public static void doSetup() {
|
||||
new NestedRefsTestLanguageStandaloneSetup().createInjectorAndDoEMFRegistration();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.generator;
|
||||
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.xtext.generator.AbstractGenerator;
|
||||
import org.eclipse.xtext.generator.IFileSystemAccess2;
|
||||
import org.eclipse.xtext.generator.IGeneratorContext;
|
||||
|
||||
/**
|
||||
* Generates code from your model files on save.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
|
||||
*/
|
||||
public class NestedRefsTestLanguageGenerator extends AbstractGenerator {
|
||||
|
||||
@Override
|
||||
public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
|
||||
// Iterator<Greeting> filtered = Iterators.filter(resource.getAllContents(), Greeting.class);
|
||||
// Iterator<String> names = Iterators.transform(filtered, new Function<Greeting, String>() {
|
||||
//
|
||||
// @Override
|
||||
// public String apply(Greeting greeting) {
|
||||
// return greeting.getName();
|
||||
// }
|
||||
// });
|
||||
// fsa.generateFile("greetings.txt", "People to greet: " + IteratorExtensions.join(names, ", "));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.scoping;
|
||||
|
||||
|
||||
/**
|
||||
* This class contains custom scoping description.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
|
||||
* on how and when to use it.
|
||||
*/
|
||||
public class NestedRefsTestLanguageScopeProvider extends AbstractNestedRefsTestLanguageScopeProvider {
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.nestedRefs.validation;
|
||||
|
||||
|
||||
/**
|
||||
* This class contains custom validation rules.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation
|
||||
*/
|
||||
public class NestedRefsTestLanguageValidator extends AbstractNestedRefsTestLanguageValidator {
|
||||
|
||||
// public static final INVALID_NAME = 'invalidName'
|
||||
//
|
||||
// @Check
|
||||
// public void checkGreetingStartsWithCapital(Greeting greeting) {
|
||||
// if (!Character.isUpperCase(greeting.getName().charAt(0))) {
|
||||
// warning("Name should start with a capital",
|
||||
// NestedRefsTestLanguagePackage.Literals.GREETING__NAME,
|
||||
// INVALID_NAME);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
Loading…
Reference in a new issue