Java 类org.eclipse.xtext.serializer.impl.Serializer 实例源码

项目:gemoc-studio    文件:TestXtextSerializer.java   
public static void main(String[] args) {
    // Getting the serializer
    GExpressionsStandaloneSetup setup = new GExpressionsStandaloneSetup();
    Injector injector = setup.createInjectorAndDoEMFRegistration();
    Serializer serializer = injector.getInstance(Serializer.class);

    // Creating a model
    GexpressionsFactory factory = GexpressionsFactory.eINSTANCE;
    GAdditionExpression exp = factory.createGAdditionExpression();
    GIntegerExpression un = factory.createGIntegerExpression();
    un.setValue(1);
    GStringExpression deux = factory.createGStringExpression();
    deux.setValue("deux");
    exp.setLeftOperand(un);
    exp.setRightOperand(deux);

    // Serializing
    String s = serializer.serialize(exp);
    System.out.println(s);
}
项目:gemoc-studio    文件:TestXtextSerializer2.java   
public static void loadGexpressionTestFile() {
    // Getting the serializer
    GExpressionsStandaloneSetup setup = new GExpressionsStandaloneSetup();
    Injector injector = setup.createInjectorAndDoEMFRegistration();
    GexpressionsPackage.eINSTANCE.eClass();
    Serializer serializer = injector.getInstance(Serializer.class);

    // Load the model
    URI modelURI = URI
            .createFileURI("/home/flatombe/thesis/gemoc/git/gemoc-dev/org/eclipse/gemoc/GEL/org.eclipse.gemoc.gel.gexpressions.test/model/test.gexpressions");
    XtextResourceSet resSet = injector.getInstance(XtextResourceSet.class);
    resSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
    Resource resource = resSet.getResource(modelURI, true);
    GProgram program = (GProgram) resource.getContents().get(0);

    List<GExpression> exps = program.getExpressions();
    for (GExpression exp : exps) {
        // Serializing
        String s = serializer.serialize(exp);
        System.out.println(s);
    }
}
项目:xtext-core    文件:SerializerFragment2.java   
@Override
public void generate() {
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef(ISemanticSequencer.class), this.getSemanticSequencerClass(this.getGrammar())).addTypeToType(TypeReference.typeRef(ISyntacticSequencer.class), this.getSyntacticSequencerClass(this.getGrammar())).addTypeToType(TypeReference.typeRef(ISerializer.class), TypeReference.typeRef(Serializer.class)).contributeTo(this.getLanguage().getRuntimeGenModule());
  ManifestAccess _manifest = this.getProjectConfig().getRuntime().getManifest();
  boolean _tripleNotEquals = (_manifest != null);
  if (_tripleNotEquals) {
    Set<String> _exportedPackages = this.getProjectConfig().getRuntime().getManifest().getExportedPackages();
    String _serializerBasePackage = this.getSerializerBasePackage(this.getGrammar());
    _exportedPackages.add(_serializerBasePackage);
    Set<String> _requiredBundles = this.getProjectConfig().getRuntime().getManifest().getRequiredBundles();
    String _xbaseLibVersionLowerBound = this.getProjectConfig().getRuntime().getXbaseLibVersionLowerBound();
    String _plus = ("org.eclipse.xtext.xbase.lib;bundle-version=\"" + _xbaseLibVersionLowerBound);
    String _plus_1 = (_plus + "\"");
    _requiredBundles.add(_plus_1);
  }
  this.generateAbstractSemanticSequencer();
  this.generateAbstractSyntacticSequencer();
  boolean _isGenerateStub = this.isGenerateStub();
  if (_isGenerateStub) {
    this.generateSemanticSequencer();
    this.generateSyntacticSequencer();
  }
  if (this.generateDebugData) {
    this.generateGrammarConstraints();
    Iterable<Pair<String, String>> _generateDebugGraphs = this.debugGraphGenerator.generateDebugGraphs();
    for (final Pair<String, String> fileToContent : _generateDebugGraphs) {
      this.getProjectConfig().getRuntime().getSrcGen().generateFile(fileToContent.getKey(), fileToContent.getValue());
    }
  }
}
项目:pokemon-tcgo-deck-generator    文件:AbstractPkmntcgoRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:n4js    文件:AbstractTypeExpressionsRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:n4js    文件:AbstractTypesRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:n4js    文件:AbstractUnicodeRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:n4js    文件:AbstractRegularExpressionRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:n4js    文件:AbstractN4JSRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:n4js    文件:AbstractN4MFRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:Xtext_Xtend_HTML_Generator    文件:AbstractMyDslRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:bromium    文件:AbstractBromiumRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:gw4e.project    文件:AbstractDSLPoliciesRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:lcdsl    文件:AbstractLcDslRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:gemoc-studio    文件:AbstractDslRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:org.xtext.dsl.restaurante    文件:AbstractRestauranteRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:OCCI-Studio    文件:AbstractOCCIRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractPureXbaseRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractXbaseRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractMultiRuleEnumTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractXtypeRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractRefactoringTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractPartialParserTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractContentAssistTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractRefactoringTestLanguage2RuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractContextFinderTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractLookaheadTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractIgnoreCaseLexerTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractBug287988TestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractContentAssistFragmentTestLangRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractEnumAndReferenceTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractEnumRulesTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-extras    文件:AbstractMultiRuleEnumTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractAssignmentFinderTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:M2Doc    文件:AbstractMyDslRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:minitl    文件:AbstractMinitlRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractSequencerTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractTerminalsRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractConcreteTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}
项目:xtext-core    文件:AbstractPartialContentAssistTestLanguageRuntimeModule.java   
public Class<? extends ISerializer> bindISerializer() {
    return Serializer.class;
}