Create a reverse Polish notation form of the equation

@param oldTokens a {@link java.util.Collection} object.
@return a {@link java.util.Collection} object.
322001
protected List<EquPart> rpnize(final List<EquPart> oldTokens)
    {
        final List<EquPart> _rpn = new Stack<>();
        final Stack<EquPart> ops = new Stack<>();
        Operation leftOp;
        Operation rightOp;

        for (final EquPart token : oldTokens)
            if (token instanceof Token)
                _rpn.add(token);
            else
            {
                rightOp = (Operation) token;

                if (ops.empty())
                {

                    if (rightOp.includeInRpn())
                        ops.push(rightOp);
                } else
                {
                    leftOp = (Operation) ops.peek();

                    if (leftOp.preceeds(rightOp))
                    {
                        _rpn.add(ops.pop());

                        /*
                         * while knocking one off scan back as long as the level
                         * doesn't change. A left paren causes the level to
                         * increase and the left paren has that new level. A
                         * right paren causes the level to decrease and has this
                         * new lesser level. So the right paren is one level
                         * less than the operators within the parens. Since we
                         * want to only scan those operators we have to adjust
                         * for the level that they are.
                         */
                        int level = rightOp.getLevel();
                        if (rightOp instanceof OpRightParen)
                            level = level + 1;

                        Operation compareOp = rightOp;
                        while (!ops.empty())
                        {
                            leftOp = (Operation) ops.peek();
                            if (leftOp.getLevel() < level)
                                break;
                            if (leftOp.preceeds(compareOp))
                            {
                                _rpn.add(ops.pop());
                                compareOp = leftOp;
                            } else
                                break;
                            break;
                        }
                    }

                    if (rightOp.includeInRpn())
                        ops.push(rightOp);
                }
            }

        while (!ops.empty())
            _rpn.add(ops.pop());

        return _rpn;
    }
129898
private String createSpan(final String[] tokens, final int from,
      final int to) {
    String tokenSpan = "";
    for (int i = from; i < to; i++) {
      tokenSpan += tokens[i] + " ";
    }
    tokenSpan += tokens[to];
    return tokenSpan;
  }
779497
protected JsonNode formAndSignRequestJson(Map<String, String> params) {
    CoinbeneUtils.signParams(params);
    return toJson(params);
  }
60439
public final Span[] seqToSpans(final String[] tokens) {
    final Span[] annotatedText = this.sequenceLabeler.tag(tokens);
    final List<Span> probSpans = new ArrayList<Span>(
        Arrays.asList(annotatedText));
    return probSpans.toArray(new Span[probSpans.size()]);
  }
297259
private Token token(Token prev) {
    if (curChar == EOF) {
      return null;
    }
    if (curChar == '{') {
      char nextChar = lookahead();
      if (nextChar == '{') {
        return leftCurlyBracket(prev);
      } else if (nextChar >= 'a' && nextChar <= 'z') {
        return key(prev);
      } else {
        throw new IllegalArgumentException(
            "Unexpected first character '" + nextChar + "'; must be lower case a-z.");
      }
    }
    return text(prev);
  }
590633
function make_regex(tokens) {
	var str = tokens.reduce(function (res, token, index) {
			var is_last = (index == (tokens.length - 1));
			var before_multi = (index === (tokens.length - 2)) && (last(tokens).type == "multi");
			return res + ((is_last || before_multi) ? token.last : token.piece);
		},
		"");
	return new RegExp("^" + str + "$");
}
1079926
public static byte[] copyCredToken(byte[] credToken) {

        if (credToken == null) {
            return null;
        }

        final int LEN = credToken.length;
        if (LEN == 0) {
            return new byte[LEN];
        }

        byte[] newCredToken = new byte[LEN];
        System.arraycopy(credToken, 0, newCredToken, 0, LEN);

        return newCredToken;
    }
306132
public final List<Morpheme> getMorphemes(final String[] tokens) {
    final List<String> origPosTags = posAnnotate(tokens);
    final List<Morpheme> morphemes = getMorphemesFromStrings(origPosTags,
        tokens);
    return morphemes;
  }
54699
public final List<Morpheme> getMorphemesFromStrings(
      final List<String> posTags, final String[] tokens) {
    final List<Morpheme> morphemes = new ArrayList<Morpheme>();
    for (int i = 0; i < posTags.size(); i++) {
      final String word = tokens[i];
      final String tag = posTags.get(i);
      final Morpheme morpheme = this.morphoFactory.createMorpheme(word, tag);
      morphemes.add(morpheme);
    }
    return morphemes;
  }
1147907
@Override
    public Token createToken(Map<String, Object> tokenData) throws TokenCreationFailedException {
        TokenFactory tokenFactory = ltpaConfig.getTokenFactory();
        return tokenFactory.createToken(tokenData);
    }
1158046
public static String[] getTypesFromSpans(final Span[] spans,
      final String[] tokens) {
    final List<String> tagsList = new ArrayList<String>();
    for (final Span span : spans) {
      tagsList.add(span.getType());
    }
    return tagsList.toArray(new String[tagsList.size()]);
  }
409989
protected <T extends TokenBase> List<T> createTokenList(String text) {

        if (!split) {
            return createTokenList(0, text);
        }

        List<Integer> splitPositions = getSplitPositions(text);

        if (splitPositions.isEmpty()) {
            return createTokenList(0, text);
        }

        ArrayList<T> result = new ArrayList<>();

        int offset = 0;

        for (int position : splitPositions) {
            result.addAll(this.<T>createTokenList(offset, text.substring(offset, position + 1)));
            offset = position + 1;
        }

        if (offset < text.length()) {
            result.addAll(this.<T>createTokenList(offset, text.substring(offset)));
        }

        return result;
    }
1090544
@Deprecated
  public List<SToken> getToken()
  {
    if(this.cachedToken == null)
    {
      this.cachedToken = getSResult().getDocumentGraph().getSortedTokenByText();
    }
    return this.cachedToken;
  }
147560
function normalizeTokens(relative, tokens) {
    var _index = 0;

    // Force as an array
    if (!_.isArray(tokens)) tokens = [tokens];

    return _.map(tokens, function(subtoken) {
        if (_.isNull(subtoken)) return null;
        if (_.isString(subtoken)) {
            subtoken = {
                value: subtoken,
                index: _index,
                offset: subtoken.length
            };
        }

        if (_.isObject(subtoken)) {
            subtoken.index = subtoken.index || 0;
            _index = _index + subtoken.index + subtoken.offset;

            // Transform as an absolute token
            subtoken.index = relative.index + subtoken.index;
            subtoken.offset = subtoken.offset || subtoken.value.length;
        }

        return subtoken;
    });
}
1255203
private static String nextToken(String[] tokens, int x, String context)
            throws ParseException {
        if (x < tokens.length) {
            return tokens[x];
        }
        throw new ParseException("missing token at end of '" + context + "'", -1);
    }
681805
private Node parseContextTypeExpression(JsDocToken token) {
    if (token == JsDocToken.QMARK) {
      return newNode(Token.QMARK);
    } else {
      return parseBasicTypeExpression(token);
    }
  }
525303
public static String detokenize(List<String> tokens) {
    return TwitterKoreanProcessor.detokenize(JavaConversions.iterableAsScalaIterable(tokens));
  }