Class Translet.Alternative

java.lang.Object
eu.bandm.tscore.base.Translet.Alternative
Enclosing class:
Translet

protected static class Translet.Alternative extends Object
Realizes a protocol tree of alternatives to the parsing results. An instance is newly constructed for every unsuccessful attempt to apply a particular parser in a particular state. (In method Translet.Parser.mparse(Set,Set).) This is meant as a diagnostic hint for the (domain expert) user, at which earlier positions in the input a possible parser had been missed and where thus a typo/mis-spelling in the input data could have happened. The set of alteratives is passed in parallel to the current (valid) input state, and when testing the subsequent parsers, these will not only be tested but also be appended to expected by calling append(Translet.Parser).
  • Field Details

    • pre

      protected Translet.State<?> pre
      The parsing state in which these alternatives have been considered. (This field is always != null becaouse there is always a simple state for the start). FIXME STIMMT DAS ??
    • expected

      protected List<Translet.Parser<?>> expected
      All parsers which have been tested to continue the state.
  • Constructor Details

  • Method Details

    • append

      protected void append(Translet.Parser<?> parser)
      Add a further parser as alternative to continue this state.