com.sun.msv.grammar

Class ReferenceExp

public class ReferenceExp extends Expression

Reference to the other expression.

In RELAX grammar, this class is used as a base class of elementRule reference and hedgeRule reference. TREX uses this class directly.

This object is created and controlled by TREXGrammar/RELAXModule object, rather than ExpressionPool. Therefore, this object is not a subject to unification.

This class can be derived. In fact, many classes derive this class.

Author: Kohsuke KAWAGUCHI

Field Summary
Expressionexp
child expression.
Stringname
name of the referenced expression. can be null for anonymously referenced expression.
Constructor Summary
ReferenceExp(String name)
ReferenceExp(String name, Expression exp)
Method Summary
booleanequals(Object o)
booleanisDefined()
checks if this ReferenceExp is properly defined. this method is used to detect undeclared definitions.
Objectvisit(ExpressionVisitor visitor)
Expressionvisit(ExpressionVisitorExpression visitor)
booleanvisit(ExpressionVisitorBoolean visitor)
voidvisit(ExpressionVisitorVoid visitor)

Field Detail

exp

public Expression exp
child expression. Due to the possible forward reference, this variable is not available when the object is instanciated. Actual expression will be set once if the definition is parsed.

name

public final String name
name of the referenced expression. can be null for anonymously referenced expression.

Constructor Detail

ReferenceExp

public ReferenceExp(String name)

ReferenceExp

public ReferenceExp(String name, Expression exp)

Method Detail

equals

public boolean equals(Object o)

isDefined

public boolean isDefined()
checks if this ReferenceExp is properly defined. this method is used to detect undeclared definitions. Derived classes can override this method.

visit

public final Object visit(ExpressionVisitor visitor)

visit

public final Expression visit(ExpressionVisitorExpression visitor)

visit

public final boolean visit(ExpressionVisitorBoolean visitor)

visit

public final void visit(ExpressionVisitorVoid visitor)