Class Reader

java.lang.Object
convex.core.lang.Reader

public class Reader extends Object
Parboiled Parser implementation which reads source code and produces a tree of parsed objects. Supports reading in either raw form (ACell) mode or wrapping with Syntax Objects. The latter is required for source references etc. "Talk is cheap. Show me the code." - Linus Torvalds
  • Constructor Details

    • Reader

      public Reader()
  • Method Details

    • readSyntax

      public static Syntax readSyntax(String source)
      Parses an expression and returns a Syntax object
      Parameters:
      source -
      Returns:
      Parsed form
    • readResource

      public static ACell readResource(String path)
    • readResourceAsData

      public static ACell readResourceAsData(String path) throws IOException
      Throws:
      IOException
    • readAll

      public static AList<ACell> readAll(String source)
      Parses an expression list and returns a list of raw forms
      Parameters:
      source -
      Returns:
      List of Syntax Objects
    • read

      public static ACell read(Reader source) throws IOException
      Parses an expression and returns a form as an Object
      Parameters:
      source -
      Returns:
      Parsed form
      Throws:
      IOException
    • read

      public static <R extends ACell> R read(String source)
      Parses an expression and returns a form
      Parameters:
      source -
      Returns:
      Parsed form