Commit f05dc1ec authored by thiarichey's avatar thiarichey
Browse files

Minor changes.

parent dea9cac5
......@@ -232,9 +232,9 @@ we now have many more runtime errors, as well as unbound variable and function b
Let's begin with expressions. Expressions can be a lot of things, and we won't review them
all here (although you can see LANGUAGE in HW3 for that!). Instead, let's consider the subset of
expressions consisting of integer literals, boolean literals, variable reference expressions, the `nil` literal, and if expressions. One of these is not like the others -- whereas the first four expression types are composed of literals or symbols, an if expression takes other expressions as arguments! In other words, it is a recursive expression.
expressions consisting of integer literals, boolean literals, variable reference expressions, the `nil` literal, and `if` expressions. One of these is not like the others: whereas the first four expression types are composed of literals or symbols, an `if` expression takes other expressions as arguments! In other words, it is a recursive expression.
So, we need our generator to generate more expressions, some of which will be recursive expressions and some of which will be literals or symbols. You may be able to envision a problem here -- stack overflow! We choose a reasonably small maximum depth for expressions to address this, after which point we guarantee that a nonrecursive expression will be generated. We can think of the first four expression types as our base cases.
So, we need our generator to generate more expressions, some of which will be recursive expressions and some of which will be literals or symbols. You may be able to envision a problem here: stack overflow! We choose a reasonably small maximum depth for expressions to address this, after which point we guarantee that a nonrecursive expression will be generated. We can think of the four aforementioned expression types as our base cases.
Bindings are similar to expressions, but simpler in that their arguments are nodes, symbols, or
expressions, as opposed to other (non-expression) bindings.
......@@ -248,4 +248,4 @@ valid programs, but that is not the case in our smarter Trefoil V2 programs. Con
```
When we try to look up `y` in our dynamic environment, it's not there, because we have not defined it! This represents an unbound variable error. What are some other types of errors you can think
of coming up in Trefoil V2 programs generated using the Grammar fuzzer?
\ No newline at end of file
of coming up in Trefoil V2 programs generated using the grammar fuzzer?
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment