jif.visit
Class LabelChecker

java.lang.Object
  |
  +--jif.visit.LabelChecker
All Implemented Interfaces:
java.lang.Cloneable, polyglot.util.Copy

public class LabelChecker
extends java.lang.Object
implements polyglot.util.Copy

A visitor doing label checking.


Constructor Summary
LabelChecker(polyglot.frontend.Job job, polyglot.types.TypeSystem ts, polyglot.ast.NodeFactory nf)
           
LabelChecker(polyglot.frontend.Job job, polyglot.types.TypeSystem ts, polyglot.ast.NodeFactory nf, boolean solveClassBodies)
           
 
Method Summary
 void addIFF(polyglot.types.FieldInstance fi)
           
 void bind(DynamicLabel dl, Label l)
           
 boolean checkingInits()
           
 void checkingInits(boolean checkingInits)
           
 void constrainEqual(Label L1, Label L2)
           
 void constrainEqual(Label L1, Label L2, polyglot.util.Position pos)
           
 void constrainEqual(Label L1, Label L2, polyglot.util.Position pos, java.lang.String msg)
           
 void constrainEqual(NamedLabel L1, NamedLabel L2, polyglot.util.Position pos)
           
 void constrainEqual(NamedLabel L1, NamedLabel L2, polyglot.util.Position pos, java.lang.String msg)
           
 void constrainLE(Label L1, Label L2)
           
 void constrainLE(Label L1, Label L2, polyglot.util.Position pos)
           
 void constrainLE(Label L1, Label L2, polyglot.util.Position pos, java.lang.String msg)
           
 void constrainLE(NamedLabel L1, NamedLabel L2, polyglot.util.Position pos)
           
 void constrainLE(NamedLabel L1, NamedLabel L2, polyglot.util.Position pos, java.lang.String msg)
           
 Label constructorReturnLabel()
           
 void constructorReturnLabel(Label Lr)
           
 JifContext context()
           
 LabelChecker context(JifContext c)
           
 java.lang.Object copy()
           
 void enteringClassBody()
          Called by JifClassDeclExt just before this label checker is used to check a class body.
 polyglot.ast.Node finishedLabelCheckPass(polyglot.ast.Node n)
          This method should be called on the top level label checker once the label checking has finished.
 java.util.Set initializedFinalFields()
           
 JifContext jifContext()
           
 JifTypeSystem jifTypeSystem()
           
 polyglot.ast.Node labelCheck(polyglot.ast.Node n)
           
 JifClassDecl leavingClassBody(JifClassDecl n)
          Called by JifClassDeclExt just after this label checker has been used to check a class body.
 polyglot.types.Type returnType()
           
 void setReturnType(polyglot.types.Type t)
           
 JifTypeSystem typeSystem()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelChecker

public LabelChecker(polyglot.frontend.Job job,
                    polyglot.types.TypeSystem ts,
                    polyglot.ast.NodeFactory nf,
                    boolean solveClassBodies)

LabelChecker

public LabelChecker(polyglot.frontend.Job job,
                    polyglot.types.TypeSystem ts,
                    polyglot.ast.NodeFactory nf)
Method Detail

copy

public java.lang.Object copy()
Specified by:
copy in interface polyglot.util.Copy

context

public JifContext context()

context

public LabelChecker context(JifContext c)

typeSystem

public JifTypeSystem typeSystem()

jifTypeSystem

public JifTypeSystem jifTypeSystem()

jifContext

public JifContext jifContext()

labelCheck

public polyglot.ast.Node labelCheck(polyglot.ast.Node n)
                             throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainEqual

public void constrainEqual(Label L1,
                           Label L2)
                    throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainEqual

public void constrainEqual(Label L1,
                           Label L2,
                           polyglot.util.Position pos)
                    throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainEqual

public void constrainEqual(Label L1,
                           Label L2,
                           polyglot.util.Position pos,
                           java.lang.String msg)
                    throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainEqual

public void constrainEqual(NamedLabel L1,
                           NamedLabel L2,
                           polyglot.util.Position pos)
                    throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainEqual

public void constrainEqual(NamedLabel L1,
                           NamedLabel L2,
                           polyglot.util.Position pos,
                           java.lang.String msg)
                    throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainLE

public void constrainLE(Label L1,
                        Label L2)
                 throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainLE

public void constrainLE(Label L1,
                        Label L2,
                        polyglot.util.Position pos)
                 throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainLE

public void constrainLE(Label L1,
                        Label L2,
                        polyglot.util.Position pos,
                        java.lang.String msg)
                 throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainLE

public void constrainLE(NamedLabel L1,
                        NamedLabel L2,
                        polyglot.util.Position pos)
                 throws polyglot.types.SemanticException
polyglot.types.SemanticException

constrainLE

public void constrainLE(NamedLabel L1,
                        NamedLabel L2,
                        polyglot.util.Position pos,
                        java.lang.String msg)
                 throws polyglot.types.SemanticException
polyglot.types.SemanticException

checkingInits

public boolean checkingInits()

checkingInits

public void checkingInits(boolean checkingInits)

initializedFinalFields

public java.util.Set initializedFinalFields()

addIFF

public void addIFF(polyglot.types.FieldInstance fi)

constructorReturnLabel

public Label constructorReturnLabel()

constructorReturnLabel

public void constructorReturnLabel(Label Lr)

returnType

public polyglot.types.Type returnType()

setReturnType

public void setReturnType(polyglot.types.Type t)

bind

public void bind(DynamicLabel dl,
                 Label l)

enteringClassBody

public void enteringClassBody()
Called by JifClassDeclExt just before this label checker is used to check a class body. This allows us to use a different solver if required.


leavingClassBody

public JifClassDecl leavingClassBody(JifClassDecl n)
Called by JifClassDeclExt just after this label checker has been used to check a class body. This allows us to use a different solver if required.


finishedLabelCheckPass

public polyglot.ast.Node finishedLabelCheckPass(polyglot.ast.Node n)
This method should be called on the top level label checker once the label checking has finished. This will perform label substitution if required.