net.sf.okapi.core.simplifierrules

## Class SimplifierRules

- java.lang.Object
- - net.sf.okapi.core.simplifierrules.SimplifierRules

- All Implemented Interfaces:
    SimplifierRulesConstants

      public class SimplifierRules
      extends java.lang.Object
      implements SimplifierRulesConstants

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Token` | `jj_nt` Next token.
    `Token` | `token` Current token.
    `SimplifierRulesTokenManager` | `token_source` Generated Token Manager.

    - ### Fields inherited from interface net.sf.okapi.core.simplifierrules.SimplifierRulesConstants

      `ADDABLE, AND, CLONEABLE, CLOSING, DATA, DEFAULT, DELETABLE, EOF, EQUAL, LPAREN, MATCH, NOT_EQUAL, NOT_MATCH, OPENING, OR, ORIGINAL_ID, OUTER_DATA, QUOTE_DOUBLE, RPAREN, RULE_END, RULE_START, STANDALONE, STRING_DOUBLE_BODY, STRING_DOUBLE_EMPTY, STRING_DOUBLE_NONEMPTY, TAG_TYPE, tokenImage, TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimplifierRules()`
    `SimplifierRules(java.io.InputStream stream)` Constructor with InputStream.
    `SimplifierRules(java.io.InputStream stream, java.lang.String encoding)` Constructor with InputStream and supplied encoding
    `SimplifierRules(java.io.Reader stream)` Constructor.
    `SimplifierRules(SimplifierRulesTokenManager tm)` Constructor with generated Token Manager.
    `SimplifierRules(java.lang.String input, Code code)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `codeString()`
    `TextFragment.TagType` | `codeTagTypeField()`
    `void` | `disable_tracing()` Disable tracing.
    `void` | `enable_tracing()` Enable tracing.
    `boolean` | `evaluate(java.lang.String input, Code code)`
    `boolean` | `expression()`
    `boolean` | `flagLiteral()`
    `ParseException` | `generateParseException()` Generate ParseException.
    `Token` | `getNextToken()` Get the next Token.
    `Token` | `getToken(int index)` Get the specific Token.
    `static void` | `main(java.lang.String[] args)`
    `boolean` | `parse()`
    `java.lang.String` | `queryString()`
    `void` | `ReInit(java.io.InputStream stream)` Reinitialise.
    `void` | `ReInit(java.io.InputStream stream, java.lang.String encoding)` Reinitialise.
    `void` | `ReInit(java.io.Reader stream)` Reinitialise.
    `void` | `ReInit(SimplifierRulesTokenManager tm)` Reinitialise.
    `boolean` | `rules()` All rules are OR'ed with each other to get the final result.
    `TextFragment.TagType` | `tagTypeLiteral()`
    `boolean` | `term()`
    `boolean` | `trace_enabled()` Trace enabled.
    `static void` | `validate(java.lang.String rules)`

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

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

- - ### Field Detail

    - #### token_source

          public SimplifierRulesTokenManager token_source

      Generated Token Manager.

    - #### token

          public Token token

      Current token.

    - #### jj_nt

          public Token jj_nt

      Next token.

  - ### Constructor Detail

    - #### SimplifierRules

          public SimplifierRules()

    - #### SimplifierRules

          public SimplifierRules(java.lang.String input,
                                 Code code)

    - #### SimplifierRules

          public SimplifierRules(java.io.InputStream stream)

      Constructor with InputStream.

    - #### SimplifierRules

          public SimplifierRules(java.io.InputStream stream,
                                 java.lang.String encoding)

      Constructor with InputStream and supplied encoding

    - #### SimplifierRules

          public SimplifierRules(java.io.Reader stream)

      Constructor.

    - #### SimplifierRules

          public SimplifierRules(SimplifierRulesTokenManager tm)

      Constructor with generated Token Manager.

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)

    - #### validate

          public static final void validate(java.lang.String rules)
                                     throws ParseException

      Throws:
        `ParseException`

    - #### evaluate

          public boolean evaluate(java.lang.String input,
                                  Code code)
                           throws ParseException

      Throws:
        `ParseException`

    - #### parse

          public boolean parse()
                        throws ParseException

      Throws:
        `ParseException`

    - #### rules

          public final boolean rules()
                              throws ParseException

      All rules are OR'ed with each other to get the final result. Short circuit and return early if any rule evaluates to true
      Throws:
        `ParseException`

    - #### expression

          public final boolean expression()
                                   throws ParseException

      Throws:
        `ParseException`

    - #### term

          public final boolean term()
                             throws ParseException

      Throws:
        `ParseException`

    - #### codeString

          public final java.lang.String codeString()
                                            throws ParseException

      Throws:
        `ParseException`

    - #### codeTagTypeField

          public final TextFragment.TagType codeTagTypeField()
                                                      throws ParseException

      Throws:
        `ParseException`

    - #### tagTypeLiteral

          public final TextFragment.TagType tagTypeLiteral()
                                                    throws ParseException

      Throws:
        `ParseException`

    - #### flagLiteral

          public final boolean flagLiteral()
                                    throws ParseException

      Throws:
        `ParseException`

    - #### queryString

          public final java.lang.String queryString()
                                             throws ParseException

      Throws:
        `ParseException`

    - #### ReInit

          public void ReInit(java.io.InputStream stream)

      Reinitialise.

    - #### ReInit

          public void ReInit(java.io.InputStream stream,
                             java.lang.String encoding)

      Reinitialise.

    - #### ReInit

          public void ReInit(java.io.Reader stream)

      Reinitialise.

    - #### ReInit

          public void ReInit(SimplifierRulesTokenManager tm)

      Reinitialise.

    - #### getNextToken

          public final Token getNextToken()

      Get the next Token.

    - #### getToken

          public final Token getToken(int index)

      Get the specific Token.

    - #### generateParseException

          public ParseException generateParseException()

      Generate ParseException.

    - #### trace_enabled

          public final boolean trace_enabled()

      Trace enabled.

    - #### enable_tracing

          public final void enable_tracing()

      Enable tracing.

    - #### disable_tracing

          public final void disable_tracing()

      Disable tracing.