當前位置: 首頁>>代碼示例>>Java>>正文


Java Generator類代碼示例

本文整理匯總了Java中org.eclipse.xtext.generator.Generator的典型用法代碼示例。如果您正苦於以下問題:Java Generator類的具體用法?Java Generator怎麽用?Java Generator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Generator類屬於org.eclipse.xtext.generator包,在下文中一共展示了Generator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	super.generate(grammar, ctx);
	String srcUiGenPath = ctx.getOutput().getOutlet(Generator.SRC_GEN_IDE).getPath();
	final String encoding = getEncoding(ctx, Generator.SRC_GEN_IDE);
	String absoluteGrammarFileName = srcUiGenPath + "/" + getGrammarFileName(grammar, getNaming()).replace('.', '/') + ".g";
	addAntlrParam("-fo");
	addAntlrParam(absoluteGrammarFileName.substring(0, absoluteGrammarFileName.lastIndexOf('/')));
	getAntlrTool().runWithEncodingAndParams(absoluteGrammarFileName, encoding, getAntlrParams());
	Charset charset = Charset.forName(getEncoding(ctx, Generator.SRC_GEN_IDE));
	simplifyUnorderedGroupPredicatesIfRequired(grammar, absoluteGrammarFileName, charset);
	splitParserAndLexerIfEnabled(absoluteGrammarFileName, charset);
	suppressWarnings(absoluteGrammarFileName, charset);
	removeBacktrackingGuardsIfEnabled(absoluteGrammarFileName, charset);
	normalizeLineDelimiters(absoluteGrammarFileName, charset);
	normalizeTokens(absoluteGrammarFileName, charset);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:18,代碼來源:XtextAntlrUiGeneratorFragment.java

示例2: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	super.generate(grammar, ctx);
	String srcGenPath = ctx.getOutput().getOutlet(Generator.SRC_GEN).getPath();
	final String encoding = getEncoding(ctx, Generator.SRC_GEN);
	String absoluteGrammarFileName = srcGenPath+"/"+getGrammarFileName(grammar, getNaming()).replace('.', '/')+".g";
	addAntlrParam("-fo");
	addAntlrParam(absoluteGrammarFileName.substring(0, absoluteGrammarFileName.lastIndexOf('/')));
	getAntlrTool().runWithEncodingAndParams(absoluteGrammarFileName, encoding, getAntlrParams());
	Charset charset = Charset.forName(encoding);
	simplifyUnorderedGroupPredicatesIfRequired(grammar, absoluteGrammarFileName, charset);
	splitParserAndLexerIfEnabled(absoluteGrammarFileName, charset);
	suppressWarnings(absoluteGrammarFileName, charset);
	normalizeLineDelimiters(absoluteGrammarFileName, charset);
	normalizeTokens(absoluteGrammarFileName, charset);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:17,代碼來源:XtextAntlrGeneratorFragment.java

示例3: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	super.generate(grammar, ctx);
	if (generateDotDiagram || graphvizCommand != null) {
		try {
			TreeConstNFAToDot ftd = new TreeConstNFAToDot();
			String fn = new File(ctx.getOutput().getOutlet(Generator.SRC_GEN).getPath() + "/"
					+ getNaming().asPath(getParseTreeConstructorName(grammar,getNaming()))).getCanonicalPath();
			if (generateDotDiagram) {
				PrintStream out;
				out = new PrintStream(fn + ".dot");
				ftd.draw(grammar, out);
				out.close();
			}
			if (graphvizCommand != null) {
				String cmd = graphvizCommand.replace("%1", fn);
				ftd.draw(grammar, cmd);
			}
		}
		catch (IOException e) {
			log.error("IOError", e);
		}
	}
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:25,代碼來源:ParseTreeConstructorFragment.java

示例4: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	super.generate(grammar, ctx);
	String srcGen = Generator.SRC_GEN;
	String src = Generator.SRC;
	if (contentAssist || highlighting) {
		srcGen = Generator.SRC_GEN_IDE;
		src = Generator.SRC_IDE;
	}
	String srcGenPath = ctx.getOutput().getOutlet(srcGen).getPath();
	String srcPath = ctx.getOutput().getOutlet(src).getPath();
	String grammarFile = srcPath + "/" + getLexerGrammar().replace('.', '/') + ".g";
	String generateTo = "";
	if (lexerGrammar.lastIndexOf('.') != -1) {
		generateTo = lexerGrammar.substring(0, lexerGrammar.lastIndexOf('.'));
	}
	generateTo = srcGenPath + "/" + generateTo.replace('.', '/');
	addAntlrParam("-fo");
	addAntlrParam(generateTo);
	final String encoding = getEncoding(ctx, srcGen);
	getAntlrTool().runWithEncodingAndParams(grammarFile, encoding, getAntlrParams());
	Charset charset = Charset.forName(encoding);
	String javaFile = srcGenPath+"/"+getLexerGrammar().replace('.', '/')+".java";
	splitLexerIfEnabled(javaFile, charset);
	suppressWarningsImpl(javaFile, charset);
	normalizeTokens(javaFile, charset);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:28,代碼來源:ExternalAntlrLexerFragment.java

示例5: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	KeywordHelper helper = new KeywordHelper(grammar, getOptions().isIgnoreCase());
	super.generate(grammar, ctx);
	final String srcGenPath = ctx.getOutput().getOutlet(Generator.SRC_GEN_IDE).getPath();
	final String encoding = getEncoding(ctx, Generator.SRC_GEN_IDE);
	String libPath = srcGenPath + "/" + getFragmentHelper().getContentAssistLexerGrammarFileName(grammar).replace('.', '/');
	libPath = libPath.substring(0, libPath.lastIndexOf('/'));
	String absoluteLexerFileName = srcGenPath+"/"+getFragmentHelper().getContentAssistLexerGrammarFileName(grammar).replace('.', '/')+".g";
	String absoluteParserFileName = srcGenPath+"/"+getFragmentHelper().getContentAssistParserGrammarFileName(grammar).replace('.', '/')+".g";
	addAntlrParam("-fo");
	addAntlrParam(absoluteParserFileName.substring(0, absoluteParserFileName.lastIndexOf('/')));
	String[] lexerAntlrParams = getAntlrParams();
	lexerAntlrParams[lexerAntlrParams.length - 1] = absoluteLexerFileName.substring(0, absoluteLexerFileName.lastIndexOf('/'));
	getAntlrTool().runWithEncodingAndParams(absoluteLexerFileName, encoding, lexerAntlrParams);
	addAntlrParam("-lib");
	addAntlrParam(libPath);
	getAntlrTool().runWithEncodingAndParams(absoluteParserFileName, encoding, getAntlrParams());
	Charset charset = Charset.forName(encoding);
	simplifyUnorderedGroupPredicatesIfRequired(grammar, absoluteParserFileName, charset);
	splitParserAndLexerIfEnabled(absoluteLexerFileName, absoluteParserFileName, charset);
	suppressWarnings(absoluteLexerFileName, absoluteParserFileName, charset);
	normalizeLineDelimiters(absoluteLexerFileName, absoluteParserFileName, charset);
	normalizeTokens(absoluteLexerFileName, charset);
	normalizeTokens(absoluteParserFileName, charset);
	helper.discardHelper(grammar);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:28,代碼來源:ContentAssistParserGeneratorFragment.java

示例6: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	DebugGrammarToken token = DebugGrammarToken.aquire();
	try {
		super.generate(grammar, ctx);
		String srcGenPath = ctx.getOutput().getOutlet(Generator.SRC_GEN).getPath();
		String absoluteGrammarFileName = srcGenPath+"/"+getGrammarFileName(grammar, getNaming()).replace('.', '/')+".g";
		prettyPrint(absoluteGrammarFileName, Charset.forName(getEncoding(ctx, Generator.SRC_GEN)));
	} finally {
		token.done();
	}
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:13,代碼來源:DebugAntlrGeneratorFragment.java

示例7: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	RuleNames.ensureAdapterInstalled(grammar);
	super.generate(grammar, ctx);

	final ResourceSaveIndicator isSaving = new ResourceSaveIndicator();
	// create a defensive clone
	Grammar copy = deepCopy(grammar, isSaving);
	ResourceSet set = copy.eResource().getResourceSet();

	// save grammar model
	String path;
	if (xmlVersion == null) {
		path = GrammarUtil.getClasspathRelativePathToBinGrammar(copy);
	} else {
		log.warn("'xmlVersion' has been specified for this "
				+ GrammarAccessFragment.class.getSimpleName()
				+ ". Therefore, the grammar is persisted as XMI and not as binary. This can be a performance drawback.");
		path = GrammarUtil.getClasspathRelativePathToXmi(copy);
	}
	URI uri = URI.createURI(ctx.getOutput().getOutlet(Generator.SRC_GEN).getPath() + "/" + path);
	Resource resource = set.createResource(uri, ContentHandler.UNSPECIFIED_CONTENT_TYPE);
	addAllGrammarsToResource(resource, copy, new HashSet<Grammar>());
	isSaving.set(Boolean.TRUE);
	Map<String, Object> saveOptions = Maps.newHashMap();
	if (resource instanceof XMLResource) {
		((XMLResource) resource).setXMLVersion(getXmlVersion());
	} else if (resource instanceof BinaryResourceImpl){
		saveOptions.put(BinaryResourceImpl.OPTION_VERSION, BinaryResourceImpl.BinaryIO.Version.VERSION_1_1);
		saveOptions.put(BinaryResourceImpl.OPTION_STYLE_DATA_CONVERTER, Boolean.TRUE);
	}
	try {
		resource.save(saveOptions);
	} catch (IOException e) {
		log.error(e.getMessage(), e);
	} finally {
		isSaving.set(Boolean.FALSE);
	}
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:40,代碼來源:GrammarAccessFragment.java

示例8: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(final Grammar grammar, XpandExecutionContext ctx) {
	final String templateName = getNewProjectTemplateName(grammar, getNaming());
	final Outlet outlet = ctx.getOutput().getOutlet(Generator.SRC_UI);
	final File templateFile = new File(new File(outlet.getPath()), templateName.replaceAll("::", "/") + '.' + XpandUtil.TEMPLATE_EXTENSION);
	final boolean templateExisted = templateFile.exists();
	List<Object> parameters = getParameters(grammar);
	parameters.add(outlet.getFileEncoding());
	XpandFacade.create(ctx).evaluate2(getTemplate()+"::generate", grammar, parameters);
	if (!templateExisted && templateFile.exists()) {
		LOG.info("A new template " + templateName + " has been generated into " + outlet.getPath() + ".");
		LOG.info("  Make sure to enable the Xtend/Xpand nature and JavaBeans metamodel to edit this template.");
	}
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:15,代碼來源:SimpleProjectWizardFragment.java

示例9: createOutlet

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
/**
 * Tweaks the generation of the {@link Generator#SRC_GEN Generator.SRC_GEN},
 * {@link Generator#SRC_GEN_IDE Generator.SRC_GEN_IDE}, and
 * {@link Generator#SRC_GEN_UI Generator.SRC_GEN_UI} outlets
 * and injects the {@link #getTmpPath()}.
 */
@Override
protected Outlet createOutlet(final boolean append, final String encoding, final String name, final boolean overwrite, final String path) {
  Outlet _xifexpression = null;
  if (((Objects.equal(name, Generator.SRC_GEN) || Objects.equal(name, Generator.SRC_GEN_IDE)) || Objects.equal(name, Generator.SRC_GEN_UI))) {
    _xifexpression = super.createOutlet(append, encoding, name, overwrite, this.getTmpFolder().getAbsolutePath());
  } else {
    _xifexpression = super.createOutlet(append, encoding, name, overwrite, path);
  }
  return _xifexpression;
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:17,代碼來源:XtextAntlrGeneratorComparisonFragment.java

示例10: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(final Grammar grammar, final XpandExecutionContext ctx) {
  KeywordHelper helper = new KeywordHelper(grammar, getOptions().isIgnoreCase());
  super.generate(grammar, ctx);
  final String srcGenPath = ctx.getOutput().getOutlet(Generator.SRC_GEN_UI).getPath();
  final String encoding = getEncoding(ctx, Generator.SRC_GEN_UI);
  String libPath = srcGenPath + "/"
      + getFragmentHelper().getContentAssistLexerGrammarFileName(grammar).replace('.', '/');
  libPath = libPath.substring(0, libPath.lastIndexOf('/'));
  String absoluteLexerFileName = srcGenPath + "/"
      + getFragmentHelper().getContentAssistLexerGrammarFileName(grammar).replace('.', '/')
      + ".g";
  String absoluteParserFileName = srcGenPath + "/"
      + getFragmentHelper().getContentAssistParserGrammarFileName(grammar).replace('.', '/')
      + ".g";
  addAntlrParam("-fo");
  addAntlrParam(absoluteParserFileName.substring(0, absoluteParserFileName.lastIndexOf('/')));
  String[] lexerAntlrParams = getAntlrParams();
  lexerAntlrParams[lexerAntlrParams.length - 1] = absoluteLexerFileName.substring(0,
      absoluteLexerFileName.lastIndexOf('/'));

  // copy
  copy(new File(absoluteLexerFileName), new File(absoluteLexerFileName.replace(".g", ".gxtext")));
  writeFile(
      absoluteLexerFileName,
      readFile("../antlr4ide.core/src/main/java/com/github/jknack/parser/antlr/lexer/InternalAntlr4Lexer.g"));

  getAntlrTool().runWithEncodingAndParams(absoluteLexerFileName, encoding, lexerAntlrParams);
  addAntlrParam("-lib");
  addAntlrParam(libPath);
  getAntlrTool().runWithEncodingAndParams(absoluteParserFileName, encoding, getAntlrParams());
  Charset charset = Charset.forName(encoding);
  simplifyUnorderedGroupPredicatesIfRequired(grammar, absoluteParserFileName, charset);
  splitParserAndLexerIfEnabled(absoluteLexerFileName, absoluteParserFileName, charset);
  suppressWarnings(absoluteLexerFileName, absoluteParserFileName, charset);
  normalizeLineDelimiters(absoluteLexerFileName, absoluteParserFileName, charset);
  normalizeTokens(absoluteLexerFileName, charset);
  normalizeTokens(absoluteParserFileName, charset);
  helper.discardHelper(grammar);
}
 
開發者ID:antlr4ide,項目名稱:antlr4ide,代碼行數:41,代碼來源:AntlrUiGeneratorFragmentWithCustomLexer.java

示例11: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(final Grammar grammar, XpandExecutionContext ctx) {
	KeywordHelper helper = new KeywordHelper(grammar, getOptions().isIgnoreCase());
	super.generate(grammar, ctx);
	final String srcGenPath = ctx.getOutput().getOutlet(Generator.SRC_GEN).getPath();
	final String encoding = getEncoding(ctx, Generator.SRC_GEN);
	final String lexerBaseFileName = srcGenPath+"/"+getFragmentHelper().getLexerGrammarFileName(grammar).replace('.', '/');
	String libPath = lexerBaseFileName;
	libPath = libPath.substring(0, libPath.lastIndexOf('/'));
	String absoluteLexerFileName = lexerBaseFileName + ".g";
	String absoluteParserFileName = srcGenPath+"/"+getFragmentHelper().getParserGrammarFileName(grammar).replace('.', '/')+".g";
	addAntlrParam("-fo");
	addAntlrParam(absoluteParserFileName.substring(0, absoluteParserFileName.lastIndexOf('/')));
	String[] lexerAntlrParams = getAntlrParams();
	lexerAntlrParams[lexerAntlrParams.length - 1] = absoluteLexerFileName.substring(0, absoluteLexerFileName.lastIndexOf('/'));
	getAntlrTool().runWithEncodingAndParams(absoluteLexerFileName, encoding, lexerAntlrParams);
	cleanupLexerTokensFile(lexerBaseFileName, helper, encoding);
	addAntlrParam("-lib");
	addAntlrParam(libPath);
	getAntlrTool().runWithEncodingAndParams(absoluteParserFileName, encoding, getAntlrParams());
	Charset charset = Charset.forName(encoding);
	simplifyUnorderedGroupPredicatesIfRequired(grammar, absoluteParserFileName, charset);
	splitParserAndLexerIfEnabled(absoluteLexerFileName, absoluteParserFileName, charset);
	suppressWarnings(absoluteLexerFileName, absoluteParserFileName, charset);
	normalizeLineDelimiters(absoluteLexerFileName, absoluteParserFileName, charset);
	normalizeTokens(absoluteParserFileName, charset);
	MutableTokenDefProvider provider = createLexerTokensProvider(lexerBaseFileName, helper, charset);
	for(Map.Entry<Integer, String> entry: provider.getTokenDefMap().entrySet()) {
		String value = entry.getValue();
		if(helper.isKeywordRule(value)) {
			String keywordAsAntlrString = AntlrGrammarGenUtil.toAntlrString(helper.getKeywordValue(value));
			entry.setValue("'" + keywordAsAntlrString + "'");
		} else if (value.startsWith("'")) {
			value = AntlrGrammarGenUtil.toAntlrString(value);
			entry.setValue("'" + value + "'");
		}
	}
	try {
		provider.writeTokenFile(new PrintWriter(new File(srcGenPath+"/"+getFragmentHelper().getParserGrammarFileName(grammar).replace('.', '/') + ".tokens"), encoding));
	}
	catch (IOException e) {
		throw new RuntimeException(e);
	}
	normalizeTokens(absoluteLexerFileName, charset);
	helper.discardHelper(grammar);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:47,代碼來源:AntlrGeneratorFragment.java

示例12: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate() {
  Naming _naming = this.getNaming();
  boolean _tripleEquals = (_naming == null);
  if (_tripleEquals) {
    this.setNaming(this.createNaming());
  }
  if ((this.options == null)) {
    AntlrOptions _antlrOptions = new AntlrOptions();
    this.options = _antlrOptions;
  }
  final AntlrGrammarComparator.IErrorHandler errorHandler = this.createErrorHandler();
  RuntimeException exception = null;
  IRuntimeProjectConfig _runtime = this.getProjectConfig().getRuntime();
  IXtextGeneratorFileSystemAccess _srcGen = null;
  if (_runtime!=null) {
    _srcGen=_runtime.getSrcGen();
  }
  boolean _tripleNotEquals = (_srcGen != null);
  if (_tripleNotEquals) {
    exception = this.loadAndCompareGrammars(this.getProjectConfig().getRuntime().getSrcGen(), Generator.SRC_GEN, errorHandler);
  }
  boolean _and = false;
  if (!(((!this.failOnError) || (exception == null)) && (!this.skipContentAssistGrammarComparison))) {
    _and = false;
  } else {
    IBundleProjectConfig _genericIde = this.getProjectConfig().getGenericIde();
    IXtextGeneratorFileSystemAccess _srcGen_1 = null;
    if (_genericIde!=null) {
      _srcGen_1=_genericIde.getSrcGen();
    }
    boolean _tripleNotEquals_1 = (_srcGen_1 != null);
    _and = _tripleNotEquals_1;
  }
  if (_and) {
    exception = this.loadAndCompareGrammars(this.getProjectConfig().getGenericIde().getSrcGen(), Generator.SRC_GEN_IDE, errorHandler);
  }
  XtextAntlrGeneratorComparisonFragment.deleteDir(this.getTmpFolder());
  if ((this.failOnError && (exception != null))) {
    throw exception;
  }
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:43,代碼來源:XtextAntlrGeneratorComparisonFragment.java

示例13: createProjectConfig

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
private XtextProjectConfig createProjectConfig() {
  StandardProjectConfig _standardProjectConfig = new StandardProjectConfig();
  final Procedure1<StandardProjectConfig> _function = (StandardProjectConfig it) -> {
    it.setCreateEclipseMetaData(true);
    it.setBaseName(this.naming.getProjectNameRt());
    final String runtimeRoot = this.xpandContext.getOutput().getOutlet(Generator.PLUGIN_RT).getPath();
    final int projectNameIndex = runtimeRoot.lastIndexOf(it.getBaseName());
    if ((projectNameIndex >= 0)) {
      it.setRootPath(runtimeRoot.substring(0, projectNameIndex));
    } else {
      it.setRootPath(runtimeRoot);
    }
    RuntimeProjectConfig _runtime = it.getRuntime();
    _runtime.setName(it.getBaseName());
    RuntimeProjectConfig _runtime_1 = it.getRuntime();
    _runtime_1.setRoot(runtimeRoot);
    RuntimeProjectConfig _runtime_2 = it.getRuntime();
    _runtime_2.setSrc(this.xpandContext.getOutput().getOutlet(Generator.SRC).getPath());
    RuntimeProjectConfig _runtime_3 = it.getRuntime();
    _runtime_3.setSrcGen(this.xpandContext.getOutput().getOutlet(Generator.SRC_GEN).getPath());
    RuntimeProjectConfig _runtime_4 = it.getRuntime();
    _runtime_4.setEcoreModel(this.xpandContext.getOutput().getOutlet(Generator.MODEL).getPath());
    BundleProjectConfig _eclipsePlugin = it.getEclipsePlugin();
    _eclipsePlugin.setEnabled(true);
    BundleProjectConfig _eclipsePlugin_1 = it.getEclipsePlugin();
    _eclipsePlugin_1.setName(this.naming.getProjectNameUi());
    BundleProjectConfig _eclipsePlugin_2 = it.getEclipsePlugin();
    _eclipsePlugin_2.setRoot(this.xpandContext.getOutput().getOutlet(Generator.PLUGIN_UI).getPath());
    BundleProjectConfig _eclipsePlugin_3 = it.getEclipsePlugin();
    _eclipsePlugin_3.setSrc(this.xpandContext.getOutput().getOutlet(Generator.SRC_UI).getPath());
    BundleProjectConfig _eclipsePlugin_4 = it.getEclipsePlugin();
    _eclipsePlugin_4.setSrcGen(this.xpandContext.getOutput().getOutlet(Generator.SRC_GEN_UI).getPath());
    BundleProjectConfig _genericIde = it.getGenericIde();
    _genericIde.setEnabled(true);
    BundleProjectConfig _genericIde_1 = it.getGenericIde();
    _genericIde_1.setName(this.naming.getProjectNameIde());
    BundleProjectConfig _genericIde_2 = it.getGenericIde();
    _genericIde_2.setRoot(this.xpandContext.getOutput().getOutlet(Generator.PLUGIN_IDE).getPath());
    BundleProjectConfig _genericIde_3 = it.getGenericIde();
    _genericIde_3.setSrc(this.xpandContext.getOutput().getOutlet(Generator.SRC_IDE).getPath());
    BundleProjectConfig _genericIde_4 = it.getGenericIde();
    _genericIde_4.setSrcGen(this.xpandContext.getOutput().getOutlet(Generator.SRC_GEN_IDE).getPath());
  };
  return ObjectExtensions.<StandardProjectConfig>operator_doubleArrow(_standardProjectConfig, _function);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:46,代碼來源:Generator2AdapterSetup.java

示例14: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(final Xtend2ExecutionContext ctx) {
  ctx.writeFile(Generator.SRC, this.stubGenerator.getStubFileName(), this.stubGenerator.generateStubFileContents());
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:5,代碼來源:Formatter2Fragment.java

示例15: generate

import org.eclipse.xtext.generator.Generator; //導入依賴的package包/類
@Override
public void generate(final Xtend2ExecutionContext ctx) {
  if (this.generateStub) {
    String _asPath = this._naming.asPath(this.getProposalProviderName(this.grammar));
    String _plus = (_asPath + ".xtend");
    StringConcatenation _builder = new StringConcatenation();
    String _fileHeader = this._naming.fileHeader();
    _builder.append(_fileHeader);
    _builder.newLineIfNotEmpty();
    _builder.append("package ");
    String _packageName = this._naming.packageName(this.getProposalProviderName(this.grammar));
    _builder.append(_packageName);
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    _builder.append("import ");
    String _genProposalProviderName = this.getGenProposalProviderName();
    _builder.append(_genProposalProviderName);
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    _builder.append("/**");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#content-assist");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("* on how to customize the content assistant.");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("*/");
    _builder.newLine();
    _builder.append("class ");
    String _simpleName = this._naming.toSimpleName(this.getProposalProviderName(this.grammar));
    _builder.append(_simpleName);
    _builder.append(" extends ");
    String _simpleName_1 = this._naming.toSimpleName(this.getGenProposalProviderName());
    _builder.append(_simpleName_1);
    _builder.append(" {");
    _builder.newLineIfNotEmpty();
    _builder.append("}");
    _builder.newLine();
    ctx.writeFile(Generator.SRC_UI, _plus, _builder);
  }
  XpandFacade.create(ctx.getXpandExecutionContext()).evaluate2(
    "org::eclipse::xtext::ui::generator::contentAssist::JavaBasedContentAssistFragment::GenProposalProvider", 
    this.grammar, 
    Collections.<Object>singletonList(this.getSuperClassName()));
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:48,代碼來源:ContentAssistFragment.java


注:本文中的org.eclipse.xtext.generator.Generator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。