jif.visit

## Class JifExceptionChecker

- java.lang.Object
- - polyglot.visit.NodeVisitor
  - - polyglot.visit.HaltingVisitor
    - - polyglot.visit.ErrorHandlingVisitor
      - - polyglot.visit.ExceptionChecker
        - - jif.visit.JifExceptionChecker

- All Implemented Interfaces:
    java.lang.Cloneable, polyglot.util.Copy<polyglot.visit.NodeVisitor>

      public class JifExceptionChecker
      extends polyglot.visit.ExceptionChecker

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `JifExceptionChecker.FatalExceptionSetter`

    - ### Nested classes/interfaces inherited from class polyglot.visit.ExceptionChecker

      `polyglot.visit.ExceptionChecker.CodeTypeReporter, polyglot.visit.ExceptionChecker.UncaughtReporter`

    - ### Nested classes/interfaces inherited from interface polyglot.util.Copy

      `polyglot.util.Copy.Util`

  - ### Field Summary

    - ### Fields inherited from class polyglot.visit.ExceptionChecker

      `catchable, catchAllThrowable, outer, reporter, throwsSet`

    - ### Fields inherited from class polyglot.visit.ErrorHandlingVisitor

      `error, job, nf, ts`

    - ### Fields inherited from class polyglot.visit.HaltingVisitor

      `bypass, bypassParent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JifExceptionChecker(polyglot.frontend.Job job, polyglot.types.TypeSystem ts, polyglot.ast.NodeFactory nf)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected polyglot.ast.Node` | `leaveCall(polyglot.ast.Node parent, polyglot.ast.Node old, polyglot.ast.Node n, polyglot.visit.NodeVisitor v)` Call exceptionCheck(ExceptionChecker) on the node.
    `void` | `throwsException(polyglot.types.Type t, polyglot.util.Position pos)` The ast nodes will use this callback to notify us that they throw an exception of type t.

    - ### Methods inherited from class polyglot.visit.ExceptionChecker

      `enterCall, enterError, lang, leaveCall, pop, push, push, push, push, pushCatchAllThrowable, reportUncaughtException, throwsSet`

    - ### Methods inherited from class polyglot.visit.ErrorHandlingVisitor

      `begin, catchErrors, enter, enterCall, errorQueue, hasErrors, job, leave, leaveCall, nodeFactory, typeSystem`

    - ### Methods inherited from class polyglot.visit.HaltingVisitor

      `bypass, bypass, bypassChildren, override, visitChildren`

    - ### Methods inherited from class polyglot.visit.NodeVisitor

      `copy, enter, finish, finish, leave, override, toString, visitEdge, visitEdgeNoOverride`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JifExceptionChecker

          public JifExceptionChecker(polyglot.frontend.Job job,
                                     polyglot.types.TypeSystem ts,
                                     polyglot.ast.NodeFactory nf)

  - ### Method Detail

    - #### leaveCall

          protected polyglot.ast.Node leaveCall(polyglot.ast.Node parent,
                                                polyglot.ast.Node old,
                                                polyglot.ast.Node n,
                                                polyglot.visit.NodeVisitor v)
                                         throws polyglot.types.SemanticException

      Call exceptionCheck(ExceptionChecker) on the node.
      Overrides:
        `leaveCall` in class `polyglot.visit.ErrorHandlingVisitor`
      Parameters:
        `old` - The original state of root of the current subtree.
        `n` - The current state of the root of the current subtree.
        `v` - The `NodeVisitor` object used to visit the children.
      Returns:
        The final result of the traversal of the tree rooted at `n`.
      Throws:
        `polyglot.types.SemanticException`

    - #### throwsException

          public void throwsException(polyglot.types.Type t,
                                      polyglot.util.Position pos)
                               throws polyglot.types.SemanticException

      The ast nodes will use this callback to notify us that they throw an exception of type t. This method will throw a SemanticException if the type t is not allowed to be thrown at this point; the exception t will be added to the throwsSet of all exception checkers in the stack, up to (and not including) the exception checker that catches the exception.
      Overrides:
        `throwsException` in class `polyglot.visit.ExceptionChecker`
      Parameters:
        `t` - The type of exception that the node throws.
      Throws:
        `polyglot.types.SemanticException`