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;
}
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;
}
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;
}
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;
}
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;
}
}
Aggregations