com.io7m.jpra.compiler.core.resolver

## Class JPRAResolver

- java.lang.Object
- - com.io7m.jpra.compiler.core.resolver.JPRAResolver

- All Implemented Interfaces:
    JPRAResolverType

      public final class JPRAResolver
      extends Object
      implements JPRAResolverType

  The default implementation of the `JPRAResolverType` interface.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JPRAResolverType` | `newResolver(GlobalContextType c, Optional<PackageNameQualified> in_expected_package)` Create a new resolver.
    `StatementCommandType<IdentifierType,Untyped>` | `resolveCommandType(StatementCommandType<Unresolved,Untyped> s)` Resolve a `:type` command.
    `void` | `resolveEOF(Optional<com.io7m.jlexing.core.LexicalPosition<Path>> lex)` EOF has been encountered.
    `Optional<PackageNameQualified>` | `resolveGetCurrentPackage()`
    `Map<TypeName,TypeDeclType<IdentifierType,Untyped>>` | `resolveGetCurrentTypes()`
    `StatementPackageBegin<IdentifierType,Untyped>` | `resolvePackageBegin(StatementPackageBegin<Unresolved,Untyped> s)` Resolve a package begin statement.
    `StatementPackageEnd<IdentifierType,Untyped>` | `resolvePackageEnd(StatementPackageEnd<Unresolved,Untyped> s)` Resolve a package end statement.
    `StatementPackageImport<IdentifierType,Untyped>` | `resolvePackageImport(StatementPackageImport<Unresolved,Untyped> s)` Resolve a package import statement.
    `SizeExprType<IdentifierType,Untyped>` | `resolveSizeExpression(SizeExprType<Unresolved,Untyped> expr)` Resolve a size expression.
    `TypeDeclType<IdentifierType,Untyped>` | `resolveTypeDeclaration(TypeDeclType<Unresolved,Untyped> expr)` Resolve a type declaration.
    `TypeExprType<IdentifierType,Untyped>` | `resolveTypeExpression(TypeExprType<Unresolved,Untyped> expr)` Resolve a type expression.

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

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

- - ### Method Detail

    - #### newResolver

          public static JPRAResolverType newResolver(GlobalContextType c,
                                                     Optional<PackageNameQualified> in_expected_package)

      Create a new resolver. The resolver may optionally raise errors if the package it resolves turns out not to be `in_expected_package`.
      Parameters:
        `c` - A global context
        `in_expected_package` - The expected package, if any
      Returns:
        A new resolver

    - #### resolveGetCurrentPackage

          public Optional<PackageNameQualified> resolveGetCurrentPackage()

      Specified by:
        `resolveGetCurrentPackage` in interface `JPRAResolverType`
      Returns:
        The current package name, if any

    - #### resolveGetCurrentTypes

          public Map<TypeName,TypeDeclType<IdentifierType,Untyped>> resolveGetCurrentTypes()

      Specified by:
        `resolveGetCurrentTypes` in interface `JPRAResolverType`
      Returns:
        A read-only view of the types that have been resolved in the package so far

    - #### resolvePackageBegin

          public StatementPackageBegin<IdentifierType,Untyped> resolvePackageBegin(StatementPackageBegin<Unresolved,Untyped> s)
                                                                            throws JPRACompilerResolverException

      Description copied from interface: `JPRAResolverType`
      Resolve a package begin statement.
      Specified by:
        `resolvePackageBegin` in interface `JPRAResolverType`
      Parameters:
        `s` - The statement
      Returns:
        A resolved statement
      Throws:
        `JPRACompilerResolverException` - On resolution errors

    - #### resolvePackageImport

          public StatementPackageImport<IdentifierType,Untyped> resolvePackageImport(StatementPackageImport<Unresolved,Untyped> s)
                                                                              throws JPRACompilerResolverException

      Description copied from interface: `JPRAResolverType`
      Resolve a package import statement.
      Specified by:
        `resolvePackageImport` in interface `JPRAResolverType`
      Parameters:
        `s` - The statement
      Returns:
        A resolved import statement
      Throws:
        `JPRACompilerResolverException` - On resolution errors

    - #### resolvePackageEnd

          public StatementPackageEnd<IdentifierType,Untyped> resolvePackageEnd(StatementPackageEnd<Unresolved,Untyped> s)
                                                                        throws JPRACompilerResolverException

      Description copied from interface: `JPRAResolverType`
      Resolve a package end statement.
      Specified by:
        `resolvePackageEnd` in interface `JPRAResolverType`
      Parameters:
        `s` - The statement
      Returns:
        A resolved package end statement
      Throws:
        `JPRACompilerResolverException` - On resolution errors

    - #### resolveTypeDeclaration

          public TypeDeclType<IdentifierType,Untyped> resolveTypeDeclaration(TypeDeclType<Unresolved,Untyped> expr)
                                                                      throws JPRACompilerResolverException

      Description copied from interface: `JPRAResolverType`
      Resolve a type declaration.
      Specified by:
        `resolveTypeDeclaration` in interface `JPRAResolverType`
      Parameters:
        `expr` - The input expression
      Returns:
        A type declaration
      Throws:
        `JPRACompilerResolverException` - On resolution errors

    - #### resolveTypeExpression

          public TypeExprType<IdentifierType,Untyped> resolveTypeExpression(TypeExprType<Unresolved,Untyped> expr)
                                                                     throws JPRACompilerResolverException

      Description copied from interface: `JPRAResolverType`
      Resolve a type expression.
      Specified by:
        `resolveTypeExpression` in interface `JPRAResolverType`
      Parameters:
        `expr` - The input expression
      Returns:
        A type expression
      Throws:
        `JPRACompilerResolverException` - On resolution errors

    - #### resolveSizeExpression

          public SizeExprType<IdentifierType,Untyped> resolveSizeExpression(SizeExprType<Unresolved,Untyped> expr)
                                                                     throws JPRACompilerResolverException

      Description copied from interface: `JPRAResolverType`
      Resolve a size expression.
      Specified by:
        `resolveSizeExpression` in interface `JPRAResolverType`
      Parameters:
        `expr` - The input expression
      Returns:
        A size expression
      Throws:
        `JPRACompilerResolverException` - On resolution errors

    - #### resolveCommandType

          public StatementCommandType<IdentifierType,Untyped> resolveCommandType(StatementCommandType<Unresolved,Untyped> s)
                                                                          throws JPRACompilerResolverException

      Description copied from interface: `JPRAResolverType`
      Resolve a `:type` command.
      Specified by:
        `resolveCommandType` in interface `JPRAResolverType`
      Parameters:
        `s` - A command
      Returns:
        A resolved command
      Throws:
        `JPRACompilerResolverException` - On resolution errors

    - #### resolveEOF

          public void resolveEOF(Optional<com.io7m.jlexing.core.LexicalPosition<Path>> lex)
                          throws JPRACompilerResolverException

      Description copied from interface: `JPRAResolverType`
      EOF has been encountered.
      Specified by:
        `resolveEOF` in interface `JPRAResolverType`
      Parameters:
        `lex` - Lexical information, if any
      Throws:
        `JPRACompilerResolverException` - On resolution errors

Copyright © 2017 <code@io7m.com> http://io7m.com