Class Parsers


  • public class Parsers
    extends java.lang.Object
    Utility class for common helpful parsers.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Parser<java.lang.Character> fixedChar​(char terminal)
      Construct a parser which looks for a fixed char in the input.
      static Parser<java.lang.String> fixedString​(java.lang.String terminal)
      Construct a parser which looks for a fixed string in the input.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fixedString

        public static Parser<java.lang.String> fixedString​(java.lang.String terminal)
        Construct a parser which looks for a fixed string in the input.
        Parameters:
        terminal - The string to look for.
        Returns:
        A parser which returns the string that it matched.
      • fixedChar

        public static Parser<java.lang.Character> fixedChar​(char terminal)
        Construct a parser which looks for a fixed char in the input.
        Parameters:
        terminal - The char to look for.
        Returns:
        A parser which returns the char that it matched.