summaryrefslogtreecommitdiffstats
path: root/src/com/craftinginterpreters/tool
diff options
context:
space:
mode:
authorGravatar Tom Willemse2020-11-25 23:10:58 -0800
committerGravatar Tom Willemse2020-11-25 23:10:58 -0800
commitca9fd3ae3a1ef5ca1fbe33a83abb12e656a2556f (patch)
tree77d16c7e6b87ed0f4472f6a421eeb9496d6f33bc /src/com/craftinginterpreters/tool
parent57e87978ef416ce2898a65a9b67e37be91263e67 (diff)
downloadcrafting-interpreters-ca9fd3ae3a1ef5ca1fbe33a83abb12e656a2556f.tar.gz
crafting-interpreters-ca9fd3ae3a1ef5ca1fbe33a83abb12e656a2556f.zip
Chapter 8: Add blocks and scopes
Diffstat (limited to 'src/com/craftinginterpreters/tool')
-rw-r--r--src/com/craftinginterpreters/tool/GenerateAst.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/craftinginterpreters/tool/GenerateAst.java b/src/com/craftinginterpreters/tool/GenerateAst.java
index f96e315..c9f1398 100644
--- a/src/com/craftinginterpreters/tool/GenerateAst.java
+++ b/src/com/craftinginterpreters/tool/GenerateAst.java
@@ -15,10 +15,11 @@ public class GenerateAst {
String outputDir = args[0];
defineAst(outputDir, "Expr",
- Arrays.asList("Assign : Token name, Expr value", "Binary : Expr left, Token operator, Expr right", "Grouping : Expr expression",
- "Literal : Object value", "Unary : Token operator, Expr right", "Variable : Token name"));
- defineAst(outputDir, "Stmt", Arrays.asList("Expression : Expr expression", "Print : Expr expression",
- "Var : Token name, Expr initializer"));
+ Arrays.asList("Assign : Token name, Expr value", "Binary : Expr left, Token operator, Expr right",
+ "Grouping : Expr expression", "Literal : Object value", "Unary : Token operator, Expr right",
+ "Variable : Token name"));
+ defineAst(outputDir, "Stmt", Arrays.asList("Block : List<Stmt> statements", "Expression : Expr expression",
+ "Print : Expr expression", "Var : Token name, Expr initializer"));
}
private static void defineAst(String outputDir, String baseName, List<String> types) throws IOException {