condor.classad
Class FuncCall

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

public class FuncCall
extends Expr

A function call. An internal (non-leaf) node of an expression tree representing a function name and list of arguments.

Version:
1.2
Author:
Marvin Solomon
See Also:
Expr

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
FuncCall(String func, Vector params)
          Create a function node from a name and a vector of paramters.
 
Method Summary
protected  int prec()
          The precedence of the operator in this expression node.
protected  Expr reEval(Context ctx)
          Evalutate a FuncCall 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

FuncCall

public FuncCall(String func,
                Vector params)
Create a function node from a name and a vector of paramters.
Parameters:
func - the name of the function (original case).
params - the parameters supplied.
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 a FuncCall expression. Currently, we assume that all functions are strict in all their arguments, that is, all arguments are evaluated before the function is called, and if any argument evaluates to an undefined or error Constant, the value of the call is undefined or error (with error taking precendence over undefined; the message in a resulting Constant is taken from the first argument that evaluates to an error (or undefined) Constant).

We also assume at this time that there are no built-in functions that take a RecordExpr or ListExpr as an argument.

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 the operator in this expression node. Used to print expressions without superfluous parentheses. Function calls have maximal precedence (higher than any operator).
Overrides:
prec in class Expr
Returns:
the precendence of this node.
See Also:
Expr.MINIMAL_PARENTHESES