Package edu.wisc.game.parser

## Interface Expression

- All Known Subinterfaces:
    `Expression.ArithmeticExpression`
  All Known Implementing Classes:
    `Expression.AdditiveExpression`, `Expression.BracketList`, `Expression.ColonExpression`, `Expression.ComparisonExpression`, `Expression.ExList`, `Expression.Id`, `Expression.MultiplicativeExpression`, `Expression.NegationExpression`, `Expression.Num`, `Expression.ParenList`, `Expression.QualifiedId`, `Expression.RangeExpression`, `Expression.SerialExpression`, `Expression.Star`

      public interface Expression

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `Expression.AdditiveExpression` |
    `static interface` | `Expression.ArithmeticExpression` | An arithmetic expression is composed of variables, constants, and arithmetic operations; parentheses can be used for ordering operations.
    `static class` | `Expression.BracketList` |
    `static class` | `Expression.ColonExpression` | Id:ArithmeticExpression; used in GS 3
    `static class` | `Expression.ComparisonExpression` | Has exactly two operands, and the operator is one of '==', '!=', '<=', '>', etc
    `static class` | `Expression.ExList` | Can be overridden as needed
    `static class` | `Expression.Id` | A variable.
    `static interface` | `Expression.Mapper` | A Mapper is something that can take a variable (Expression.Id) and produce another Expression (e.g.
    `static class` | `Expression.MapTo<T>` | A HashMap storing a set of values of a given type T for each key
    `static class` | `Expression.MultiplicativeExpression` |
    `static class` | `Expression.NegationExpression` | !E evaluates to [1] if E is an empty set, or to [] otherwise
    `static class` | `Expression.Num` | A numeric constant
    `static class` | `Expression.ParenList` |
    `static class` | `Expression.PropMap` | Values are String or Integer
    `static class` | `Expression.QualifiedId` | A.B
    `static class` | `Expression.RangeExpression` | [Num..Num]
    `static class` | `Expression.SerialExpression` | Additive or multiplicative
    `static class` | `Expression.Star` | A Star expression is simply "*".
    `static class` | `Expression.VarMap` |
    `static class` | `Expression.VarMap2` | Objects in question may be Integer, String, or PropMap (ImageObject or equivalent)

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Expression.Star` | `STAR` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Expression` | `map​(Expression.Mapper mapper)` |
    `static Expression.BracketList` | `mkBracketList​(Vector<Token> tokens)` |
    `static Expression` | `mkCounterOrAtom​(Vector<Token> tokens)` | Extracts one of the sections of a rule line: either the leading counter (int or star), or one of the atoms (paren lists that may include arithmetic expressions or stars)
    `static Expression.ArithmeticExpression` | `mkLongestArithmeticExpression​(Vector<Token> tokens)` | Creates the longest ArithmeticExpression starting at the beginning of the tokens array.
    `static Expression.ArithmeticExpression` | `mkLongestE1​(Vector<Token> tokens)` | E1 := (E) | Id.Id | Id | Num | -Num | [E,E,...]
    `static Expression.ArithmeticExpression` | `mkLongestE2​(Vector<Token> tokens)` | E2 := E1 | !E2
    `static Expression.ArithmeticExpression` | `mkLongestE3​(Vector<Token> tokens)` | E3 := E2 | E2*E2...
    `static Expression.ArithmeticExpression` | `mkLongestE4​(Vector<Token> tokens)` |
    `static Expression.ArithmeticExpression` | `mkLongestE5​(Vector<Token> tokens)` |
    `static Expression.RangeExpression` | `mkRangeExpression​(Vector<Token> tokens)` | If the given sequence of tokens starts with a range expression, extracts it; otherwise, returns null
    `static HashSet<Integer>` | `moduloNB​(Set<Integer> h0)` | Translates all elements of the set to the [0..NBU-1] range, as appropriate for bucket numbers
    `static HashSet<Integer>` | `moduloNB2​(Set<Object> h0)` |
    `static Integer` | `toInteger​(Object o)` |
    `String` | `toSrc()` |

- - ### Field Detail

    - #### STAR

          static final Expression.Star STAR

  - ### Method Detail

    - #### toInteger

          static Integer toInteger​(Object o)

    - #### map

          Expression map​(Expression.Mapper mapper)
                  throws RuleParseException

      Throws:
        `RuleParseException`

    - #### toSrc

          String toSrc()

    - #### mkCounterOrAtom

          static Expression mkCounterOrAtom​(Vector<Token> tokens)
                                     throws RuleParseException

      Extracts one of the sections of a rule line: either the leading counter (int or star), or one of the atoms (paren lists that may include arithmetic expressions or stars)
      Throws:
        `RuleParseException`

    - #### mkRangeExpression

          static Expression.RangeExpression mkRangeExpression​(Vector<Token> tokens)
                                                       throws RuleParseException

      If the given sequence of tokens starts with a range expression, extracts it; otherwise, returns null
      Throws:
        `RuleParseException`

    - #### mkLongestArithmeticExpression

          static Expression.ArithmeticExpression mkLongestArithmeticExpression​(Vector<Token> tokens)
                                                                        throws RuleParseException

      Creates the longest ArithmeticExpression starting at the beginning of the tokens array.

                  E := E5
                  E5 :=  E4  |  E4==E4
                  E4 :=  E3  |  E3+E3+...
                  E3 :=  E2  |  E2*E2...
                  E2 :=  E1  |  !E2
                  E1 :=  (E)  |  Id.Id | Id  | Num |  [E4,E4,...]

      Throws:
        `RuleParseException`

    - #### mkLongestE5

          static Expression.ArithmeticExpression mkLongestE5​(Vector<Token> tokens)
                                                      throws RuleParseException

      Throws:
        `RuleParseException`

    - #### mkLongestE4

          static Expression.ArithmeticExpression mkLongestE4​(Vector<Token> tokens)
                                                      throws RuleParseException

      Throws:
        `RuleParseException`

    - #### mkLongestE3

          static Expression.ArithmeticExpression mkLongestE3​(Vector<Token> tokens)
                                                      throws RuleParseException

      E3 := E2 | E2*E2...
      Throws:
        `RuleParseException`

    - #### mkLongestE2

          static Expression.ArithmeticExpression mkLongestE2​(Vector<Token> tokens)
                                                      throws RuleParseException

      E2 := E1 | !E2
      Throws:
        `RuleParseException`

    - #### mkLongestE1

          static Expression.ArithmeticExpression mkLongestE1​(Vector<Token> tokens)
                                                      throws RuleParseException

      E1 := (E) | Id.Id | Id | Num | -Num | [E,E,...]
      Throws:
        `RuleParseException`

    - #### mkBracketList

          static Expression.BracketList mkBracketList​(Vector<Token> tokens)
                                               throws RuleParseException

      Throws:
        `RuleParseException`

    - #### moduloNB

          static HashSet<Integer> moduloNB​(Set<Integer> h0)

      Translates all elements of the set to the [0..NBU-1] range, as appropriate for bucket numbers

    - #### moduloNB2

          static HashSet<Integer> moduloNB2​(Set<Object> h0)