Package memely

Class ExpressionParser

java.lang.Object
memely.ExpressionParser

public class ExpressionParser
extends Object
  • Constructor Details

  • Method Details

    • main

      public static void main​(String[] args) throws edu.mit.eecs.parserlib.UnableToParseException
      Main method. Parses and then reprints an example expression.
      Parameters:
      args - command line arguments, not used
      Throws:
      edu.mit.eecs.parserlib.UnableToParseException - if example expression can't be parsed
    • parse

      public static Expression parse​(String string) throws edu.mit.eecs.parserlib.UnableToParseException
      Parse a string into an expression.
      Parameters:
      string - string to parse
      Returns:
      Expression parsed from the string
      Throws:
      edu.mit.eecs.parserlib.UnableToParseException - if the string doesn't match the Expression grammar