Class BNFParser

java.lang.Object
redempt.redlex.bnf.BNFParser

public class BNFParser extends Object
A parser used to create lexers from BNF files
  • Constructor Details

    • BNFParser

      public BNFParser()
  • Method Details

    • createLexer

      public static Lexer createLexer(String input)
      Parses the input String and returns a Lexer
      Parameters:
      input - The input String defining the format for the Lexer
      Returns:
      A Lexer for the given format
    • createLexer

      public static Lexer createLexer(Path path)
      Parses the input String and returns a Lexer
      Parameters:
      path - The path to a file containing the format for the Lexer
      Returns:
      A Lexer for the given format
    • createLexer

      public static Lexer createLexer(InputStream stream)
      Parses the input String and returns a Lexer
      Parameters:
      stream - The InputStream the bnf contents can be read from
      Returns:
      A Lexer for the given format