org.eclipse.incquery.runtime.matchers.psystem.rewriters

## Class PBodyNormalizer

- java.lang.Object
- - org.eclipse.incquery.runtime.matchers.psystem.rewriters.PDisjunctionRewriter
  - - org.eclipse.incquery.runtime.matchers.psystem.rewriters.PBodyNormalizer

-     public class PBodyNormalizer
      extends PDisjunctionRewriter

  A disjunction rewriter for creating a normalized form of specification, unifying variables and running basic sanity checks. This rewriter does not copy but modifies directly the original specification, requiring a mutable disjunction.
  Author:
    Gabor Bergmann

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `calcImpliedTypes` If set to true, shrinks the net by avoiding unnecessary typechecks

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PBodyNormalizer(IQueryMetaContext context)`
    `PBodyNormalizer(IQueryMetaContext context, boolean calculateImpliedTypes)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PBody` | `normalizeBody(PBody body)` Provides a normalized version of the pattern body.
    `PDisjunction` | `rewrite(PDisjunction disjunction)`
    `void` | `setContext(IQueryMetaContext context)`

    - ### Methods inherited from class org.eclipse.incquery.runtime.matchers.psystem.rewriters.PDisjunctionRewriter

      `rewrite`

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

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

- - ### Field Detail

    - #### calcImpliedTypes

          public boolean calcImpliedTypes

      If set to true, shrinks the net by avoiding unnecessary typechecks

  - ### Constructor Detail

    - #### PBodyNormalizer

          public PBodyNormalizer(IQueryMetaContext context)

    - #### PBodyNormalizer

          public PBodyNormalizer(IQueryMetaContext context,
                                 boolean calculateImpliedTypes)

      Parameters:
        `calculateImpliedTypes` - If set to true, shrinks the net by avoiding unnecessary typechecks

  - ### Method Detail

    - #### rewrite

          public PDisjunction rewrite(PDisjunction disjunction)
                               throws RewriterException

      Specified by:
        `rewrite` in class `PDisjunctionRewriter`
      Throws:
        `RewriterException`

    - #### setContext

          public void setContext(IQueryMetaContext context)

    - #### normalizeBody

          public PBody normalizeBody(PBody body)
                              throws RewriterException

      Provides a normalized version of the pattern body. May return a different version than the original version if needed.
      Parameters:
        `body` -
      Throws:
        `RewriterException`