Interface Value

All Known Implementing Classes:
Num

public interface Value
Abstract class Value - The type of all Expressions which self-evaluate: Numbers, and (later, in E3) functions. See http://www.radford.edu/itec380/2022fall-ibarland/Homeworks/Project/ (This architecture works as long as every Value is a type of Expression, which is a nice feature to have in a language; it means that any result can be pasted/substituted into larger expressions, which promotes a substitution model of evaluation.)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default Value
     
    Return a String representation of this Expr.
  • Field Details

  • Method Details

    • eval

      default Value eval()
    • toString

      String toString()
      Return a String representation of this Expr. The result will be something which can be passed into 'parse(String)' to get the same Expr back. That is, toString and parse are inverses of each other.
      Overrides:
      toString in class Object
      Returns:
      a String representation of this Expr.