kiama.example.lambda2

trait Evaluator

[source: kiama/example/lambda2/Evaluator.scala]

trait Evaluator
extends AnyRef
Interface for a lambda2 evaluator.
Direct Known Subclasses:
RewritingEvaluator

Method Summary
abstract def eval (exp : Exp) : Exp
Evaluate the given expression, returning the result of the evaluation if it succeeded, or exp if it failed.
def reducesinlambdas : Boolean
Whether this mechanism evaluates inside lambdas. Used for testing. Default: false.
def substitute (x : java.lang.String, e2 : Exp, e1 : Exp) : Exp
Capture-free substitution of free occurrences of x in e1 with e2.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Object Summary
object freshvar extends AnyRef
Generate a fresh variable name. Prefix the name with an underscore to avoid the potential for clashes with user-level varaibles (which must start with a letter).
Method Details
abstract def eval(exp : Exp) : Exp
Evaluate the given expression, returning the result of the evaluation if it succeeded, or exp if it failed.

def reducesinlambdas : Boolean
Whether this mechanism evaluates inside lambdas. Used for testing. Default: false.

def substitute(x : java.lang.String, e2 : Exp, e1 : Exp) : Exp
Capture-free substitution of free occurrences of x in e1 with e2.