Java 类org.eclipse.xtext.generator.IGeneratorContext 实例源码

项目:xtext-core    文件:IndexTestLanguageGenerator.java   
@Override
public void doGenerate(final Resource input, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
  final TreeIterator<EObject> iter = input.getAllContents();
  while (iter.hasNext()) {
    EObject _next = iter.next();
    final EObject e = _next;
    boolean _matched = false;
    if (e instanceof Entity) {
      _matched=true;
      String _name = ((Entity)e).getName();
      String _plus = (_name + ".txt");
      StringConcatenation _builder = new StringConcatenation();
      _builder.append("Hello ");
      String _name_1 = ((Entity)e).getName();
      _builder.append(_name_1);
      _builder.append("!");
      _builder.newLineIfNotEmpty();
      fsa.generateFile(_plus, _builder);
    }
  }
}
项目:org.xtext.dsl.restaurante    文件:RestauranteGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
  GeneradorTexto generatorTexto = new GeneradorTexto(resource, fsa);
  generatorTexto.compilar();
  GeneradorWeb generatorWeb = new GeneradorWeb(resource, fsa);
  generatorWeb.compilar();
}
项目:xtext-core    文件:FileAwareTestLanguageGenerator.java   
@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, ", "));
    }
项目:xtext-core    文件:NoJdtTestLanguageGenerator.java   
@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();
        }
    });
    String fileName = resource.getURI().lastSegment();
    if(fileName == null) fileName = "greetings";
    fsa.generateFile(fileName+".txt", "People to greet: " + IteratorExtensions.join(names, ", "));
}
项目:bromium    文件:BromiumGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}
项目:gw4e.project    文件:DSLPoliciesGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}
项目:mochalog    文件:PrologGenerator.java   
@Override
   public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context)
{

   }
项目:OCCI-Studio    文件:OCCIGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}
项目:M2Doc    文件:MyDslGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}
项目:xtext-core    文件:IndentationAwareUiTestLanguageGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}
项目:xtext-core    文件:PartialContentAssistTestLanguageGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}
项目:xtext-core    文件:PartialSerializationTestLanguageGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}
项目:xtext-core    文件:GeneratorFragment2.java   
protected void doGenerateXtendStubFile() {
  TypeReference _generatorStub = this.getGeneratorStub(this.getGrammar());
  StringConcatenationClient _client = new StringConcatenationClient() {
    @Override
    protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
      _builder.append("/**");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* Generates code from your model files on save.");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* ");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("*/");
      _builder.newLine();
      _builder.append("class ");
      String _simpleName = GeneratorFragment2.this.getGeneratorStub(GeneratorFragment2.this.getLanguage().getGrammar()).getSimpleName();
      _builder.append(_simpleName);
      _builder.append(" extends ");
      _builder.append(AbstractGenerator.class);
      _builder.append(" {");
      _builder.newLineIfNotEmpty();
      _builder.newLine();
      _builder.append("\t");
      _builder.append("override void doGenerate(");
      _builder.append(Resource.class, "\t");
      _builder.append(" resource, ");
      _builder.append(IFileSystemAccess2.class, "\t");
      _builder.append(" fsa, ");
      _builder.append(IGeneratorContext.class, "\t");
      _builder.append(" context) {");
      _builder.newLineIfNotEmpty();
      _builder.append("//\t\tfsa.generateFile(\'greetings.txt\', \'People to greet: \' + ");
      _builder.newLine();
      _builder.append("//\t\t\tresource.allContents");
      _builder.newLine();
      _builder.append("//\t\t\t\t.filter(Greeting)");
      _builder.newLine();
      _builder.append("//\t\t\t\t.map[name]");
      _builder.newLine();
      _builder.append("//\t\t\t\t.join(\', \'))");
      _builder.newLine();
      _builder.append("\t");
      _builder.append("}");
      _builder.newLine();
      _builder.append("}");
      _builder.newLine();
    }
  };
  this.fileAccessFactory.createXtendFile(_generatorStub, _client).writeTo(this.getProjectConfig().getRuntime().getSrc());
}
项目:cs2as    文件:ASBHLangGenerator.java   
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}