Package org.apache.camel.language.simple.ast

Examples of org.apache.camel.language.simple.ast.UnaryExpression


        }

        // okay we are not inside a function or quote, so we want to support operators
        // and the special null value as well
        if (token.getType().isUnary()) {
            return new UnaryExpression(token);
        } else if (token.getType().isBinary()) {
            return new BinaryExpression(token);
        } else if (token.getType().isLogical()) {
            return new LogicalExpression(token);
        } else if (token.getType().isNullValue()) {
View Full Code Here


        }

        // okay we are not inside a function or quote, so we want to support operators
        // and the special null value as well
        if (token.getType().isUnary()) {
            return new UnaryExpression(token);
        } else if (token.getType().isBinary()) {
            return new BinaryExpression(token);
        } else if (token.getType().isLogical()) {
            return new LogicalExpression(token);
        } else if (token.getType().isNullValue()) {
View Full Code Here

        if (token.getType().isFunctionStart()) {
            return new SimpleFunctionStart(token);
        } else if (token.getType().isFunctionEnd()) {
            return new SimpleFunctionEnd(token);
        } else if (token.getType().isUnary()) {
            return new UnaryExpression(token);
        }

        // by returning null, we will let the parser determine what to do
        return null;
    }
View Full Code Here

        }

        // okay we are not inside a function or quote, so we want to support operators
        // and the special null value as well
        if (token.getType().isUnary()) {
            return new UnaryExpression(token);
        } else if (token.getType().isBinary()) {
            return new BinaryExpression(token);
        } else if (token.getType().isLogical()) {
            return new LogicalExpression(token);
        } else if (token.getType().isNullValue()) {
View Full Code Here

        } else if (functions.get() > 0 && token.getType().isFunctionEnd()) {
            // there must be a start function already, to let this be a end function
            functions.decrementAndGet();
            return new SimpleFunctionEnd(token);
        } else if (token.getType().isUnary()) {
            return new UnaryExpression(token);
        }

        // by returning null, we will let the parser determine what to do
        return null;
    }
View Full Code Here

        if (token.getType().isFunctionStart()) {
            return new SimpleFunctionStart(token);
        } else if (token.getType().isFunctionEnd()) {
            return new SimpleFunctionEnd(token);
        } else if (token.getType().isUnary()) {
            return new UnaryExpression(token);
        }

        // by returning null, we will let the parser determine what to do
        return null;
    }
View Full Code Here

        }

        // okay we are not inside a function or quote, so we want to support operators
        // and the special null value as well
        if (token.getType().isUnary()) {
            return new UnaryExpression(token);
        } else if (token.getType().isBinary()) {
            return new BinaryExpression(token);
        } else if (token.getType().isLogical()) {
            return new LogicalExpression(token);
        } else if (token.getType().isNullValue()) {
View Full Code Here

    protected void prepareUnaryExpressions() {
        Stack<SimpleNode> stack = new Stack<SimpleNode>();

        for (SimpleNode node : nodes) {
            if (node instanceof UnaryExpression) {
                UnaryExpression token = (UnaryExpression) node;

                // remember the logical operator
                String operator = token.getOperator().toString();

                SimpleNode previous = stack.isEmpty() ? null : stack.pop();
                if (previous == null) {
                    throw new SimpleParserException("Unary operator " + operator + " has no left hand side token", token.getToken().getIndex());
                } else {
                    token.acceptLeft(previous);
                }
            }
            stack.push(node);
        }
View Full Code Here

        }

        // okay we are not inside a function or quote, so we want to support operators
        // and the special null value as well
        if (token.getType().isUnary()) {
            return new UnaryExpression(token);
        } else if (token.getType().isBinary()) {
            return new BinaryExpression(token);
        } else if (token.getType().isLogical()) {
            return new LogicalExpression(token);
        } else if (token.getType().isNullValue()) {
View Full Code Here

            functions.decrementAndGet();
            return new SimpleFunctionEnd(token);
        } else if (token.getType().isUnary()) {
            // there must be a end function as previous, to let this be a unary function
            if (!nodes.isEmpty() && nodes.get(nodes.size() - 1) instanceof SimpleFunctionEnd) {
                return new UnaryExpression(token);
            }
        }

        // by returning null, we will let the parser determine what to do
        return null;
View Full Code Here

TOP

Related Classes of org.apache.camel.language.simple.ast.UnaryExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.