public FilterExpr(Expression primary, Vector predicates) { _primary = primary; _predicates = predicates; primary.setParent(this); }
/** * Creates a new logical expression - either OR or AND. Note that the * left- and right-hand side expressions can also be logical expressions, * thus creating logical trees representing structures such as * (a and (b or c) and d), etc... */ public LogicalExpr(int op, Expression left, Expression right) { _op = op; (_left = left).setParent(this); (_right = right).setParent(this); }
public FilteredAbsoluteLocationPath(Expression path) { _path = path; if (path != null) { _path.setParent(this); } }
public AbsoluteLocationPath(Expression path) { _path = path; if (path != null) { _path.setParent(this); } }
/** * Initializes a predicate. */ public Predicate(Expression exp) { _exp = exp; _exp.setParent(this); }
public UnaryOpExpr(Expression left) { (_left = left).setParent(this); }
public void setParser(Parser parser) { super.setParser(parser); if (_arguments != null) { final int n = _arguments.size(); for (int i = 0; i < n; i++) { final Expression exp = (Expression)_arguments.elementAt(i); exp.setParser(parser); exp.setParent(this); } } }
public void setParser(Parser parser) { super.setParser(parser); _primary.setParser(parser); if (_predicates != null) { final int n = _predicates.size(); for (int i = 0; i < n; i++) { final Expression exp = (Expression)_predicates.elementAt(i); exp.setParser(parser); exp.setParent(this); } } }
public ParentLocationPath(RelativeLocationPath path, Expression step) { _path = path; _step = step; _path.setParent(this); _step.setParent(this); if (_step instanceof Step) { _axisMismatch = checkAxisMismatch(); } }
public void setParser(Parser parser) { super.setParser(parser); // find all expressions in this Union final Vector components = new Vector(); flatten(components); final int size = components.size(); _components = (Expression[])components.toArray(new Expression[size]); for (int i = 0; i < size; i++) { _components[i].setParser(parser); _components[i].setParent(this); if (_components[i] instanceof Step) { final Step step = (Step)_components[i]; final int axis = step.getAxis(); final int type = step.getNodeType(); // Put attribute iterators first if ((axis == Axis.ATTRIBUTE) || (type == DTM.ATTRIBUTE_NODE)) { _components[i] = _components[0]; _components[0] = step; } // Check if the union contains a reverse iterator if (Axis.isReverse(axis)) _reverse = true; } } // No need to reverse anything if another expression lies on top of this if (getParent() instanceof Expression) _reverse = false; }
/** * Construct a cast expression and check that the conversion is * valid by calling typeCheck(). */ public CastExpr(Expression left, Type type) throws TypeCheckError { _left = left; _type = type; // use inherited field if ((_left instanceof Step) && (_type == Type.Boolean)) { Step step = (Step)_left; if ((step.getAxis() == Axis.SELF) && (step.getNodeType() != -1)) _typeTest = true; } // check if conversion is valid setParser(left.getParser()); setParent(left.getParent()); left.setParent(this); typeCheck(left.getParser().getSymbolTable()); }
public FilterExpr(Expression primary, Vector predicates) { _primary = primary; _predicates = predicates; primary.setParent(this); }
public AbsoluteLocationPath(Expression path) { _path = path; if (path != null) { _path.setParent(this); } }
public void setParser(Parser parser) { super.setParser(parser); _primary.setParser(parser); if (_predicates != null) { final int n = _predicates.size(); for (int i = 0; i < n; i++) { final Expression exp = (Expression)_predicates.elementAt(i); exp.setParser(parser); exp.setParent(this); } } }
public ParentLocationPath(RelativeLocationPath path, Expression step) { _path = path; _step = step; _path.setParent(this); _step.setParent(this); if (_step instanceof Step) { _axisMismatch = checkAxisMismatch(); } }