jif.ast

## Class AmbParam_c

- java.lang.Object
- - polyglot.ast.Node_c
  - - jif.ast.AmbParam_c

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, AmbParam, ParamNode, polyglot.ast.Ambiguous, polyglot.ast.Node, polyglot.ast.NodeOps, polyglot.util.Copy<polyglot.ast.Node>

      public class AmbParam_c
      extends polyglot.ast.Node_c
      implements AmbParam

  An implementation of the `AmbParam` interface.
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `polyglot.util.Copy.Util`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `MAX_DISAMB_CALLS` The maximum number of times that disambiguate can be called before we allow an error message to be reported.
    `protected polyglot.ast.Id` | `name`
    `protected ParamInstance` | `pi`

    - ### Fields inherited from class polyglot.ast.Node_c

      `del, error, ext, position`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AmbParam_c(polyglot.util.Position pos, polyglot.ast.Id name, ParamInstance pi)`
    `AmbParam_c(polyglot.util.Position pos, polyglot.ast.Id name, ParamInstance pi, polyglot.ast.Ext ext)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `polyglot.ast.Node` | `disambiguate(polyglot.visit.AmbiguityRemover sc)` Disambiguates `name`.
    `AmbParam` | `id(polyglot.ast.Id id)`
    `protected <N extends AmbParam_c> N` | `id(N n, polyglot.ast.Id id)`
    `boolean` | `isDisambiguated()`
    `java.lang.String` | `name()`
    `protected <N extends AmbParam_c> N` | `name(N n, java.lang.String name)`
    `AmbParam` | `name(java.lang.String name)`
    `Param` | `parameter()`
    `protected polyglot.ast.Node` | `paramToParam(ParamInstance pi, polyglot.visit.AmbiguityRemover sc)` Turns a `PramaInstance` object into a label node or a principal node.
    `protected polyglot.ast.Node` | `principalToParam(PrincipalInstance vi, polyglot.visit.AmbiguityRemover sc)` Turns a `PrincipalInstance` object into a principal node.
    `protected <N extends AmbParam_c> N` | `reconstruct(N n, polyglot.ast.Id name)`
    `java.lang.String` | `toString()`
    `protected polyglot.ast.Node` | `varToParam(JifVarInstance vi, polyglot.visit.AmbiguityRemover sc)` Turns a `JifVarInstance` object into a label node or a principal node
    `polyglot.ast.Node` | `visitChildren(polyglot.visit.NodeVisitor v)`

    - ### Methods inherited from class polyglot.ast.Node_c

      `addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, copyIfNeeded, del, del, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, enterScope, error, error, error, exceptionCheck, exceptionCheckEnter, ext, ext, ext, ext, extRewrite, extRewriteEnter, extRewriteOverride, isTypeChecked, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitList`

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

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

    - ### Methods inherited from interface polyglot.ast.Node

      `del, del, dump, error, error, ext, ext, ext, ext, isTypeChecked, position, position, visit, visitEdge`

    - ### Methods inherited from interface polyglot.ast.NodeOps

      `addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, extRewriteOverride, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitList`

    - ### Methods inherited from interface polyglot.util.Copy

      `copy`

- - ### Field Detail

    - #### name

          protected polyglot.ast.Id name

    - #### pi

          protected ParamInstance pi

    - #### MAX_DISAMB_CALLS

          protected static final int MAX_DISAMB_CALLS

      The maximum number of times that disambiguate can be called before we allow an error message to be reported. Should be less than polyglot.frontend.Scheduler.MAX_RUN_COUNT, but big enough so that the largest cycle of recursive formals can be resolved. e.g., m(int{a1} a0, int{a2} a1, ...., int{a0} ak), MAX_DISAMB_CALLS would need to be bigger than k.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AmbParam_c

          public AmbParam_c(polyglot.util.Position pos,
                            polyglot.ast.Id name,
                            ParamInstance pi)

    - #### AmbParam_c

          public AmbParam_c(polyglot.util.Position pos,
                            polyglot.ast.Id name,
                            ParamInstance pi,
                            polyglot.ast.Ext ext)

  - ### Method Detail

    - #### isDisambiguated

          public boolean isDisambiguated()

      Specified by:
        `isDisambiguated` in interface `polyglot.ast.Node`
      Overrides:
        `isDisambiguated` in class `polyglot.ast.Node_c`

    - #### name

          public java.lang.String name()

    - #### name

          public AmbParam name(java.lang.String name)

    - #### name

          protected <N extends AmbParam_c> N name(N n,
                                                  java.lang.String name)

    - #### id

          public AmbParam id(polyglot.ast.Id id)

    - #### id

          protected <N extends AmbParam_c> N id(N n,
                                                polyglot.ast.Id id)

    - #### parameter

          public Param parameter()

      Specified by:
        `parameter` in interface `ParamNode`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `polyglot.ast.Node_c`

    - #### visitChildren

          public polyglot.ast.Node visitChildren(polyglot.visit.NodeVisitor v)

      Specified by:
        `visitChildren` in interface `polyglot.ast.NodeOps`
      Overrides:
        `visitChildren` in class `polyglot.ast.Node_c`

    - #### reconstruct

          protected <N extends AmbParam_c> N reconstruct(N n,
                                                         polyglot.ast.Id name)

    - #### disambiguate

          public polyglot.ast.Node disambiguate(polyglot.visit.AmbiguityRemover sc)
                                         throws polyglot.types.SemanticException

      Disambiguates `name`. If `name` is a `VarInstance`, we get a dynamic label/principal node. If `name` is a `PrincipalInstance`, we get the same principal. If `name` is a `ParamInstance`, we get a `ParamLabel` or a `ParamPrincipal`.
      Specified by:
        `disambiguate` in interface `polyglot.ast.NodeOps`
      Overrides:
        `disambiguate` in class `polyglot.ast.Node_c`
      Throws:
        `polyglot.types.SemanticException`

    - #### varToParam

          protected polyglot.ast.Node varToParam(JifVarInstance vi,
                                                 polyglot.visit.AmbiguityRemover sc)
                                          throws polyglot.types.SemanticException

      Turns a `JifVarInstance` object into a label node or a principal node
      Throws:
        `polyglot.types.SemanticException`

    - #### principalToParam

          protected polyglot.ast.Node principalToParam(PrincipalInstance vi,
                                                       polyglot.visit.AmbiguityRemover sc)

      Turns a `PrincipalInstance` object into a principal node.

    - #### paramToParam

          protected polyglot.ast.Node paramToParam(ParamInstance pi,
                                                   polyglot.visit.AmbiguityRemover sc)

      Turns a `PramaInstance` object into a label node or a principal node.