protected CommonExpression readElement(final CommonExpression leftExpression) throws ExpressionParserException, ExpressionParserInternalError { return readElement(leftExpression, null); }
/** * Reads the content between parenthesis. Its is expected that the current token is of kind * {@link TokenKind#OPENPAREN} because it MUST be check in the calling method ( when read the method name and the '(' * is read). * @return An expression which reflects the content within the parenthesis * @throws ExpressionParserException * While reading the elements in the parenthesis an error occurred * @throws TokenizerMessage * The next token did not match the expected token */ protected CommonExpression readParenthesis() throws ExpressionParserException, ExpressionParserInternalError { // The existing of a '(' is verified BEFORE this method is called --> so it's a internal error Token openParenthesis = tokenList.expectToken(TokenKind.OPENPAREN, true); CommonExpression firstExpression = readElement(null); CommonExpression parenthesisExpression = readElements(firstExpression, 0); // check for ')' try { tokenList.expectToken(TokenKind.CLOSEPAREN); // TokenizerMessage } catch (TokenizerExpectError e) { // Internal parsing error, even if there are no more token (then there should be a different exception). // Tested with TestParserExceptions.TestPMreadParenthesis throw FilterParserExceptionImpl.createMISSING_CLOSING_PARENTHESIS(openParenthesis.getPosition(), curExpression, e); } return parenthesisExpression; }
/** * Reads the content between parenthesis. Its is expected that the current token is of kind * {@link TokenKind#OPENPAREN} because it MUST be check in the calling method ( when read the method name and the '(' * is read). * @return An expression which reflects the content within the parenthesis * @throws ExpressionParserException * While reading the elements in the parenthesis an error occurred * @throws TokenizerMessage * The next token did not match the expected token */ protected CommonExpression readParenthesis() throws ExpressionParserException, ExpressionParserInternalError { // The existing of a '(' is verified BEFORE this method is called --> so it's a internal error Token openParenthesis = tokenList.expectToken(TokenKind.OPENPAREN, true); CommonExpression firstExpression = readElement(null); CommonExpression parenthesisExpression = readElements(firstExpression, 0); // check for ')' try { tokenList.expectToken(TokenKind.CLOSEPAREN); // TokenizerMessage } catch (TokenizerExpectError e) { // Internal parsing error, even if there are no more token (then there should be a different exception). // Tested with TestParserExceptions.TestPMreadParenthesis throw FilterParserExceptionImpl.createMISSING_CLOSING_PHARENTHESIS(openParenthesis.getPosition(), curExpression, e); } return parenthesisExpression; }
protected CommonExpression readElement(final CommonExpression leftExpression) throws ExpressionParserException, ExpressionParserInternalError { return readElement(leftExpression, null); }
/** * Reads the content between parenthesis. Its is expected that the current token is of kind * {@link TokenKind#OPENPAREN} because it MUST be check in the calling method ( when read the method name and the '(' * is read). * @return An expression which reflects the content within the parenthesis * @throws ExpressionParserException * While reading the elements in the parenthesis an error occurred * @throws TokenizerMessage * The next token did not match the expected token */ protected CommonExpression readParenthesis() throws ExpressionParserException, ExpressionParserInternalError { // The existing of a '(' is verified BEFORE this method is called --> so it's a internal error Token openParenthesis = tokenList.expectToken(TokenKind.OPENPAREN, true); CommonExpression firstExpression = readElement(null); CommonExpression parenthesisExpression = readElements(firstExpression, 0); // check for ')' try { tokenList.expectToken(TokenKind.CLOSEPAREN); // TokenizerMessage } catch (TokenizerExpectError e) { // Internal parsing error, even if there are no more token (then there should be a different exception). // Tested with TestParserExceptions.TestPMreadParenthesis throw FilterParserExceptionImpl.createMISSING_CLOSING_PARENTHESIS(openParenthesis.getPosition(), curExpression, e); } return parenthesisExpression; }
protected CommonExpression readElement(final CommonExpression leftExpression) throws ExpressionParserException, ExpressionParserInternalError { return readElement(leftExpression, null); }
CommonExpression nodeLeft = readElement(null); node = readElements(nodeLeft, 0); } catch (ExpressionParserException filterParserException) {
protected CommonExpression readUnaryoperator(final Token lookToken, final InfoUnaryOperator unaryOperator) throws ExpressionParserException, ExpressionParserInternalError { tokenList.expectToken(lookToken.getUriLiteral(), true); CommonExpression operand = readElement(null); UnaryExpression unaryExpression = new UnaryExpressionImpl(unaryOperator, operand); validateUnaryOperatorTypes(unaryExpression); // throws ExpressionInvalidOperatorTypeException return unaryExpression; }
CommonExpression nodeLeft = readElement(null); node = readElements(nodeLeft, 0); } catch (ExpressionParserException filterParserException) {
protected CommonExpression readUnaryoperator(final Token lookToken, final InfoUnaryOperator unaryOperator) throws ExpressionParserException, ExpressionParserInternalError { tokenList.expectToken(lookToken.getUriLiteral(), true); CommonExpression operand = readElement(null); UnaryExpression unaryExpression = new UnaryExpressionImpl(unaryOperator, operand); validateUnaryOperatorTypes(unaryExpression); // throws ExpressionInvalidOperatorTypeException return unaryExpression; }
CommonExpression nodeLeft = readElement(null); node = readElements(nodeLeft, 0); } catch (ExpressionParserException filterParserException) {
protected CommonExpression readUnaryoperator(final Token lookToken, final InfoUnaryOperator unaryOperator) throws ExpressionParserException, ExpressionParserInternalError { tokenList.expectToken(lookToken.getUriLiteral(), true); CommonExpression operand = readElement(null); UnaryExpression unaryExpression = new UnaryExpressionImpl(unaryOperator, operand); validateUnaryOperatorTypes(unaryExpression); // throws ExpressionInvalidOperatorTypeException return unaryExpression; }
.lookPrevToken(), curExpression); expression = readElement(null); if (expression != null) { expression = readElements(expression, 0);
.lookPrevToken(), curExpression); expression = readElement(null); if (expression != null) { expression = readElements(expression, 0);
.lookPrevToken(), curExpression); expression = readElement(null); if (expression != null) { expression = readElements(expression, 0);
rightNode = readElement(leftNode, operator); // throws FilterParserException, FilterParserInternalError if (rightNode == null) {
rightNode = readElement(leftNode, operator); // throws FilterParserException, FilterParserInternalError if (rightNode == null) {
rightNode = readElement(leftNode, operator); // throws FilterParserException, FilterParserInternalError if (rightNode == null) {