condor.classad
Class AttrRef

java.lang.Object
  |
  +--condor.classad.Expr
        |
        +--condor.classad.AttrRef

public class AttrRef
extends Expr

A reference to another attribute. A leaf node in an expression tree that represents an attribute reference. It includes a ``locality'' (one of SELF, PARENT, SUPER, or ROOT) and an optional pointer to a target RecordExpr. The target is set at compile time by a post-pass over the expression tree as follows

SELF
The target is smallest enclosing RecordExpr. The concrete syntax "xxx" is compiled as SELF.xxx (i.e., Select(AttrReff(SELF),"xxx")).
ROOT
The target is the largest enclosing RecordExpr. The concrete syntax ".xxx" is compiled as ROOT.xxx.
PARENT
The target is the second smallest enclosing RecordExpr. In other words, the smallest RecordExpr properly enclosing the RecordExpr denoted by SELF.
SUPER
If the SELF RecordExpr does not have any attribute named "super", the target is the same as PARENT; else if the super attribute of the SELF RecordExpr is an AttrRef, the target is the same as the target of that AttrRef; otherwise, it is null.
The target is null if the indicated RecordExpr does not exist. In particular, for SELF and ROOT, the target is null if this AttrRef is not nested inside any RecordExpr. For PARENT, it is null if it is not nested at least two deep inside RecordExprs. If the target is null, it is dynamically supplied at evaluation time from an associated Context.

Version:
1.2
Author:
Marvin Solomon
See Also:
Expr, RecordExpr, Context

Fields inherited from class condor.classad.Expr
ABSOLUTE_TIME, AND, ATTRIBUTE, BIT_COMPLEMENT, BITAND, BITOR, BITXOR, BOOLEAN, BRIEF, CALL, COMPACT, COND, dblevel, DIFFERENT, DIV, EQUAL, ERROR, formatFlags, formatIndent, GREATER, GREATER_EQ, INTEGER, LEFT_SHIFT, LESS, LESS_EQ, LIST, MAXPREC, MINIMAL_PARENTHESES, MINUS, MOD, MULTI_LINE_ADS, MULTI_LINE_LISTS, NO_ESCAPE_STRINGS, NOT, NOT_EQUAL, OP, opName, OR, PLUS, READABLE, REAL, RECORD, RELATIVE_TIME, RIGHT_SHIFT, SAME, SELECTION, SHOW_ERROR_DETAIL, SHOW_INSTANCES, STRING, SUBSCRIPT, TIMES, type, UMINUS, UNDEFINED, UPLUS, URIGHT_SHIFT
 
Constructor Summary
AttrRef(int locality)
          Create a new AttrRef.
 
Method Summary
protected  int prec()
          The precedence of this expression
protected  Expr reEval(Context ctx)
          Evalutate this expression.
 String toString()
          Convert this Expr to a string.
 
Methods inherited from class condor.classad.Expr
db, db, disableFormatFlags, enableFormatFlags, eval, getFormatFlags, isConstant, isNormalForm, mark, mark, mark, select, setFormatFlags, toString, typeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttrRef

public AttrRef(int locality)
Create a new AttrRef.
Parameters:
locality - one of SELF, ROOT, PARENT, or SUPER.
Method Detail

toString

public String toString()
Convert this Expr to a string. The exact format of the result is controled by the static fields Expr.formatFlags and Expr.formatIndent. The result may be multiple lines long (it may include embedded newlines and tabs), but it never ends with a newline.
Overrides:
toString in class Expr
Returns:
a string representation of the this Context
See Also:
Expr.formatFlags, Expr.formatIndent

reEval

protected Expr reEval(Context ctx)
Evalutate this expression.
Overrides:
reEval in class Expr
Parameters:
ctx - an evaluation context for evaluating this expression
Returns:
a Constant, ListExpr, or RecordExpr representing the value.
See Also:
Expr.eval(condor.classad.Context)

prec

protected int prec()
The precedence of this expression
Overrides:
prec in class Expr
Returns:
the precendence of this node (MAXPREC).