Class Translet.SequParser<R,A,B,C,D,E,F,G,H>

java.lang.Object
eu.bandm.tscore.base.Translet.Parser<R>
eu.bandm.tscore.base.Translet.ProductParser<R,A,B,C,D,E,F,G,H>
eu.bandm.tscore.base.Translet.SequParser<R,A,B,C,D,E,F,G,H>
Enclosing class:
Translet

public static class Translet.SequParser<R,A,B,C,D,E,F,G,H> extends Translet.ProductParser<R,A,B,C,D,E,F,G,H>
Variant of Translet.ProductParser which accepts a certain sequence of sub-parsers.
  • Constructor Details

  • Method Details

    • unparse

      public String unparse(Object key)
      Description copied from class: Translet.Parser
      Reverse the parsing process (as far as possible) and deliver a string representation which when parsed delivered the parse result.
      Specified by:
      unparse in class Translet.Parser<R>
    • collectResults

      protected Object[] collectResults(Translet.State<?> s, List<Set<? extends Translet.State<?>>> afterSubRess)
      Returns the arguments for function application for one particular result Translet.State by searching the chain of predecessor states and cutting them with those related to the sub-parsers in the different positions in "afterSubRess".
    • parseOneState

      public Set<Translet.State<R>> parseOneState(Translet.State<?> inState, Set<Translet.Alternative> alternatives)
      Parse breadth-first the list of sub-parsers and memorize all resulting states for later result retrieval. Whenever the "arity" is reached, collect the results of these states and apply the function/constructor.
      Specified by:
      parseOneState in class Translet.Parser<R>
    • name

      public Format name(boolean full, Map<Translet.Recursive,String> names)
      Description copied from class: Translet.Parser
      Returns a user-readable text representation. This is in most cases, but not always, source text to construct the parser.
      Specified by:
      name in class Translet.Parser<R>
      Parameters:
      full - whether storage constructs do appear in the rendering.
      names - a map for managing the renderings of recursive calls