All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drools.mvel.parser.ast.expr.PointFreeExpr Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2019 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *
 */

package org.drools.mvel.parser.ast.expr;

import com.github.javaparser.TokenRange;
import com.github.javaparser.ast.NodeList;
import com.github.javaparser.ast.expr.Expression;
import com.github.javaparser.ast.expr.SimpleName;
import org.drools.mvel.parser.ast.visitor.DrlVoidVisitor;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
import org.drools.mvel.parser.ast.visitor.DrlGenericVisitor;

public class PointFreeExpr extends Expression {

    private final Expression left;
    private final NodeList right;

    private final SimpleName operator;
    private boolean negated;
    private final Expression arg1;
    private final Expression arg2;
    private final Expression arg3;
    private final Expression arg4;

    public PointFreeExpr( TokenRange tokenRange, Expression left, NodeList right, SimpleName operator, Boolean negated, Expression arg1, Expression arg2, Expression arg3, Expression arg4 ) {
        super(tokenRange);
        this.left = left;
        this.right = right;
        this.operator = operator;
        this.negated = negated;
        this.arg1 = arg1;
        this.arg2 = arg2;
        this.arg3 = arg3;
        this.arg4 = arg4;
    }

    @Override
    public  R accept(GenericVisitor v, A arg) {
        return ((DrlGenericVisitor)v).visit(this, arg);
    }

    @Override
    public  void accept(VoidVisitor v, A arg) {
        ((DrlVoidVisitor)v).visit(this, arg);
    }

    public Expression getLeft() {
        return left;
    }

    public NodeList getRight() {
        return right;
    }

    public SimpleName getOperator() {
        return operator;
    }

    public boolean isNegated() {
        return negated;
    }

    public Expression getArg1() {
        return arg1;
    }

    public Expression getArg2() {
        return arg2;
    }

    public Expression getArg3() {
        return arg3;
    }

    public Expression getArg4() {
        return arg4;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy