This method generates a new construction identifier for an automatically
generated BNF production for optionals, optional lists and lists.

@param productionPart
@param suffix
@return
@throws TreeException
547064
private String createNewIdentifier(ParseTreeNode productionPart, String suffix)
	    throws TreeException {
	String identifier = "";
	if (productionPart.hasChild("IDENTIFIER")) {
	    identifier = productionPart.getChild("IDENTIFIER").getText();
	} else if (productionPart.hasChild("STRING_LITERAL")) {
	    identifier = productionPart.getChild("STRING_LITERAL").getText();
	}
	return createIdentifierName(identifier, suffix);
    }
305415
@Override
	public void generateSpecializedPart(SQLiteModelMethod method, TypeSpec.Builder classBuilder, MethodSpec.Builder methodBuilder, Set<JQLProjection> fieldList, boolean mapFields) {
		//LiteralType listenerType=LiteralType.of(OnReadCursorListener.class);
		ClassName listenerType=ClassName.get(OnReadCursorListener.class);
		
		int counter = SqlBuilderHelper.countParameterOfType(method, listenerType);
		if (counter == 0) {
			// non listener found
			throw (new InvalidMethodSignException(method, "there is no parameter of type \"ReadCursorListener\""));
		}
		if (counter > 1) {
			// more than one listener found
			throw (new InvalidMethodSignException(method, "there are more than one parameter of type \"ReadCursorListener\""));
		}

		String listenerName = SqlSelectBuilder.getNameParameterOfType(method, listenerType);

		methodBuilder.addCode("\n");
		methodBuilder.beginControlFlow("if (_cursor.moveToFirst())");

		// generate index from columns
		methodBuilder.addCode("\n");

		methodBuilder.beginControlFlow("do\n");
		methodBuilder.addCode("$L.onRead(_cursor);\n", listenerName);
		methodBuilder.endControlFlow("while (_cursor.moveToNext())");

		// close cursor
		methodBuilder.endControlFlow();
		methodBuilder.endControlFlow();

	}
511139
void insert(Suffix<T, S> suffix, ActivePoint<T, S> activePoint) {
        Object item = suffix.getEndItem();
        Object nextItem = getItemAt(activePoint.getLength());
        if (item.equals(nextItem)) {
            activePoint.incrementLength();
        } else {
            split(suffix, activePoint);
            suffix.decrement();
            activePoint.updateAfterInsert(suffix);

            if (suffix.isEmpty()) {
            }
            else
                tree.insert(suffix);
        }
    }
587041
private String createExpressionKey(String suffix) {
		String[] parts = suffix.split("_");
		StringBuilder ret = new StringBuilder("[if ");
		boolean ieAdded = false;
		for (String part : parts) {
			if ("".equals(part)) {
				continue;
			}
			if ("ie".equals(part)) {
				break;
			} else if (Pattern.matches("(lt|lte|gt|gte)", part)) {
				ret.append(part).append(" ");
			} else {
				ret.append("IE ").append(part);
				ieAdded = true;
			}
		}
		if (!ieAdded)
			ret.append("IE");
		ret.append("]");
		return ret.toString();
	}
927001
public static void generate(ConfigurationImpl configuration,
                                IndexBuilder indexbuilder) {
        AllClassesFrameWriter allclassgen;
        DocPath filename = DocPaths.ALLCLASSES_FRAME;
        try {
            allclassgen = new AllClassesFrameWriter(configuration,
                                                    filename, indexbuilder);
            allclassgen.buildAllClassesFile(true);
            allclassgen.close();
            filename = DocPaths.ALLCLASSES_NOFRAME;
            allclassgen = new AllClassesFrameWriter(configuration,
                                                    filename, indexbuilder);
            allclassgen.buildAllClassesFile(false);
            allclassgen.close();
        } catch (IOException exc) {
            configuration.standardmessage.
                     error("doclet.exception_encountered",
                           exc.toString(), filename);
            throw new DocletAbortException(exc);
        }
    }
551237
def add_suffix (self, specified_name, file_type, prop_set):
        
        assert isinstance(specified_name, basestring)
        assert isinstance(file_type, basestring)
        assert isinstance(prop_set, property_set.PropertySet)
        suffix = b2.build.type.generated_target_suffix (file_type, prop_set)

        if suffix:
            return specified_name + '.' + suffix

        else:
            return specified_name
403481
private void fixActiveEdgeAfterSuffixLink(Suffix<T, S> suffix) {
        while (activeEdge != null && activeLength > activeEdge.getLength()) {
            activeLength = activeLength - activeEdge.getLength();
            activeNode = activeEdge.getTerminal();
            Object item = suffix.getItemXFromEnd(activeLength + 1);
            activeEdge = activeNode.getEdgeStarting(item);
        }
        resetActivePointToTerminal();
    }
284850
protected Set<String> configureContentTypeSuffixes(ContentTypeEngines engines) {
        if (null == ClassUtil.getAnnotation(method, ContentTypeBySuffix.class)) {
            return Collections.emptySet();
        }

        Set<String> suffixes = new TreeSet<>();
        for (String suffix : engines.getContentTypeSuffixes()) {
            String contentType = engines.getContentTypeEngine(suffix).getContentType();
            if (declaredProduces.contains(contentType)) {
                suffixes.add(suffix);
            }
        }
        return suffixes;
    }
1107607
private static void qualifiedNameFix(
      final SuggestedFix.Builder fix, final Symbol owner, VisitorState state) {
    fix.addImport(owner.getQualifiedName().toString());
    final JCCompilationUnit unit = (JCCompilationUnit) state.getPath().getCompilationUnit();
    new TreePathScanner<Void, Void>() {
      @Override
      public Void visitIdentifier(IdentifierTree tree, Void unused) {
        Symbol sym = ASTHelpers.getSymbol(tree);
        if (sym == null) {
          return null;
        }
        Tree parent = getCurrentPath().getParentPath().getLeaf();
        if (parent.getKind() == Tree.Kind.CASE
            && ((CaseTree) parent).getExpression().equals(tree)
            && sym.owner.getKind() == ElementKind.ENUM) {
          // switch cases can refer to enum constants by simple name without importing them
          return null;
        }
        if (sym.owner.equals(owner) && unit.starImportScope.includes(sym)) {
          fix.prefixWith(tree, owner.getSimpleName() + ".");
        }
        return null;
      }
    }.scan(unit, null);
  }
1168363
public String assembleId(String id, String... suffixes) {
		StringBuilder sb = new StringBuilder();
		if (null != id) {
			sb.append(id);
		}
		for (String s : suffixes) {
			sb.append(Dom.ID_SEPARATOR);
			sb.append(s);
		}
		return sb.toString();
	}
76202
def register_new_suffix_tree(self, case_insensitive=False):
        
        suffix_tree = register_new_suffix_tree(case_insensitive=case_insensitive)
        suffix_tree._node_repo = self.node_repo
        suffix_tree._node_child_collection_repo = self.node_child_collection_repo
        suffix_tree._edge_repo = self.edge_repo
        suffix_tree._stringid_collection_repo = self.stringid_collection_repo
        return suffix_tree
624974
private Expression toExpression(Part part, ExpressionList<?> root) {
        return new ExpressionBuilder(part, root).build();
    }
600805
private static String fullQualifiedName(Tree tree) {
		if (tree.is(Tree.Kind.IDENTIFIER)) {
			return ((IdentifierTree) tree).name();
		} else if (tree.is(Tree.Kind.MEMBER_SELECT)) {
			MemberSelectExpressionTree m = (MemberSelectExpressionTree) tree;
			return fullQualifiedName(m.expression()) + "." + m.identifier().name();
		}
		throw new UnsupportedOperationException(String.format("Kind/Class '%s' not supported", tree.getClass()));
	}
1301788
public static SuffixData createWithLCP(CharSequence s, ISuffixArrayBuilder builder) {
        final CharSequenceAdapter adapter = new CharSequenceAdapter(builder);
        final int[] sa = adapter.buildSuffixArray(s);
        final int[] lcp = computeLCP(adapter.input, 0, s.length(), sa);
        return new SuffixData(sa, lcp);
    }
614713
protected static void buildTree(EndpointPart parent, String[] parts, int index, String endpointType) {
        // Check if operation qualifier is part of last element
        String name = parts[index];
        String qualifier = null;

        if (index == parts.length - 1) {
            qualifier = EndpointUtil.decodeEndpointOperation(parts[index], false);
            name = EndpointUtil.decodeEndpointURI(parts[index]);
        }

        // Check if part is defined in the parent
        EndpointPart child = parent.addChild(name);

        if (index < parts.length - 1) {
            buildTree(child, parts, index + 1, endpointType);
        } else {
            // Check if part has an operation qualifier
            if (qualifier != null) {
                child = child.addChild(qualifier);
                child.setQualifier(true);
            }
            child.setEndpointType(endpointType);
        }
    }
874275
protected void generateBuilderFactoryContributions(MemberDescription description) {
		if (description.isTopElement()) {
			return;
		}
		if (description.getStandardContainers().isEmpty() && description.getNoBodyContainers().isEmpty()) {
			return;
		}
		List<String> modifiers = description.getModifiers();
		if (modifiers.size() <= 1) {
			// No need to create a function with the modifier's label in the name.
			modifiers = Collections.singletonList(""); //$NON-NLS-1$
		}
		final boolean enableAppenders = getCodeBuilderConfig().isISourceAppendableEnable();
		for (final String modifier : modifiers) {
			final String createFunctionName = "create" //$NON-NLS-1$
					+ Strings.toFirstUpper(modifier)
					+ Strings.toFirstUpper(description.getElementDescription().getName());

			String container = null;
			if (!description.getStandardContainers().isEmpty()) {
				container = description.getStandardContainers().iterator().next();
			} else {
				container = description.getNoBodyContainers().iterator().next();
			}

			final String createContainerFunctionName = "add" //$NON-NLS-1$
					+ Strings.toFirstUpper(container);
			final TypeReference containerBuilder = description.getContainerDescription().getBuilderInterfaceType();
			this.builderFactoryContributions.addContribution(new StringConcatenationClient() {
				@Override
				protected void appendTo(TargetStringConcatenation it) {
					it.append("\t/** Create the factory for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
							+ description.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @param name the name of the " //$NON-NLS-1$
							+ description.getElementDescription().getName());
					it.newLine();
					it.append("\t * @param resourceSet the set of the resources that must be used for"); //$NON-NLS-1$
					it.newLine();
					it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @return the factory."); //$NON-NLS-1$
					it.newLine();
					it.append("\t */"); //$NON-NLS-1$
					it.newLine();
					it.append("\t@"); //$NON-NLS-1$
					it.append(Pure.class);
					it.newLine();
					it.append("\tpublic "); //$NON-NLS-1$
					it.append(description.getElementDescription().getBuilderInterfaceType());
					it.append(" "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(String name, "); //$NON-NLS-1$
					it.append(ResourceSet.class);
					it.append(" resourceSet) {"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\treturn "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(name, createResource(resourceSet));"); //$NON-NLS-1$
					it.newLine();
					it.append("\t}"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
					it.append("\t/** Create the factory for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
							+ description.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @param name the name of the " //$NON-NLS-1$
							+ description.getElementDescription().getName());
					it.newLine();
					it.append("\t * @param resource the resource that must be used for"); //$NON-NLS-1$
					it.newLine();
					it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @return the factory."); //$NON-NLS-1$
					it.newLine();
					it.append("\t */"); //$NON-NLS-1$
					it.newLine();
					it.append("\t@"); //$NON-NLS-1$
					it.append(Pure.class);
					it.newLine();
					it.append("\tpublic "); //$NON-NLS-1$
					it.append(description.getElementDescription().getBuilderInterfaceType());
					it.append(" "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(String name, "); //$NON-NLS-1$
					it.append(Resource.class);
					it.append(" resource) {"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\t"); //$NON-NLS-1$
					it.append(getScriptBuilderInterface());
					it.append(" scriptBuilder = createScript(getFooPackageName(), resource);"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\t"); //$NON-NLS-1$
					it.append(containerBuilder);
					it.append(" containerBuilder = scriptBuilder."); //$NON-NLS-1$
					it.append(createContainerFunctionName);
					it.append("(getFooTypeName());"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\treturn containerBuilder.add"); //$NON-NLS-1$
					it.append(Strings.toFirstUpper(modifier));
					it.append(Strings.toFirstUpper(description.getElementDescription().getName()));
					it.append("(name);"); //$NON-NLS-1$
					it.newLine();
					it.append("\t}"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
				}
			});
			if (enableAppenders) {
				final String buildFunctionName = "build" //$NON-NLS-1$
						+ Strings.toFirstUpper(modifier)
						+ Strings.toFirstUpper(description.getElementDescription().getName());
				final TypeReference appender = getCodeElementExtractor().getElementAppenderImpl(
						description.getElementDescription().getName());
				this.builderFactoryContributions.addContribution(new StringConcatenationClient() {
					@Override
					protected void appendTo(TargetStringConcatenation it) {
						it.append("\t/** Create the appender for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
								+ description.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @param name the name of the " //$NON-NLS-1$
								+ description.getElementDescription().getName());
						it.newLine();
						it.append("\t * @param resourceSet the set of the resources that must be used for"); //$NON-NLS-1$
						it.newLine();
						it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @return the appender."); //$NON-NLS-1$
						it.newLine();
						it.append("\t */"); //$NON-NLS-1$
						it.newLine();
						it.append("\t@"); //$NON-NLS-1$
						it.append(Pure.class);
						it.newLine();
						it.append("\tpublic "); //$NON-NLS-1$
						it.append(appender);
						it.append(" "); //$NON-NLS-1$
						it.append(buildFunctionName);
						it.append("(String name, "); //$NON-NLS-1$
						it.append(ResourceSet.class);
						it.append(" resourceSet) {"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\t"); //$NON-NLS-1$
						it.append(appender);
						it.append(" a = new "); //$NON-NLS-1$
						it.append(appender);
						it.append("("); //$NON-NLS-1$
						it.append(createFunctionName);
						it.append("(name, resourceSet));"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\tgetInjector().injectMembers(a);"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\treturn a;"); //$NON-NLS-1$
						it.newLine();
						it.append("\t}"); //$NON-NLS-1$
						it.newLineIfNotEmpty();
						it.newLine();
						it.append("\t/** Create the appender for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
								+ description.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @param name the name of the " //$NON-NLS-1$
								+ description.getElementDescription().getName());
						it.newLine();
						it.append("\t * @param resource the resource that must be used for"); //$NON-NLS-1$
						it.newLine();
						it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @return the appender."); //$NON-NLS-1$
						it.newLine();
						it.append("\t */"); //$NON-NLS-1$
						it.newLine();
						it.append("\t@"); //$NON-NLS-1$
						it.append(Pure.class);
						it.newLine();
						it.append("\tpublic "); //$NON-NLS-1$
						it.append(appender);
						it.append(" "); //$NON-NLS-1$
						it.append(buildFunctionName);
						it.append("(String name, "); //$NON-NLS-1$
						it.append(Resource.class);
						it.append(" resource) {"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\t"); //$NON-NLS-1$
						it.append(appender);
						it.append(" a = new "); //$NON-NLS-1$
						it.append(appender);
						it.append("("); //$NON-NLS-1$
						it.append(createFunctionName);
						it.append("(name, resource));"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\tgetInjector().injectMembers(a);"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\treturn a;"); //$NON-NLS-1$
						it.newLine();
						it.append("\t}"); //$NON-NLS-1$
						it.newLineIfNotEmpty();
						it.newLine();
					}
				});
			}
		}
	}
391694
public MultipartBuilder addPart(NetworkRequest part) {
        if (part == null) {
            throw new NullPointerException("part == null");
        }
        parts.add(part);
        return this;
    }