Interface Value

All Superinterfaces:
Expr
All Known Implementing Classes:
Num

public interface Value extends Expr
Abstract class Value - The type of all Expressions which self-evaluate: Numbers, and (later, in OG3) 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 inherited from interface Expr

    PUNCTUATION
  • Method Summary

    Modifier and Type
    Method
    Description
    default Value
    Evaluate a given Expr.

    Methods inherited from interface Expr

    toString
  • Method Details

    • eval

      default Value eval()
      Description copied from interface: Expr
      Evaluate a given Expr.
      Specified by:
      eval in interface Expr
      Returns:
      the Value this Expr evaluates to. (In OG0, all values are numbers (doubles), but in OG3 that will change, which is why we have pre-emptively made the return type 'Value'.)