Generate the Plist file.

@param it the appendable used for generated the "tmLanguage" file.
9874
protected void generatePlistFile(CombinedTmAppendable it) {
		final String language = getLanguageSimpleName().toLowerCase();
		final String newBasename = getBasename(MessageFormat.format(BASENAME_PATTERN_NEW, language));
		writeFile(newBasename, it.getNewSyntaxContent());
	}
143185
protected void _generate(SarlAnnotationType annotation, IExtraLanguageGeneratorContext context) {
		final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(annotation);
		final PyAppendable appendable = createAppendable(jvmType, context);
		if (generateTypeDeclaration(
				this.qualifiedNameProvider.getFullyQualifiedName(annotation).toString(),
				annotation.getName(), false, Collections.emptyList(),
				getTypeBuilder().getDocumentation(annotation),
				true,
				annotation.getMembers(), appendable, context, null)) {
			final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(annotation);
			writeFile(name, appendable, context);
		}
	}
1142111
protected void generateMetadata(IXmlStyleAppendable it) {
		it.appendTagWithValue("property", //$NON-NLS-1$
				Strings.concat(";", getMimeTypes()), //$NON-NLS-1$
				"name", "mimetypes"); //$NON-NLS-1$ //$NON-NLS-2$

		final StringBuilder buffer = new StringBuilder();
		for (final String fileExtension : getLanguage().getFileExtensions()) {
			if (buffer.length() > 0) {
				buffer.append(";"); //$NON-NLS-1$
			}
			buffer.append("*.").append(fileExtension); //$NON-NLS-1$
		}
		it.appendTagWithValue("property", //$NON-NLS-1$
				buffer.toString(),
				"name", "globs"); //$NON-NLS-1$ //$NON-NLS-2$

		it.appendTagWithValue("property", //$NON-NLS-1$
				"//", //$NON-NLS-1$
				"name", "line-comment-start"); //$NON-NLS-1$ //$NON-NLS-2$

		it.appendTagWithValue("property", //$NON-NLS-1$
				"/*", //$NON-NLS-1$
				"name", "block-comment-start"); //$NON-NLS-1$ //$NON-NLS-2$

		it.appendTagWithValue("property", //$NON-NLS-1$
				"*/", //$NON-NLS-1$
				"name", "block-comment-end"); //$NON-NLS-1$ //$NON-NLS-2$
	}
115835
protected void generateComments(IStyleAppendable it) {
		appendComment(it, "comments"); //$NON-NLS-1$
		appendRegion(it, "sarlComment", "/\\*", "\\*/", "@Spell"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
		appendCmd(it, "syn match sarlCommentStar contained \"^\\s*\\*[^/]\"me=e-1"); //$NON-NLS-1$
		appendMatch(it, "sarlCommentStar", "^\\s*\\*$", true); //$NON-NLS-1$ //$NON-NLS-2$
		appendMatch(it, "sarlLineComment", "//.*", "@Spell"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

		appendCluster(it, "sarlComment", "sarlLineComment"); //$NON-NLS-1$ //$NON-NLS-2$
		hilight("sarlComment", VimSyntaxGroup.COMMENT); //$NON-NLS-1$
		hilight("sarlLineComment", VimSyntaxGroup.COMMENT); //$NON-NLS-1$

		appendComment(it, "match the special comment /**/"); //$NON-NLS-1$
		appendMatch(it, "sarlComment", "/\\*\\*/"); //$NON-NLS-1$ //$NON-NLS-2$
		it.newLine();
	}
1311035
def save_template
      path = "/tmp/ufo/#{@stack_name}/stack.yml"
      FileUtils.mkdir_p(File.dirname(path))
      IO.write(path, template_body)
      puts "Generated template saved at: #{path}"

      path = "/tmp/ufo/#{@stack_name}/parameters.yml"
      IO.write(path, JSON.pretty_generate(parameters))
      puts "Generated parameters saved at: #{path}"
    end
579026
def quick_make_file(local_file, tpl_file)
      current_file = local_file(local_file)
      template_file = @template.real_path(tpl_file)
      @template.make_file(
        template_file,
        current_file,
        @args.all.dup,
        make_data_files_array(current_file),
        method(:update_latest_options)
      )
    end
818761
public FormattedStringBuilder append(Throwable t) { 
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        PrintStream p = new PrintStream(os);
        t.printStackTrace(p);
        p.close();
        return append(os.toString());
    }
869867
public function serialize(SerializedTokenIterator $it)
	{
		$it->append($this->type);
		$it->append($this->text);
	}
1140959
private void generateElement(final INodeReadTrx paramRtx) throws TTIOException {
        final AttributesImpl atts = new AttributesImpl();
        final long key = paramRtx.getNode().getDataKey();

        try {
            // Process namespace nodes.
            for (int i = 0, namesCount = ((ElementNode)paramRtx.getNode()).getNamespaceCount(); i < namesCount; i++) {
                paramRtx.moveToNamespace(i);
                final QName qName = paramRtx.getQNameOfCurrentNode();
                mContHandler.startPrefixMapping(qName.getPrefix(), qName.getNamespaceURI());
                final String mURI = qName.getNamespaceURI();
                if (qName.getLocalPart().length() == 0) {
                    atts.addAttribute(mURI, "xmlns", "xmlns", "CDATA", mURI);
                } else {
                    atts.addAttribute(mURI, "xmlns", "xmlns:"
                        + paramRtx.getQNameOfCurrentNode().getLocalPart(), "CDATA", mURI);
                }
                paramRtx.moveTo(key);
            }

            // Process attributes.
            for (int i = 0, attCount = ((ElementNode)paramRtx.getNode()).getAttributeCount(); i < attCount; i++) {
                paramRtx.moveToAttribute(i);
                final QName qName = paramRtx.getQNameOfCurrentNode();
                final String mURI = qName.getNamespaceURI();
                atts.addAttribute(mURI, qName.getLocalPart(), NodeWriteTrx.buildName(qName), paramRtx
                    .getTypeOfCurrentNode(), paramRtx.getValueOfCurrentNode());
                paramRtx.moveTo(key);
            }

            // Create SAX events.
            final QName qName = paramRtx.getQNameOfCurrentNode();
            mContHandler.startElement(qName.getNamespaceURI(), qName.getLocalPart(), NodeWriteTrx
                .buildName(qName), atts);

            // Empty elements.
            if (!((ElementNode)paramRtx.getNode()).hasFirstChild()) {
                mContHandler.endElement(qName.getNamespaceURI(), qName.getLocalPart(), NodeWriteTrx
                    .buildName(qName));
            }
        } catch (final SAXException exc) {
            exc.printStackTrace();
        }
    }
970045
public void appendXMLToContentEntry(final XMLUtil util,
                                        final Appendable appendable) throws IOException {
        this.appendPreamble(util, appendable);
        this.appendRows(util, appendable);
        this.appendPostamble(appendable);
    }
1209071
public void appendXMLToMasterStyle(final XMLUtil util, final Appendable appendable)
            throws IOException {
        appendable.append("<style:master-page");
        util.appendEAttribute(appendable, "style:name", this.name);
        util.appendEAttribute(appendable, "style:page-layout-name", this.layoutName);
        appendable.append("><style:header>");
        this.header.appendXMLToMasterStyle(util, appendable);
        appendable.append("</style:header>");
        appendable.append("<style:header-left");
        util.appendAttribute(appendable, "style:display", false);
        appendable.append("/>");
        appendable.append("<style:footer>");
        this.footer.appendXMLToMasterStyle(util, appendable);
        appendable.append("</style:footer>");
        appendable.append("<style:footer-left");
        util.appendAttribute(appendable, "style:display", false);
        appendable.append("/>");
        appendable.append("</style:master-page>");
    }
106447
public void generateProfile() {
        File directory = new File(arglist.get(0));
        String lang = arglist.get(1);
        File file = searchFile(directory, lang + "wiki-.*-abstract\\.xml.*");
        if (file == null) {
            System.err.println("Not Found text file : lang = " + lang);
            return;
        }

        try(FileOutputStream outputStream = new FileOutputStream(new File(lang))) {
            LangProfile profile = GenProfile.load(lang, file);
            profile.omitLessFreq();
            new LangProfileWriter().write(profile, outputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
1293750
public StrBuilder appendAll(final Iterator<?> it) {
        if (it != null) {
            while (it.hasNext()) {
                append(it.next());
            }
        }
        return this;
    }
891051
@SuppressWarnings("checkstyle:all")
	protected void generateEcoreDocumentationBuilderImpl() {
		final TypeReference builder = getEcoreDocumentationBuilderImpl();
		StringConcatenationClient content = new StringConcatenationClient() {
			@SuppressWarnings("synthetic-access")
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Build a documentation string."); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("public class "); //$NON-NLS-1$
				it.append(builder.getSimpleName());
				it.append(" implements "); //$NON-NLS-1$
				it.append(getIEcoreDocumentationBuilder());
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate "); //$NON-NLS-1$
				it.append(AbstractRule.class);
				it.append(" mlRule;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate "); //$NON-NLS-1$
				it.append(AbstractRule.class);
				it.append(" slRule;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate String mlStartSymbols;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate String mlEndTagSymbols;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate String slStartSymbols;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Inject.class);
				it.newLine();
				it.append("\tprivate "); //$NON-NLS-1$
				it.append(getIDocumentationFormatter());
				it.append(" documentationFormatter;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Inject.class);
				it.newLine();
				it.append("\tpublic void setGrammarAccess("); //$NON-NLS-1$
				it.append(DocumentationBuilderFragment.this.grammarAccessExtensions.getGrammarAccess(getGrammar()));
				it.append(" access) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tthis.mlRule = access.getML_COMMENTRule();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tthis.slRule = access.getSL_COMMENTRule();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfor ("); //$NON-NLS-1$
				it.append(AbstractElement.class);
				it.append(" element : (("); //$NON-NLS-1$
				it.append(Group.class);
				it.append(") this.mlRule.getAlternatives()).getElements()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (element instanceof "); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(" && "); //$NON-NLS-1$
				it.append(Strings.class);
				it.append(".isEmpty(this.mlStartSymbols)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthis.mlStartSymbols = (("); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(") element).getValue();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} else if (element instanceof "); //$NON-NLS-1$
				it.append(UntilToken.class);
				it.append(" && "); //$NON-NLS-1$
				it.append(Strings.class);
				it.append(".isEmpty(this.mlEndTagSymbols)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthis.mlEndTagSymbols = (("); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(") (("); //$NON-NLS-1$
				it.append(UntilToken.class);
				it.append(") element).getTerminal()).getValue();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t"); //$NON-NLS-1$
				it.append(AbstractRule.class);
				it.append(" slRule = access.getSL_COMMENTRule();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfor ("); //$NON-NLS-1$
				it.append(AbstractElement.class);
				it.append(" element : (("); //$NON-NLS-1$
				it.append(Group.class);
				it.append(") slRule.getAlternatives()).getElements()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (element instanceof "); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(") {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthis.slStartSymbols = (("); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(") element).getValue().trim();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tbreak;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic "); //$NON-NLS-1$
				it.append(AbstractRule.class);
				it.append(" getMLCommentRule() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn this.mlRule;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic "); //$NON-NLS-1$
				it.append(AbstractRule.class);
				it.append(" getSLCommentRule() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn this.slRule;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic "); //$NON-NLS-1$
				it.append(getIDocumentationFormatter());
				it.append(" getDocumentationFormatter() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn this.documentationFormatter;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic boolean isMultilineCommentFor(Class<?> type) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn "); //$NON-NLS-1$
				Set<String> multilineCommentedTypes = getCodeBuilderConfig().getMultilineCommentedTypes();
				if (multilineCommentedTypes.isEmpty()) {
					it.append("false"); //$NON-NLS-1$
				} else {
					boolean firstTest = true;
					for (String typeName : multilineCommentedTypes) {
						if (firstTest) {
							firstTest = false;
						} else {
							it.newLine();
							it.append("\t\t\t\t|| "); //$NON-NLS-1$
						}
						TypeReference reference = new TypeReference(typeName);
						it.append(reference);
						it.append(".class.isAssignableFrom(type)"); //$NON-NLS-1$
					}
				}
				it.append(";"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String build(String doc, Class<?> objectType) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tString givenDocumentation = "); //$NON-NLS-1$
				it.append(Strings.class);
				it.append(".emptyIfNull(doc).trim();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tStringBuilder documentation = new StringBuilder();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t"); //$NON-NLS-1$
				it.append(getIDocumentationFormatter());
				it.append(" formatter = getDocumentationFormatter();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (isMultilineCommentFor(objectType)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (!givenDocumentation.startsWith(this.mlStartSymbols)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tdocumentation.append(this.mlStartSymbols);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tdocumentation.append(givenDocumentation);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (!givenDocumentation.endsWith(this.mlEndTagSymbols)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tdocumentation.append(this.mlEndTagSymbols);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn formatter.formatMultilineComment(documentation.toString());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tdocumentation.append(\"\\n\");"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (!givenDocumentation.startsWith(this.slStartSymbols)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tdocumentation.append(this.slStartSymbols);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tdocumentation.append(givenDocumentation);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (!givenDocumentation.isEmpty() && !isNewLine(givenDocumentation.charAt(givenDocumentation.length() - 1))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tdocumentation.append(\"\\n\");"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn formatter.formatSinglelineComment(documentation.toString());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate static boolean isNewLine(char character) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (character == '\\n' || character == '\\r' || character == '\\f') {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn ((((1 << "); //$NON-NLS-1$
				it.append(Character.class);
				it.append(".LINE_SEPARATOR)"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t| (1 << "); //$NON-NLS-1$
				it.append(Character.class);
				it.append(".PARAGRAPH_SEPARATOR)) >> "); //$NON-NLS-1$
				it.append(Character.class);
				it.append(".getType((int) character)) & 1) != 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}

		};
		JavaFileAccess createJavaFile = getFileAccessFactory().createJavaFile(builder, content);
		createJavaFile.writeTo(getSrcGen());
	}
170329
protected void generatePythonSetup(IStyleAppendable it, String basename) {
		it.appendNl("# -*- coding: {0} -*-", getCodeConfig().getEncoding().toLowerCase()); //$NON-NLS-1$
		it.appendHeader();
		it.newLine();
		it.append("from setuptools import setup"); //$NON-NLS-1$
		it.newLine().newLine();
		it.append("setup ("); //$NON-NLS-1$
		it.increaseIndentation().newLine();
		it.append("name='").append(basename).append("lexer',"); //$NON-NLS-1$ //$NON-NLS-2$
		it.newLine();
		it.append("version='").append(getLanguageVersion()).append("',"); //$NON-NLS-1$ //$NON-NLS-2$
		it.newLine();
		it.append("packages=['").append(basename).append("lexer'],"); //$NON-NLS-1$ //$NON-NLS-2$
		it.newLine();
		it.append("entry_points ="); //$NON-NLS-1$
		it.newLine();
		it.append("\"\"\""); //$NON-NLS-1$
		it.newLine();
		it.append("[pygments.lexers]"); //$NON-NLS-1$
		it.newLine();
		it.append("sarllexer = ").append(basename).append("lexer.").append(basename); //$NON-NLS-1$ //$NON-NLS-2$
		it.append(":SarlLexer"); //$NON-NLS-1$
		it.newLine();
		it.append("\"\"\","); //$NON-NLS-1$
		it.decreaseIndentation().newLine();
		it.append(")"); //$NON-NLS-1$
		it.newLine();
	}
619723
protected void _generate(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
		generateEnumerationDeclaration(enumeration, it, context);
	}
1359978
void generate(T input) throws SourceFileGenerationException {
    ClassName generatedTypeName = nameGeneratedType(input);
    try {
      Optional<TypeSpec.Builder> type = write(generatedTypeName, input);
      if (!type.isPresent()) {
        return;
      }
      buildJavaFile(generatedTypeName, type.get()).writeTo(filer);
    } catch (Exception e) {
      // if the code above threw a SFGE, use that
      Throwables.propagateIfPossible(e, SourceFileGenerationException.class);
      // otherwise, throw a new one
      throw new SourceFileGenerationException(
          Optional.<ClassName>absent(), e, getElementForErrorReporting(input));
    }
  }