Search in sources :

Example 1 with LogicalOperatorBond

use of org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond in project cdk by cdk.

the class SmartsQueryVisitor method visit.

public Object visit(ASTOrBond node, Object data) {
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    if (node.jjtGetNumChildren() == 1) {
        return left;
    }
    LogicalOperatorBond bond = new LogicalOperatorBond(builder);
    bond.setOperator("or");
    bond.setLeft((IQueryBond) left);
    IQueryBond right = (IQueryBond) node.jjtGetChild(1).jjtAccept(this, data);
    bond.setRight(right);
    return bond;
}
Also used : LogicalOperatorBond(org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond) IQueryBond(org.openscience.cdk.isomorphism.matchers.IQueryBond)

Example 2 with LogicalOperatorBond

use of org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond in project cdk by cdk.

the class SmartsQueryVisitor method visit.

public Object visit(ASTLowAndBond node, Object data) {
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    if (node.jjtGetNumChildren() == 1) {
        return left;
    }
    LogicalOperatorBond bond = new LogicalOperatorBond(builder);
    bond.setOperator("and");
    bond.setLeft((IQueryBond) left);
    IQueryBond right = (IQueryBond) node.jjtGetChild(1).jjtAccept(this, data);
    bond.setRight(right);
    return bond;
}
Also used : LogicalOperatorBond(org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond) IQueryBond(org.openscience.cdk.isomorphism.matchers.IQueryBond)

Example 3 with LogicalOperatorBond

use of org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond in project cdk by cdk.

the class SmartsQueryVisitor method visit.

public Object visit(ASTExplicitHighAndBond node, Object data) {
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    if (node.jjtGetNumChildren() == 1) {
        return left;
    }
    LogicalOperatorBond bond = new LogicalOperatorBond(builder);
    bond.setOperator("and");
    bond.setLeft((IQueryBond) left);
    IQueryBond right = (IQueryBond) node.jjtGetChild(1).jjtAccept(this, data);
    bond.setRight(right);
    return bond;
}
Also used : LogicalOperatorBond(org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond) IQueryBond(org.openscience.cdk.isomorphism.matchers.IQueryBond)

Example 4 with LogicalOperatorBond

use of org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond in project cdk by cdk.

the class SmartsQueryVisitor method visit.

public Object visit(ASTImplicitHighAndBond node, Object data) {
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    if (node.jjtGetNumChildren() == 1) {
        return left;
    }
    LogicalOperatorBond bond = new LogicalOperatorBond(builder);
    bond.setOperator("and");
    bond.setLeft((IQueryBond) left);
    IQueryBond right = (IQueryBond) node.jjtGetChild(1).jjtAccept(this, data);
    bond.setRight(right);
    return bond;
}
Also used : LogicalOperatorBond(org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond) IQueryBond(org.openscience.cdk.isomorphism.matchers.IQueryBond)

Example 5 with LogicalOperatorBond

use of org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond in project cdk by cdk.

the class SmartsQueryVisitor method visit.

public Object visit(ASTNotBond node, Object data) {
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    if (node.getType() == SMARTSParserConstants.NOT) {
        LogicalOperatorBond bond = new LogicalOperatorBond(builder);
        bond.setOperator("not");
        bond.setLeft((IQueryBond) left);
        return bond;
    } else {
        return left;
    }
}
Also used : LogicalOperatorBond(org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond)

Aggregations

LogicalOperatorBond (org.openscience.cdk.isomorphism.matchers.smarts.LogicalOperatorBond)5 IQueryBond (org.openscience.cdk.isomorphism.matchers.IQueryBond)4