Class InternalSchema

java.lang.Object
com.mackenziehigh.sexpr.internal.schema.InternalSchema

public final class InternalSchema extends Object
An instance of this class is a pattern that describes a symbolic-expression.
  • Constructor Details

    • InternalSchema

      public InternalSchema()
      Sole Constructor.
  • Method Details

    • defineRoot

      public void defineRoot(String root)
      Use this method to specify the root rule of this schema.
      Parameters:
      root - is the name of the root rule.
    • defineCondition

      public void defineCondition(String name, Predicate<Sexpr<?>> condition)
      This method defines a condition that can be referenced by a 'require' rule.
      Parameters:
      name - is the name of the user-defined condition.
      condition - is the user-defined condition itself.
    • definePass

      public void definePass(String name)
    • defineBeforeAction

      public void defineBeforeAction(String pass, String rule, Consumer<Sexpr<?>> action)
    • defineAfterAction

      public void defineAfterAction(String pass, String rule, Consumer<Sexpr<?>> action)
    • match

      public Schema.Match match(Sexpr tree)
      This method performs a match-attempt.
      Parameters:
      tree - is the symbolic-expression that this schema may match.
      Returns:
      an object describing the result.
    • validate

      public void validate()