org.ucl.xpath
Class StaticNameResolver

java.lang.Object
  extended byorg.ucl.xpath.StaticNameResolver
All Implemented Interfaces:
StaticChecker, XPathVisitor

public class StaticNameResolver
extends java.lang.Object
implements XPathVisitor, StaticChecker

This class resolves static names.


Constructor Summary
StaticNameResolver(StaticContext sc)
          Constructor for static name resolver
 
Method Summary
 void check(XPathNode node)
          Check the XPath node.
 void printBinExpr(java.lang.String name, BinExpr e)
          Validate a binary expression by checking its left and right children.
 void printUnExpr(java.lang.String name, UnExpr e)
          Validate a unary expression by checking its one child.
 java.lang.Object visit(AddExpr addex)
          Validate an additon expression.
 java.lang.Object visit(AndExpr andex)
          Validate an AND expression.
 java.lang.Object visit(AnyKindTest e)
          Validate an any kind test.
 java.lang.Object visit(AttributeTest e)
          Validate an attribute test.
 java.lang.Object visit(AxisStep e)
          Validate an axis step.
 java.lang.Object visit(CastableExpr cexp)
          Validate a castable expression.
 java.lang.Object visit(CastExpr cexp)
          Validate a cast expression.
 java.lang.Object visit(CmpExpr cmpex)
          Validate a comparison expression.
 java.lang.Object visit(CntxItemExpr e)
          Validate a context item expression.
 java.lang.Object visit(CommentTest e)
          Validate a comment test.
 java.lang.Object visit(DecimalLiteral e)
          Validate a decimal literal.
 java.lang.Object visit(DivExpr mulex)
          Validate a division expression.
 java.lang.Object visit(DocumentTest e)
          Validate a document test.
 java.lang.Object visit(DoubleLiteral e)
          Validate a double literal.
 java.lang.Object visit(ElementTest e)
          Validate an element test.
 java.lang.Object visit(ExceptExpr eexpr)
          Validate an except expression.
 java.lang.Object visit(FilterExpr e)
          Validate a filter expression.
 java.lang.Object visit(ForExpr fex)
          Validate a for expression.
 java.lang.Object visit(ForwardStep e)
          Validate a forward step.
 java.lang.Object visit(FunctionCall e)
          Validate a function call.
 java.lang.Object visit(IDivExpr mulex)
          Validate an integer divison expression.
 java.lang.Object visit(IfExpr ifex)
          Validate an if expression.
 java.lang.Object visit(InstOfExpr ioexp)
          Validate an 'instance of' expression.
 java.lang.Object visit(IntegerLiteral e)
          Validate an integer literal.
 java.lang.Object visit(IntersectExpr iexpr)
          Validate an intersection expression.
 java.lang.Object visit(ItemType e)
          Validate an item type.
 java.lang.Object visit(MinusExpr e)
          Validate a minus expression.
 java.lang.Object visit(ModExpr mulex)
          Validate a mod expression.
 java.lang.Object visit(MulExpr mulex)
          Validate a multiplication expression.
 java.lang.Object visit(NameTest e)
          Validate a name test.
 java.lang.Object visit(OrExpr orex)
          Validate an OR expression.
 java.lang.Object visit(ParExpr e)
          Validate a parenthesized expression.
 java.lang.Object visit(PipeExpr pipex)
          Validate a piped expression.
 java.lang.Object visit(PITest e)
          Validate a processing instructing test.
 java.lang.Object visit(PlusExpr e)
          Validate a plus expression.
 java.lang.Object visit(QuantifiedExpr qex)
          Validate a quantified expression.
 java.lang.Object visit(RangeExpr rex)
          Validate a range expression.
 java.lang.Object visit(ReverseStep e)
          Validate a reverse step.
 java.lang.Object visit(SchemaAttrTest e)
          Validate a schema attribute test.
 java.lang.Object visit(SchemaElemTest e)
          Validate a schema element test.
 java.lang.Object visit(SequenceType e)
          Validate a sequence type.
 java.lang.Object visit(SingleType e)
          Validate a single type.
 java.lang.Object visit(StringLiteral e)
          Validate a string literal.
 java.lang.Object visit(SubExpr subex)
          Validate a subtraction expression.
 java.lang.Object visit(TextTest e)
          Validate a text test.
 java.lang.Object visit(TreatAsExpr taexp)
          Validate a 'treat as' expression.
 java.lang.Object visit(UnionExpr unex)
          Validate a union expression.
 java.lang.Object visit(VarRef e)
          Validate a variable reference.
 java.lang.Object visit(XPath xp)
          Validate an XPath by visiting all the nodes.
 java.lang.Object visit(XPathExpr e)
          Validate an xpath expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticNameResolver

public StaticNameResolver(StaticContext sc)
Constructor for static name resolver

Parameters:
sc - is the static context.
Method Detail

check

public void check(XPathNode node)
           throws StaticError
Check the XPath node.

Specified by:
check in interface StaticChecker
Parameters:
node - is the XPath node to check.
Throws:
StaticError - static error.

visit

public java.lang.Object visit(XPath xp)
Validate an XPath by visiting all the nodes.

Specified by:
visit in interface XPathVisitor
Parameters:
xp - is the XPath.
Returns:
null.

visit

public java.lang.Object visit(ForExpr fex)
Validate a for expression.

Specified by:
visit in interface XPathVisitor
Parameters:
fex - is the for expression.
Returns:
null.

visit

public java.lang.Object visit(QuantifiedExpr qex)
Validate a quantified expression.

Specified by:
visit in interface XPathVisitor
Parameters:
qex - is the quantified expression.
Returns:
null.

visit

public java.lang.Object visit(IfExpr ifex)
Validate an if expression.

Specified by:
visit in interface XPathVisitor
Parameters:
ifex - is the if expression.
Returns:
null.

printBinExpr

public void printBinExpr(java.lang.String name,
                         BinExpr e)
Validate a binary expression by checking its left and right children.

Parameters:
name - is the name of the binary expression.
e - is the expression itself.

visit

public java.lang.Object visit(OrExpr orex)
Validate an OR expression.

Specified by:
visit in interface XPathVisitor
Parameters:
orex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(AndExpr andex)
Validate an AND expression.

Specified by:
visit in interface XPathVisitor
Parameters:
andex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(CmpExpr cmpex)
Validate a comparison expression.

Specified by:
visit in interface XPathVisitor
Parameters:
cmpex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(RangeExpr rex)
Validate a range expression.

Specified by:
visit in interface XPathVisitor
Parameters:
rex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(AddExpr addex)
Validate an additon expression.

Specified by:
visit in interface XPathVisitor
Parameters:
addex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(SubExpr subex)
Validate a subtraction expression.

Specified by:
visit in interface XPathVisitor
Parameters:
subex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(MulExpr mulex)
Validate a multiplication expression.

Specified by:
visit in interface XPathVisitor
Parameters:
mulex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(DivExpr mulex)
Validate a division expression.

Specified by:
visit in interface XPathVisitor
Parameters:
mulex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(IDivExpr mulex)
Validate an integer divison expression.

Specified by:
visit in interface XPathVisitor
Parameters:
mulex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(ModExpr mulex)
Validate a mod expression.

Specified by:
visit in interface XPathVisitor
Parameters:
mulex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(UnionExpr unex)
Validate a union expression.

Specified by:
visit in interface XPathVisitor
Parameters:
unex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(PipeExpr pipex)
Validate a piped expression.

Specified by:
visit in interface XPathVisitor
Parameters:
pipex - is the expression.
Returns:
null.

visit

public java.lang.Object visit(IntersectExpr iexpr)
Validate an intersection expression.

Specified by:
visit in interface XPathVisitor
Parameters:
iexpr - is the expression.
Returns:
null.

visit

public java.lang.Object visit(ExceptExpr eexpr)
Validate an except expression.

Specified by:
visit in interface XPathVisitor
Parameters:
eexpr - is the expression.
Returns:
null.

visit

public java.lang.Object visit(InstOfExpr ioexp)
Validate an 'instance of' expression.

Specified by:
visit in interface XPathVisitor
Parameters:
ioexp - is the expression.
Returns:
null.

visit

public java.lang.Object visit(TreatAsExpr taexp)
Validate a 'treat as' expression.

Specified by:
visit in interface XPathVisitor
Parameters:
taexp - is the expression.
Returns:
null.

visit

public java.lang.Object visit(CastableExpr cexp)
Validate a castable expression.

Specified by:
visit in interface XPathVisitor
Parameters:
cexp - is the expression.
Returns:
null.

visit

public java.lang.Object visit(CastExpr cexp)
Validate a cast expression.

Specified by:
visit in interface XPathVisitor
Parameters:
cexp - is the expression.
Returns:
null.

printUnExpr

public void printUnExpr(java.lang.String name,
                        UnExpr e)
Validate a unary expression by checking its one child.

Parameters:
name - is the name of the expression.
e - is the expression itself.

visit

public java.lang.Object visit(MinusExpr e)
Validate a minus expression.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(PlusExpr e)
Validate a plus expression.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(XPathExpr e)
Validate an xpath expression.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(ForwardStep e)
Validate a forward step.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(ReverseStep e)
Validate a reverse step.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(NameTest e)
Validate a name test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(VarRef e)
Validate a variable reference.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(StringLiteral e)
Validate a string literal.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(IntegerLiteral e)
Validate an integer literal.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(DoubleLiteral e)
Validate a double literal.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(DecimalLiteral e)
Validate a decimal literal.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(ParExpr e)
Validate a parenthesized expression.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(CntxItemExpr e)
Validate a context item expression.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(FunctionCall e)
Validate a function call.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(SingleType e)
Validate a single type.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(SequenceType e)
Validate a sequence type.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(ItemType e)
Validate an item type.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(AnyKindTest e)
Validate an any kind test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(DocumentTest e)
Validate a document test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(TextTest e)
Validate a text test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(CommentTest e)
Validate a comment test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(PITest e)
Validate a processing instructing test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(AttributeTest e)
Validate an attribute test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(SchemaAttrTest e)
Validate a schema attribute test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(ElementTest e)
Validate an element test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(SchemaElemTest e)
Validate a schema element test.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(AxisStep e)
Validate an axis step.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.

visit

public java.lang.Object visit(FilterExpr e)
Validate a filter expression.

Specified by:
visit in interface XPathVisitor
Parameters:
e - is the expression.
Returns:
null.