public boolean hasStringAt(final int pos) { return this.size() > pos && this.get(pos).isInput(); }
public boolean hasExpressionAt(final int pos) { return this.size() > pos && this.get(pos).isExpression(); }
final String input = state.get(nodeIndex).getInput();
final String input = state.get(nodeIndex).getInput();
final String input = state.get(nodeIndex).getInput();
final String input = state.get(nodeIndex).getInput();
final String input = state.get(nodeIndex).getInput();
final String input = state.get(nodeIndex).getInput();
final String input = state.get(nodeIndex).getInput();
static Expression parse(final String input) { Validate.notNull(input, "Input cannot be null"); /* * PHASE 01: Decomposition (including unnesting parenthesis) */ final ExpressionParsingState decomposition = ExpressionParsingUtil.decompose(input); if (decomposition == null) { return null; } /* * PHASE 02: Composition */ final ExpressionParsingState result = ExpressionParsingUtil.compose(decomposition); if (result == null || !result.hasExpressionAt(0)) { return null; } return result.get(0).getExpression(); }
static Expression parseAndCompose(final ExpressionParsingState state, final String parseTarget) { /* * Takes a String (probably a substring of a parsing node), checks whether it is a reference to * another node or not and, if not, performs a composition operation on it. Then just composes * the target. */ int index = parseAsSimpleIndexPlaceholder(parseTarget); if (index == -1) { // parseTarget is not a mere index placeholder, so add it and compose it index = state.size(); state.addNode(parseTarget); } if (compose(state, index) == null || !state.hasExpressionAt(index)) { return null; } return state.get(index).getExpression(); }
final String input = state.get(nodeIndex).getInput();
public boolean hasStringAt(final int pos) { return this.size() > pos && this.get(pos).isInput(); }
public boolean hasExpressionAt(final int pos) { return this.size() > pos && this.get(pos).isExpression(); }
final String input = state.get(nodeIndex).getInput();
static Expression parse(final String input) { Validate.notNull(input, "Input cannot be null"); /* * PHASE 01: Decomposition (including unnesting parenthesis) */ final ExpressionParsingState decomposition = ExpressionParsingUtil.decompose(input, ExpressionParsingDecompositionConfig.DECOMPOSE_ALL_AND_UNNEST); if (decomposition == null) { return null; } /* * PHASE 02: Composition */ final ExpressionParsingState result = ExpressionParsingUtil.compose(decomposition); if (result == null || !result.hasExpressionAt(0)) { return null; } return result.get(0).getExpression(); }
static Expression parseAndCompose(final ExpressionParsingState state, final String parseTarget) { /* * Takes a String (probably a substring of a parsing node), checks whether it is a reference to * another node or not and, if not, performs a composition operation on it. Then just composes * the target. */ int index = parseAsSimpleIndexPlaceholder(parseTarget); if (index == -1) { // parseTarget is not a mere index placeholder, so add it and compose it index = state.size(); state.addNode(parseTarget); } if (compose(state, index) == null || !state.hasExpressionAt(index)) { return null; } return state.get(index).getExpression(); }