Enum Class Parser.Pragma

java.lang.Object
java.lang.Enum<Parser.Pragma>
eu.bandm.tools.ramus.ogma.Parser.Pragma
All Implemented Interfaces:
Serializable, Comparable<Parser.Pragma>, java.lang.constant.Constable
Enclosing class:
Parser<D,T>

public static enum Parser.Pragma extends Enum<Parser.Pragma>
Enumeration of local pragmatic modifiers of parsing behavior.
  • Enum Constant Details

    • Greedy

      public static final Parser.Pragma Greedy
      Specifies that a preferred alternative should be taken if predicted by the next token, and others ignored.
    • Productive

      public static final Parser.Pragma Productive
      Specifies that given parsers are asserted not to succeed without consuming any input tokens.
    • Disjoint

      public static final Parser.Pragma Disjoint
      Specifies that given parsers are asserted to have mutually exclusive predictors.
    • Reachable

      public static final Parser.Pragma Reachable
      Specifies that given parsers are asserted to be combined in a way such that they can actually succeed for some input.
  • Field Details

  • Method Details

    • values

      public static Parser.Pragma[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Parser.Pragma valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isOneOf

      public boolean isOneOf(Parser.Pragma... pragmas)
      Checks whether this pragma is included in the given array.
      Parameters:
      pragmas - an array of pragmas
      Returns:
      true if the array pragmas has an element that is identical to this, false otherwise
      Throws:
      NullPointerException - if pragmas is null
    • isOneOf

      public boolean isOneOf(Collection<Parser.Pragma> pragmas)
      Checks whether this pragma is included in the given collection.
      Parameters:
      pragmas - a collection of pragmas
      Returns:
      true if the array pragmas has an element that is identical to this, false otherwise
      Throws:
      NullPointerException - if pragmas is null
    • isOneOf

      public boolean isOneOf(Collection<Parser.Pragma> globalPragmas, Parser.Pragma... localPragmas)
    • excludeFrom

      public Parser.Pragma[] excludeFrom(Parser.Pragma... pragmas)
      Returns a modified copy of a given array of pragmas that excludes this pragma.
      Parameters:
      pragmas - an array of pragmas
      Returns:
      an array of pragmas that contains all elements of pragmas that are not identical to this
      Throws:
      NullPointerException - if pragmas is null