polyglot.ext.jl.ast
Class Disamb_c

java.lang.Object
  extended by polyglot.ext.jl.ast.Disamb_c
All Implemented Interfaces:
Disamb

public class Disamb_c
extends java.lang.Object
implements Disamb

Utility class which is used to disambiguate ambiguous AST nodes (Expr, Type, Receiver, Qualifier, Prefix).


Field Summary
protected  Ambiguous amb
           
protected  Context c
           
protected  java.lang.String name
           
protected  NodeFactory nf
           
protected  Position pos
           
protected  Prefix prefix
           
protected  TypeSystem ts
           
protected  ContextVisitor v
           
 
Constructor Summary
Disamb_c()
           
 
Method Summary
 Node disambiguate(Ambiguous amb, ContextVisitor v, Position pos, Prefix prefix, java.lang.String name)
          Disambiguate the prefix and name into a unambiguous node.
protected  Node disambiguateExprPrefix(Expr e)
           
protected  Node disambiguateNoPrefix()
           
protected  Node disambiguatePackagePrefix(PackageNode pn)
           
protected  Node disambiguateTypeNodePrefix(TypeNode tn)
           
protected  Node disambiguateVarInstance(VarInstance vi)
           
protected  boolean exprOK()
           
protected  Receiver makeMissingFieldTarget(FieldInstance fi)
           
protected  boolean packageOK()
           
protected  boolean typeOK()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

v

protected ContextVisitor v

pos

protected Position pos

prefix

protected Prefix prefix

name

protected java.lang.String name

nf

protected NodeFactory nf

ts

protected TypeSystem ts

c

protected Context c

amb

protected Ambiguous amb
Constructor Detail

Disamb_c

public Disamb_c()
Method Detail

disambiguate

public Node disambiguate(Ambiguous amb,
                         ContextVisitor v,
                         Position pos,
                         Prefix prefix,
                         java.lang.String name)
                  throws SemanticException
Disambiguate the prefix and name into a unambiguous node.

Specified by:
disambiguate in interface Disamb
Returns:
An unambiguous AST node, or null if disambiguation fails.
Throws:
SemanticException

disambiguatePackagePrefix

protected Node disambiguatePackagePrefix(PackageNode pn)
                                  throws SemanticException
Throws:
SemanticException

disambiguateTypeNodePrefix

protected Node disambiguateTypeNodePrefix(TypeNode tn)
                                   throws SemanticException
Throws:
SemanticException

disambiguateExprPrefix

protected Node disambiguateExprPrefix(Expr e)
                               throws SemanticException
Throws:
SemanticException

disambiguateNoPrefix

protected Node disambiguateNoPrefix()
                             throws SemanticException
Throws:
SemanticException

disambiguateVarInstance

protected Node disambiguateVarInstance(VarInstance vi)
                                throws SemanticException
Throws:
SemanticException

makeMissingFieldTarget

protected Receiver makeMissingFieldTarget(FieldInstance fi)
                                   throws SemanticException
Throws:
SemanticException

typeOK

protected boolean typeOK()

packageOK

protected boolean packageOK()

exprOK

protected boolean exprOK()