Java 类org.eclipse.xtext.xtext.generator.model.TypeReference 实例源码

项目:xtext-core    文件:CodeConfig.java   
public String getAnnotationImportsAsString() {
  boolean _isEmpty = this.classAnnotations.isEmpty();
  if (_isEmpty) {
    return null;
  }
  final StringBuilder stringBuilder = new StringBuilder();
  for (final IClassAnnotation annotation : this.classAnnotations) {
    {
      final TypeReference importString = annotation.getAnnotationImport();
      if ((importString != null)) {
        stringBuilder.append("import ").append(importString).append(";").append(Strings.newLine());
      }
    }
  }
  return stringBuilder.toString();
}
项目:xtext-core    文件:QuickfixProviderFragment2.java   
public void generateGenQuickfixProvider() {
  final TypeReference genClass = this.getQuickfixProviderClass(this.getGrammar());
  final GeneratedJavaFileAccess file = this.fileAccessFactory.createGeneratedJavaFile(genClass);
  StringConcatenationClient _client = new StringConcatenationClient() {
    @Override
    protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
      _builder.append("public class ");
      String _simpleName = genClass.getSimpleName();
      _builder.append(_simpleName);
      _builder.append(" extends ");
      TypeReference _quickfixProviderSuperClass = QuickfixProviderFragment2.this.getQuickfixProviderSuperClass(QuickfixProviderFragment2.this.getGrammar());
      _builder.append(_quickfixProviderSuperClass);
      _builder.append(" {");
      _builder.newLineIfNotEmpty();
      _builder.append("}");
      _builder.newLine();
    }
  };
  file.setContent(_client);
  file.writeTo(this.getProjectConfig().getEclipsePlugin().getSrcGen());
}
项目:xtext-extras    文件:FragmentAdapter.java   
private void generateGuiceModuleRt(final LanguageConfig config1, final XpandExecutionContext ctx) {
  final IXtextGeneratorLanguage config2 = this.getLanguage();
  final Set<Binding> bindings = this.fragment.getGuiceBindingsRt(config1.getGrammar());
  if ((bindings != null)) {
    final Function1<Binding, GuiceModuleAccess.Binding> _function = (Binding it) -> {
      return this.translateBinding(it);
    };
    config2.getRuntimeGenModule().addAll(IterableExtensions.<Binding, GuiceModuleAccess.Binding>map(bindings, _function));
  }
  if ((this.fragment instanceof IGeneratorFragmentExtension4)) {
    final String superClass = ((IGeneratorFragmentExtension4)this.fragment).getDefaultRuntimeModuleClassName(config1.getGrammar());
    if ((superClass != null)) {
      GuiceModuleAccess _runtimeGenModule = config2.getRuntimeGenModule();
      TypeReference _typeReference = new TypeReference(superClass);
      _runtimeGenModule.setSuperClass(_typeReference);
    }
  }
}
项目:xtext-core    文件:ImportNamespacesScopingFragment2.java   
protected TypeReference getScopeProviderClass(final Grammar grammar) {
  String _name = grammar.getName();
  boolean _equals = Objects.equal(_name, "org.eclipse.xtext.xbase.Xbase");
  if (_equals) {
    return TypeReference.typeRef("org.eclipse.xtext.xbase.scoping.batch.XbaseBatchScopeProvider");
  }
  String _name_1 = grammar.getName();
  boolean _equals_1 = Objects.equal(_name_1, "org.eclipse.xtext.xbase.annotations.XbaseWithAnnotations");
  if (_equals_1) {
    return TypeReference.typeRef("org.eclipse.xtext.xbase.annotations.typesystem.XbaseWithAnnotationsBatchScopeProvider");
  }
  String _runtimeBasePackage = this._xtextGeneratorNaming.getRuntimeBasePackage(grammar);
  String _plus = (_runtimeBasePackage + ".scoping.");
  String _simpleName = GrammarUtil.getSimpleName(grammar);
  String _plus_1 = (_plus + _simpleName);
  String _plus_2 = (_plus_1 + "ScopeProvider");
  return new TypeReference(_plus_2);
}
项目:xtext-core    文件:XtextGenerator.java   
protected void generateServices() {
  if (((this.projectConfig.getGenericIde().getSrcGen() == null) || this.languageConfigs.isEmpty())) {
    return;
  }
  final TextFileAccess file = new TextFileAccess();
  file.setPath("META-INF/services/org.eclipse.xtext.ISetup");
  StringConcatenationClient _client = new StringConcatenationClient() {
    @Override
    protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
      {
        for(final XtextGeneratorLanguage lang : XtextGenerator.this.languageConfigs) {
          TypeReference _genericIdeSetup = XtextGenerator.this.naming.getGenericIdeSetup(lang.getGrammar());
          _builder.append(_genericIdeSetup);
          _builder.newLineIfNotEmpty();
        }
      }
    }
  };
  file.setContent(_client);
  file.writeTo(this.projectConfig.getGenericIde().getSrcGen());
}
项目:xtext-core    文件:SimpleProjectWizardFragment2.java   
public void generateWizardNewProjectCreationPage() {
  final TypeReference mainPageClass = TypeReference.typeRef(this.getProjectWizardCreationPageClassName());
  final JavaFileAccess file = this.fileAccessFactory.createJavaFile(mainPageClass);
  StringConcatenationClient _client = new StringConcatenationClient() {
    @Override
    protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
      _builder.append("public class ");
      String _simpleName = mainPageClass.getSimpleName();
      _builder.append(_simpleName);
      _builder.append(" extends ");
      TypeReference _typeRef = TypeReference.typeRef("org.eclipse.ui.dialogs.WizardNewProjectCreationPage");
      _builder.append(_typeRef);
      _builder.append(" {");
      _builder.newLineIfNotEmpty();
      _builder.newLine();
      _builder.append("\t");
      _builder.append("public ");
      String _simpleName_1 = mainPageClass.getSimpleName();
      _builder.append(_simpleName_1, "\t");
      _builder.append("(String pageName) {");
      _builder.newLineIfNotEmpty();
      _builder.append("\t\t");
      _builder.append("super(pageName);");
      _builder.newLine();
      _builder.append("\t");
      _builder.append("}");
      _builder.newLine();
      _builder.newLine();
      _builder.append("}");
      _builder.newLine();
    }
  };
  file.setContent(_client);
  file.writeTo(this.getProjectConfig().getEclipsePlugin().getSrc());
}
项目:xtext-core    文件:Formatter2Fragment2.java   
protected TypeReference getFormatter2Stub(final Grammar grammar) {
  String _runtimeBasePackage = this._xtextGeneratorNaming.getRuntimeBasePackage(grammar);
  String _plus = (_runtimeBasePackage + ".formatting2.");
  String _simpleName = GrammarUtil.getSimpleName(grammar);
  String _plus_1 = (_plus + _simpleName);
  String _plus_2 = (_plus_1 + "Formatter");
  return new TypeReference(_plus_2);
}
项目:xtext-core    文件:OutlineTreeProviderFragment2.java   
@Override
public void generate() {
  ManifestAccess _manifest = this.getProjectConfig().getEclipsePlugin().getManifest();
  boolean _tripleNotEquals = (_manifest != null);
  if (_tripleNotEquals) {
    Set<String> _requiredBundles = this.getProjectConfig().getEclipsePlugin().getManifest().getRequiredBundles();
    _requiredBundles.add("org.eclipse.xtext.ui");
  }
  boolean _isGenerateStub = this.isGenerateStub();
  boolean _not = (!_isGenerateStub);
  if (_not) {
    return;
  }
  IXtextGeneratorFileSystemAccess _src = this.getProjectConfig().getEclipsePlugin().getSrc();
  boolean _tripleNotEquals_1 = (_src != null);
  if (_tripleNotEquals_1) {
    boolean _isGenerateXtendStub = this.isGenerateXtendStub();
    if (_isGenerateXtendStub) {
      this.generateXtendOutlineTreeProvider();
    } else {
      this.generateJavaOutlineTreeProvider();
    }
  }
  GuiceModuleAccess.BindingFactory _bindingFactory = new GuiceModuleAccess.BindingFactory();
  TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider");
  GuiceModuleAccess.BindingFactory _addTypeToType = _bindingFactory.addTypeToType(_typeReference, 
    this.getOutlineTreeProviderClass(this.getGrammar()));
  TypeReference _typeReference_1 = new TypeReference("org.eclipse.xtext.ui.editor.outline.impl.IOutlineTreeStructureProvider");
  _addTypeToType.addTypeToType(_typeReference_1, 
    this.getOutlineTreeProviderClass(this.getGrammar())).contributeTo(this.getLanguage().getEclipsePluginGenModule());
}
项目:xtext-extras    文件:ImportURIScopingFragment2.java   
@Override
public TypeReference getDelegateScopeProvider() {
  TypeReference _xifexpression = null;
  boolean _inheritsXbase = this._xbaseUsageDetector.inheritsXbase(this.getLanguage().getGrammar());
  if (_inheritsXbase) {
    _xifexpression = TypeReference.typeRef("org.eclipse.xtext.xbase.scoping.XImportSectionNamespaceScopeProvider");
  } else {
    _xifexpression = TypeReference.typeRef(SimpleLocalScopeProvider.class);
  }
  return _xifexpression;
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getCodeBlockModificationListener(final Grammar it) {
  String _ideaBasePackage = this._xtextGeneratorNaming.getIdeaBasePackage(it);
  String _plus = (_ideaBasePackage + ".lang.psi");
  String _simpleName = GrammarUtil.getSimpleName(it);
  String _plus_1 = (_simpleName + "CodeBlockModificationListener");
  return new TypeReference(_plus, _plus_1);
}
项目:xtext-core    文件:ContentAssistFragment2.java   
protected TypeReference getGenProposalProviderSuperClass(final Grammar g) {
  TypeReference _xblockexpression = null;
  {
    final Grammar superGrammar = IterableExtensions.<Grammar>head(g.getUsedGrammars());
    TypeReference _xifexpression = null;
    if ((this.isInheritImplementation() && (superGrammar != null))) {
      _xifexpression = this.getProposalProviderClass(superGrammar);
    } else {
      _xifexpression = this.getDefaultGenProposalProviderSuperClass();
    }
    _xblockexpression = _xifexpression;
  }
  return _xblockexpression;
}
项目:xtext-core    文件:ValidatorNaming.java   
public TypeReference getValidatorClass(final Grammar grammar) {
  String _runtimeBasePackage = this._xtextGeneratorNaming.getRuntimeBasePackage(grammar);
  String _plus = (_runtimeBasePackage + ".validation.");
  String _simpleName = GrammarUtil.getSimpleName(grammar);
  String _plus_1 = (_plus + _simpleName);
  String _plus_2 = (_plus_1 + "Validator");
  return new TypeReference(_plus_2);
}
项目:xtext-core    文件:ValidatorFragment2.java   
protected TypeReference getGenValidatorSuperClass(final Grammar grammar) {
  TypeReference _xblockexpression = null;
  {
    final Grammar superGrammar = GrammarUtil2.getNonTerminalsSuperGrammar(grammar);
    TypeReference _xifexpression = null;
    if ((this.isInheritImplementation() && (superGrammar != null))) {
      _xifexpression = this._validatorNaming.getValidatorClass(superGrammar);
    } else {
      _xifexpression = this.getDefaultValidatorSuperClass();
    }
    _xblockexpression = _xifexpression;
  }
  return _xblockexpression;
}
项目:xtext-core    文件:LabelProviderFragment2.java   
protected TypeReference getEObjectLabelProviderClass(final Grammar g) {
  String _eclipsePluginBasePackage = this._xtextGeneratorNaming.getEclipsePluginBasePackage(g);
  String _plus = (_eclipsePluginBasePackage + ".labeling.");
  String _simpleName = GrammarUtil.getSimpleName(g);
  String _plus_1 = (_plus + _simpleName);
  String _plus_2 = (_plus_1 + "LabelProvider");
  return new TypeReference(_plus_2);
}
项目:xtext-core    文件:WebIntegrationFragment.java   
protected TypeReference getServletClass(final Grammar grammar) {
  String _webBasePackage = this._xtextGeneratorNaming.getWebBasePackage(grammar);
  String _plus = (_webBasePackage + ".");
  String _simpleName = GrammarUtil.getSimpleName(grammar);
  String _plus_1 = (_plus + _simpleName);
  String _plus_2 = (_plus_1 + "Servlet");
  return new TypeReference(_plus_2);
}
项目:xtext-core    文件:QualifiedNamesFragment2.java   
@Override
public void generate() {
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef(IQualifiedNameProvider.class), TypeReference.typeRef(DefaultDeclarativeQualifiedNameProvider.class)).contributeTo(this.getLanguage().getRuntimeGenModule());
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher"), 
    TypeReference.typeRef("org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher")).addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.IDependentElementsCalculator"), 
    TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator")).contributeTo(this.getLanguage().getEclipsePluginGenModule());
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher"), 
    TypeReference.typeRef("org.eclipse.xtext.ide.editor.contentassist.FQNPrefixMatcher")).contributeTo(this.getLanguage().getIdeGenModule());
}
项目:xtext-core    文件:AbstractAntlrGrammarGenerator.java   
protected CharSequence compileLexerImports(final Grammar it, final AntlrOptions options) {
  StringConcatenation _builder = new StringConcatenation();
  _builder.newLine();
  _builder.append("// Hack: Use our own Lexer superclass by means of import. ");
  _builder.newLine();
  _builder.append("// Currently there is no other way to specify the superclass for the lexer.");
  _builder.newLine();
  _builder.append("import ");
  TypeReference _lexerSuperClass = this.getGrammarNaming().getLexerSuperClass(it);
  _builder.append(_lexerSuperClass);
  _builder.append(";");
  _builder.newLineIfNotEmpty();
  return _builder;
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getPsiInternalLexer(final Grammar it) {
  String _ideaBasePackage = this._xtextGeneratorNaming.getIdeaBasePackage(it);
  String _plus = (_ideaBasePackage + ".parser.antlr.internal");
  String _simpleName = GrammarUtil.getSimpleName(it);
  String _plus_1 = ("PsiInternal" + _simpleName);
  String _plus_2 = (_plus_1 + "Lexer");
  return new TypeReference(_plus, _plus_2);
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getPsiParser(final Grammar it) {
  String _ideaBasePackage = this._xtextGeneratorNaming.getIdeaBasePackage(it);
  String _plus = (_ideaBasePackage + ".lang.parser");
  String _simpleName = GrammarUtil.getSimpleName(it);
  String _plus_1 = (_simpleName + "PsiParser");
  return new TypeReference(_plus, _plus_1);
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getCompletionContributor(final Grammar it) {
  String _ideaBasePackage = this._xtextGeneratorNaming.getIdeaBasePackage(it);
  String _plus = (_ideaBasePackage + ".completion");
  String _simpleName = GrammarUtil.getSimpleName(it);
  String _plus_1 = (_simpleName + "CompletionContributor");
  return new TypeReference(_plus, _plus_1);
}
项目:xtext-core    文件:ImportNamespacesScopingFragment2.java   
protected TypeReference getAbstractScopeProviderClass(final Grammar grammar) {
  String _runtimeBasePackage = this._xtextGeneratorNaming.getRuntimeBasePackage(grammar);
  String _plus = (_runtimeBasePackage + ".scoping.");
  String _plus_1 = (_plus + "Abstract");
  String _simpleName = GrammarUtil.getSimpleName(grammar);
  String _plus_2 = (_plus_1 + _simpleName);
  String _plus_3 = (_plus_2 + "ScopeProvider");
  return new TypeReference(_plus_3);
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getParserDefinition(final Grammar it) {
  String _ideaBasePackage = this._xtextGeneratorNaming.getIdeaBasePackage(it);
  String _plus = (_ideaBasePackage + ".lang.parser");
  String _simpleName = GrammarUtil.getSimpleName(it);
  String _plus_1 = (_simpleName + "ParserDefinition");
  return new TypeReference(_plus, _plus_1);
}
项目:xtext-core    文件:OutlineTreeProviderFragment2.java   
protected void generateJavaOutlineTreeProvider() {
  TypeReference _outlineTreeProviderClass = this.getOutlineTreeProviderClass(this.getGrammar());
  StringConcatenationClient _client = new StringConcatenationClient() {
    @Override
    protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
      _builder.append("/**");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* Customization of the default outline structure.");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("*");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("*/");
      _builder.newLine();
      _builder.append("public class ");
      String _simpleName = OutlineTreeProviderFragment2.this.getOutlineTreeProviderClass(OutlineTreeProviderFragment2.this.getGrammar()).getSimpleName();
      _builder.append(_simpleName);
      _builder.append(" extends ");
      TypeReference _typeRef = TypeReference.typeRef("org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider");
      _builder.append(_typeRef);
      _builder.append(" {");
      _builder.newLineIfNotEmpty();
      _builder.newLine();
      _builder.append("}");
      _builder.newLine();
    }
  };
  this.fileAccessFactory.createJavaFile(_outlineTreeProviderClass, _client).writeTo(this.getProjectConfig().getEclipsePlugin().getSrc());
}
项目:xtext-core    文件:GrammarNaming.java   
public TypeReference getLexerClass(final Grammar it) {
  String _packageName = this.getLexerGrammar(it).getPackageName();
  StringConcatenation _builder = new StringConcatenation();
  String _simpleName = this.getLexerGrammar(it).getSimpleName();
  _builder.append(_simpleName);
  {
    boolean _isCombinedGrammar = this.isCombinedGrammar(it);
    if (_isCombinedGrammar) {
      _builder.append("Lexer");
    }
  }
  return new TypeReference(_packageName, _builder.toString());
}
项目:xtext-core    文件:TypeReferenceTest.java   
@Test
public void testNestedType() {
  final TypeReference ref = new TypeReference("java.util", "Map.Entry");
  Assert.assertEquals("java.util", ref.getPackageName());
  Assert.assertEquals("Entry", ref.getSimpleName());
  Assert.assertEquals(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("Map", "Entry")), ref.getSimpleNames());
}
项目:xtext-core    文件:GrammarNaming.java   
public TypeReference getAntlrTokenFileProviderClass(final Grammar it) {
  String _parserPackage = this.getParserPackage(it);
  StringConcatenation _builder = new StringConcatenation();
  String _simpleName = GrammarUtil.getSimpleName(it);
  _builder.append(_simpleName);
  _builder.append("AntlrTokenFileProvider");
  return new TypeReference(_parserPackage, _builder.toString());
}
项目:xtext-core    文件:IdeaPluginGenerator.java   
public CharSequence compileExtension(final Grammar grammar, final String extensionPointId, final TypeReference implementationClass) {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("<");
  _builder.append(extensionPointId);
  _builder.append(" ");
  _builder.newLineIfNotEmpty();
  _builder.append("\t");
  _builder.append("language=\"");
  String _languageID = this._ideaPluginExtension.getLanguageID(grammar);
  _builder.append(_languageID, "\t");
  _builder.append("\"");
  _builder.newLineIfNotEmpty();
  _builder.append("\t");
  _builder.append("factoryClass=\"");
  TypeReference _extensionFactory = this._ideaPluginClassNames.getExtensionFactory(grammar);
  _builder.append(_extensionFactory, "\t");
  _builder.append("\"");
  _builder.newLineIfNotEmpty();
  _builder.append("\t");
  _builder.append("implementationClass=\"");
  _builder.append(implementationClass, "\t");
  _builder.append("\"");
  _builder.newLineIfNotEmpty();
  _builder.append("/>");
  _builder.newLine();
  return _builder;
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getAbstractFileType(final Grammar it) {
  String _ideaBasePackage = this._xtextGeneratorNaming.getIdeaBasePackage(it);
  String _plus = (_ideaBasePackage + ".lang");
  String _simpleName = GrammarUtil.getSimpleName(it);
  String _plus_1 = ("Abstract" + _simpleName);
  String _plus_2 = (_plus_1 + "FileType");
  return new TypeReference(_plus, _plus_2);
}
项目:xtext-core    文件:TypeReferenceTest.java   
@Test
@Deprecated
public void testGuessTypeRef() {
  final TypeReference ref = TypeReference.guessTypeRef("java.util.Map.Entry");
  Assert.assertEquals("java.util", ref.getPackageName());
  Assert.assertEquals("Entry", ref.getSimpleName());
  Assert.assertEquals(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("Map", "Entry")), ref.getSimpleNames());
}
项目:xtext-core    文件:GuiceModuleAccess.java   
public BindKey(final String name, final TypeReference type, final boolean singleton, final boolean eagerSingleton) {
  super();
  this.name = name;
  this.type = type;
  this.singleton = singleton;
  this.eagerSingleton = eagerSingleton;
}
项目:xtext-core    文件:GuiceModuleAccess.java   
public BindValue(final Object expression, final TypeReference type, final boolean provider, final List<Object> statements) {
  super();
  this.expression = expression;
  this.type = type;
  this.provider = provider;
  this.statements = statements;
}
项目:xtext-core    文件:PsiAntlrGrammarGenerator.java   
@Override
protected String compileParserImports(final Grammar it, final AntlrOptions options) {
  StringConcatenation _builder = new StringConcatenation();
  _builder.newLine();
  _builder.append("import ");
  String _name = this.getGrammarNaming().getInternalParserSuperClass(it).getName();
  _builder.append(_name);
  _builder.append(";");
  _builder.newLineIfNotEmpty();
  _builder.append("import ");
  TypeReference _elementTypeProvider = this._ideaPluginClassNames.getElementTypeProvider(GrammarUtil.getGrammar(it));
  _builder.append(_elementTypeProvider);
  _builder.append(";");
  _builder.newLineIfNotEmpty();
  _builder.append("import org.eclipse.xtext.idea.parser.TokenTypeProvider;");
  _builder.newLine();
  _builder.append("import org.eclipse.xtext.parser.antlr.XtextTokenStream;");
  _builder.newLine();
  _builder.append("import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;");
  _builder.newLine();
  {
    if (((!IterableExtensions.isEmpty(Iterables.<UnorderedGroup>filter(Iterables.<EObject>concat(ListExtensions.<ParserRule, List<EObject>>map(GrammarUtil.allParserRules(it), ((Function1<ParserRule, List<EObject>>) (ParserRule it_1) -> {
      return EcoreUtil2.eAllContentsAsList(it_1);
    }))), UnorderedGroup.class))) && options.isBacktrack())) {
      _builder.append("import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState;");
      _builder.newLine();
    }
  }
  _builder.append("import ");
  String _name_1 = this._grammarAccessExtensions.getGrammarAccess(it).getName();
  _builder.append(_name_1);
  _builder.append(";");
  _builder.newLineIfNotEmpty();
  _builder.newLine();
  _builder.append("import com.intellij.lang.PsiBuilder;");
  _builder.newLine();
  return _builder.toString();
}
项目: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());
    }
  }
}
项目:xtext-core    文件:ImportNamespacesScopingFragment2.java   
protected void generateJavaScopeProvider() {
  TypeReference _scopeProviderClass = this.getScopeProviderClass(this.getGrammar());
  StringConcatenationClient _client = new StringConcatenationClient() {
    @Override
    protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
      _builder.append("/**");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* This class contains custom scoping description.");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* ");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("* on how and when to use it.");
      _builder.newLine();
      _builder.append(" ");
      _builder.append("*/");
      _builder.newLine();
      _builder.append("public class ");
      String _simpleName = ImportNamespacesScopingFragment2.this.getScopeProviderClass(ImportNamespacesScopingFragment2.this.getGrammar()).getSimpleName();
      _builder.append(_simpleName);
      _builder.append(" extends ");
      TypeReference _abstractScopeProviderClass = ImportNamespacesScopingFragment2.this.getAbstractScopeProviderClass(ImportNamespacesScopingFragment2.this.getGrammar());
      _builder.append(_abstractScopeProviderClass);
      _builder.append(" {");
      _builder.newLineIfNotEmpty();
      _builder.newLine();
      _builder.append("}");
      _builder.newLine();
    }
  };
  this.fileAccessFactory.createJavaFile(_scopeProviderClass, _client).writeTo(this.getProjectConfig().getRuntime().getSrc());
}
项目:xtext-core    文件:SerializerFragment2.java   
protected TypeReference getAbstractSyntacticSequencerClass(final Grammar grammar) {
  String _serializerBasePackage = this.getSerializerBasePackage(grammar);
  String _simpleName = GrammarUtil.getSimpleName(grammar);
  String _plus = ("Abstract" + _simpleName);
  String _plus_1 = (_plus + "SyntacticSequencer");
  return new TypeReference(_serializerBasePackage, _plus_1);
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getTokenTypeProvider(final Grammar it) {
  String _ideaBasePackage = this._xtextGeneratorNaming.getIdeaBasePackage(it);
  String _plus = (_ideaBasePackage + ".lang.parser");
  String _simpleName = GrammarUtil.getSimpleName(it);
  String _plus_1 = (_simpleName + "TokenTypeProvider");
  return new TypeReference(_plus, _plus_1);
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getElementTypeProvider(final Grammar it) {
  String _ideaBasePackage = this._xtextGeneratorNaming.getIdeaBasePackage(it);
  String _plus = (_ideaBasePackage + ".lang");
  String _simpleName = GrammarUtil.getSimpleName(it);
  String _plus_1 = (_simpleName + "ElementTypeProvider");
  return new TypeReference(_plus, _plus_1);
}
项目:xtext-core    文件:JavaFileAccess.java   
@Override
public String getStringRepresentation(final Object object) {
  String _xifexpression = null;
  if ((object instanceof TypeReference)) {
    _xifexpression = this.access.importType(((TypeReference)object));
  } else {
    String _xifexpression_1 = null;
    if ((object instanceof Class<?>)) {
      TypeReference _typeReference = new TypeReference(((Class<?>)object));
      _xifexpression_1 = this.access.importType(_typeReference);
    } else {
      String _xifexpression_2 = null;
      if (((object instanceof EClass) && (this.access.resourceSet != null))) {
        TypeReference _typeReference_1 = new TypeReference(((EClass) object), this.access.resourceSet);
        _xifexpression_2 = this.access.importType(_typeReference_1);
      } else {
        String _xifexpression_3 = null;
        if (((object instanceof EPackage) && (this.access.resourceSet != null))) {
          TypeReference _typeReference_2 = new TypeReference(((EPackage) object), this.access.resourceSet);
          _xifexpression_3 = this.access.importType(_typeReference_2);
        } else {
          _xifexpression_3 = object.toString();
        }
        _xifexpression_2 = _xifexpression_3;
      }
      _xifexpression_1 = _xifexpression_2;
    }
    _xifexpression = _xifexpression_1;
  }
  return _xifexpression;
}
项目:xtext-core    文件:IdeaPluginClassNames.java   
public TypeReference getSuperParserDefinition(final Grammar it) {
  return TypeReference.typeRef("org.eclipse.xtext.idea.parser.AbstractXtextParserDefinition");
}
项目:xtext-extras    文件:NamingAdapter.java   
@Override
public TypeReference getRuntimeGenModule(final Grammar grammar) {
  String _guiceModuleRtGenerated = this.naming.guiceModuleRtGenerated(grammar);
  return new TypeReference(_guiceModuleRtGenerated);
}