Interface Expr
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioneval()
Evaluate a given Expr.static Expr
Return (our internal representation of) the first expression in s.static Expr
Return (our internal representation of) the first expression in s.static Expr
Return (our internal representation of) the first expression in s.toString()
Return a String representation of this Expr.
-
Field Details
-
PUNCTUATION
- See Also:
-
-
Method Details
-
eval
Value eval()Evaluate a given 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'.)
-
toString
-
parse
-
parse
Return (our internal representation of) the first expression in s. Side-effect: consume *exactly* the chars of that expr from the front of `s`.- Parameters:
s
- A scanner starting with the source code for an Expr.- Returns:
- (our internal representation of) the expression at front of `s`.
-
parse
Return (our internal representation of) the first expression in s. Side-effect: consume *exactly* the chars of that expr from the front of `s`.- Parameters:
s
- A scanner starting with the source code for an Expr.punctuation
- A string of the chars to be interpreted as puncutation (*and* not part larger tokens).- Returns:
- (our internal representation of) the expression at front of `s`.
-