- Type Parameters:
R
- the return type of the executed statement
- Enclosing interface:
- Stmt
public static interface Stmt.Visitor<R>
Defines operations for the various
Stmt
implementations.-
Method Summary
Modifier and TypeMethodDescriptionblock
(Stmt.Block stmt) Executes aStmt.Block
and returns the value.expression
(Stmt.Expression stmt) Executes anStmt.Expression
statement and returns the value.function
(Stmt.Function stmt) Executes aStmt.Function
statement and returns the value.Executes anStmt.If
statement and returns the value.returnVisit
(Stmt.Return stmt) Executes aStmt.Return
statement and returns the value.Executes aStmt.Val
statement and returns the value.Executes aStmt.Var
statement and returns the value.whileVisit
(Stmt.While stmt) Executes aStmt.While
statement and returns the value.
-
Method Details
-
function
Executes aStmt.Function
statement and returns the value.- Parameters:
stmt
- theStmt.Function
statement- Returns:
- the evaluated value
-
var
Executes aStmt.Var
statement and returns the value.- Parameters:
stmt
- theStmt.Var
statement- Returns:
- the evaluated value
-
val
Executes aStmt.Val
statement and returns the value.- Parameters:
stmt
- theStmt.Val
statement- Returns:
- the evaluated value
-
expression
Executes anStmt.Expression
statement and returns the value.- Parameters:
stmt
- theStmt.Expression
statement- Returns:
- the evaluated value
-
ifVisit
Executes anStmt.If
statement and returns the value.- Parameters:
stmt
- theStmt.If
statement- Returns:
- the evaluated value
-
returnVisit
Executes aStmt.Return
statement and returns the value.- Parameters:
stmt
- theStmt.Return
statement- Returns:
- the evaluated value
-
whileVisit
Executes aStmt.While
statement and returns the value.- Parameters:
stmt
- theStmt.While
statement- Returns:
- the evaluated value
-
block
Executes aStmt.Block
and returns the value.- Parameters:
stmt
- theStmt.Block
statement- Returns:
- the evaluated value
-