use of org.eclipse.emf.ecore.EObject in project applause by applause.
the class InternalApplauseDslParser method entryRulePlatform.
// $ANTLR end "ruleAttribute"
// $ANTLR start "entryRulePlatform"
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:501:1: entryRulePlatform returns [EObject current=null] : iv_rulePlatform= rulePlatform EOF ;
public final EObject entryRulePlatform() throws RecognitionException {
EObject current = null;
EObject iv_rulePlatform = null;
try {
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:502:2: (iv_rulePlatform= rulePlatform EOF )
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:503:2: iv_rulePlatform= rulePlatform EOF
{
newCompositeNode(grammarAccess.getPlatformRule());
pushFollow(FOLLOW_rulePlatform_in_entryRulePlatform1170);
iv_rulePlatform = rulePlatform();
state._fsp--;
current = iv_rulePlatform;
match(input, EOF, FOLLOW_EOF_in_entryRulePlatform1180);
}
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
use of org.eclipse.emf.ecore.EObject in project applause by applause.
the class InternalApplauseDslParser method ruleUrlFragment.
// $ANTLR end "entryRuleUrlFragment"
// $ANTLR start "ruleUrlFragment"
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1278:1: ruleUrlFragment returns [EObject current=null] : (this_UrlPathFragment_0= ruleUrlPathFragment | this_Variable_1= ruleVariable ) ;
public final EObject ruleUrlFragment() throws RecognitionException {
EObject current = null;
EObject this_UrlPathFragment_0 = null;
EObject this_Variable_1 = null;
enterRule();
try {
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1281:28: ( (this_UrlPathFragment_0= ruleUrlPathFragment | this_Variable_1= ruleVariable ) )
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1282:1: (this_UrlPathFragment_0= ruleUrlPathFragment | this_Variable_1= ruleVariable )
{
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1282:1: (this_UrlPathFragment_0= ruleUrlPathFragment | this_Variable_1= ruleVariable )
int alt19 = 2;
int LA19_0 = input.LA(1);
if ((LA19_0 == RULE_ID)) {
alt19 = 1;
} else if ((LA19_0 == 26)) {
alt19 = 2;
} else {
NoViableAltException nvae = new NoViableAltException("", 19, 0, input);
throw nvae;
}
switch(alt19) {
case 1:
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1283:5: this_UrlPathFragment_0= ruleUrlPathFragment
{
newCompositeNode(grammarAccess.getUrlFragmentAccess().getUrlPathFragmentParserRuleCall_0());
pushFollow(FOLLOW_ruleUrlPathFragment_in_ruleUrlFragment2890);
this_UrlPathFragment_0 = ruleUrlPathFragment();
state._fsp--;
current = this_UrlPathFragment_0;
afterParserOrEnumRuleCall();
}
break;
case 2:
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1293:5: this_Variable_1= ruleVariable
{
newCompositeNode(grammarAccess.getUrlFragmentAccess().getVariableParserRuleCall_1());
pushFollow(FOLLOW_ruleVariable_in_ruleUrlFragment2917);
this_Variable_1 = ruleVariable();
state._fsp--;
current = this_Variable_1;
afterParserOrEnumRuleCall();
}
break;
}
}
leaveRule();
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
use of org.eclipse.emf.ecore.EObject in project benchmarx by eMoflon.
the class EMoflonFamiliesToPersons method saveModels.
public void saveModels(String name) {
ResourceSet set = new ResourceSetImpl();
set.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
URI srcURI = URI.createFileURI(RESULTPATH + "/" + name + "Family.xmi");
URI trgURI = URI.createFileURI(RESULTPATH + "/" + name + "Person.xmi");
Resource resSource = set.createResource(srcURI);
Resource resTarget = set.createResource(trgURI);
EObject colSource = EcoreUtil.copy(getSourceModel());
EObject colTarget = EcoreUtil.copy(getTargetModel());
resSource.getContents().add(colSource);
resTarget.getContents().add(colTarget);
try {
resSource.save(null);
resTarget.save(null);
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.eclipse.emf.ecore.EObject in project benchmarx by eMoflon.
the class MediniQVTFamiliesToPersons method saveModels.
/**
* Allows to save the current state of the source and target models
*
* @param name : Filename
*/
public void saveModels(String name) {
ResourceSet set = new ResourceSetImpl();
set.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
URI srcURI = URI.createFileURI(RESULTPATH + "/" + name + "Family.xmi");
URI trgURI = URI.createFileURI(RESULTPATH + "/" + name + "Person.xmi");
Resource resSource = set.createResource(srcURI);
Resource resTarget = set.createResource(trgURI);
EObject colSource = EcoreUtil.copy(getSourceModel());
EObject colTarget = EcoreUtil.copy(getTargetModel());
resSource.getContents().add(colSource);
resTarget.getContents().add(colTarget);
try {
resSource.save(null);
resTarget.save(null);
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.eclipse.emf.ecore.EObject in project benchmarx by eMoflon.
the class UbtXtendFamiliesToPersons method saveModels.
/**
* Allows to save the current state of the source and target models
*
* @param name : Filename
*/
@Override
public void saveModels(String name) {
ResourceSet set = new ResourceSetImpl();
set.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
URI srcURI = URI.createFileURI(RESULTPATH + "/" + name + "Family.xmi");
URI trgURI = URI.createFileURI(RESULTPATH + "/" + name + "Person.xmi");
Resource resSource = set.createResource(srcURI);
Resource resTarget = set.createResource(trgURI);
EObject colSource = EcoreUtil.copy(getSourceModel());
EObject colTarget = EcoreUtil.copy(getTargetModel());
resSource.getContents().add(colSource);
resTarget.getContents().add(colTarget);
try {
resSource.save(null);
resTarget.save(null);
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations