- 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.Blockand returns the value.expression(Stmt.Expression stmt) Executes anStmt.Expressionstatement and returns the value.function(Stmt.Function stmt) Executes aStmt.Functionstatement and returns the value.Executes anStmt.Ifstatement and returns the value.returnVisit(Stmt.Return stmt) Executes aStmt.Returnstatement and returns the value.Executes aStmt.Valstatement and returns the value.Executes aStmt.Varstatement and returns the value.whileVisit(Stmt.While stmt) Executes aStmt.Whilestatement and returns the value.
-
Method Details
-
function
Executes aStmt.Functionstatement and returns the value.- Parameters:
stmt- theStmt.Functionstatement- Returns:
- the evaluated value
-
var
Executes aStmt.Varstatement and returns the value.- Parameters:
stmt- theStmt.Varstatement- Returns:
- the evaluated value
-
val
Executes aStmt.Valstatement and returns the value.- Parameters:
stmt- theStmt.Valstatement- Returns:
- the evaluated value
-
expression
Executes anStmt.Expressionstatement and returns the value.- Parameters:
stmt- theStmt.Expressionstatement- Returns:
- the evaluated value
-
ifVisit
Executes anStmt.Ifstatement and returns the value.- Parameters:
stmt- theStmt.Ifstatement- Returns:
- the evaluated value
-
returnVisit
Executes aStmt.Returnstatement and returns the value.- Parameters:
stmt- theStmt.Returnstatement- Returns:
- the evaluated value
-
whileVisit
Executes aStmt.Whilestatement and returns the value.- Parameters:
stmt- theStmt.Whilestatement- Returns:
- the evaluated value
-
block
Executes aStmt.Blockand returns the value.- Parameters:
stmt- theStmt.Blockstatement- Returns:
- the evaluated value
-