use of org.eclipse.xtext.builder.tests.builderTestLanguage.Element in project xtext-eclipse by eclipse.
the class BuilderTestLanguageSemanticSequencer method sequence.
@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 == BuilderTestLanguagePackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case BuilderTestLanguagePackage.ELEMENT:
sequence_Element(context, (Element) semanticObject);
return;
case BuilderTestLanguagePackage.IMPORT:
sequence_Import(context, (Import) semanticObject);
return;
case BuilderTestLanguagePackage.NAMESPACE:
sequence_Namespace(context, (Namespace) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.builder.tests.builderTestLanguage.Element in project xtext-eclipse by eclipse.
the class ElementImpl method setReferences.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setReferences(Element newReferences) {
Element oldReferences = references;
references = newReferences;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BuilderTestLanguagePackage.ELEMENT__REFERENCES, oldReferences, references));
}
use of org.eclipse.xtext.builder.tests.builderTestLanguage.Element in project xtext-eclipse by eclipse.
the class MyGenerator method doGenerate.
@Override
public void doGenerate(Resource input, IFileSystemAccess fsa) {
TreeIterator<EObject> allContents = input.getAllContents();
while (allContents.hasNext()) {
EObject next = allContents.next();
if (next instanceof Element) {
Element ele = (Element) next;
String fileName = ele.getName() + ".txt";
if (fsa instanceof IFileSystemAccess2) {
IFileSystemAccess2 fileSystemAccess2 = (IFileSystemAccess2) fsa;
if (fileSystemAccess2.isFile(fileName)) {
fileSystemAccess2.readTextFile(fileName);
}
}
fsa.generateFile(fileName, "object " + ele.getName());
}
}
}
Aggregations