Package monq.jfa

Class ReClassicParser

java.lang.Object
monq.jfa.ReClassicParser
All Implemented Interfaces:
ReParser

public class ReClassicParser extends Object implements ReParser

Implements the regular expression syntax classically used by monq.jfa.

  • Constructor Details

    • ReClassicParser

      public ReClassicParser()
    • ReClassicParser

      public ReClassicParser(CharUnaryOperator chMap)
      Creates the parser with the given character map. The most commonly used mapping is probably Character::toLowerCase.
      Parameters:
      chMap - to map characters during parsing
  • Method Details

    • getChMap

      public CharUnaryOperator getChMap()
      Specified by:
      getChMap in interface ReParser
    • parse

      public void parse(NfaBuilder<?> builder, CharSequence s) throws ReSyntaxException
      Description copied from interface: ReParser

      Parses regex while building up the automaton in the builder.

      Specified by:
      parse in interface ReParser
      Throws:
      ReSyntaxException
    • specialChars

      public String specialChars()
      Description copied from interface: ReParser

      provides all characters that have a special meaning for this parser

      Specified by:
      specialChars in interface ReParser
    • escape

      public void escape(StringBuilder out, CharSequence cin, int startAt)
      Description copied from interface: ReParser

      starting with the character at startAt the given CharSequence is copied to out while all characters with special meaning for this parser are suitably escaped. The result can be used as a regular expression that matches exactly the input sequence.

      Specified by:
      escape in interface ReParser