Tidy up
This commit is contained in:
103 files changed
+3663
-3779
No files matched your search
@@ -26,7 +26,7 @@ var z;
|
||||
var w := x * y - 2
|
||||
```
|
||||
|
||||
The parser will turn this into a list of AST for declarations
|
||||
The parser will turn this into a list of ASTs for declarations
|
||||
|
||||
Then we have to use this to build a variable environment, and generate TAM code to write the values of the variables onto the stack.
|
||||
|
||||
@@ -91,7 +91,7 @@ command ::= identifier := expr
|
||||
| begin commands end
|
||||
```
|
||||
|
||||
Here: `:=`, `if`, `then`, `else`, `while`, `do`, `getint`, `printint`, `begin`, `end`, `(`, `)` are terminal
|
||||
Here: `:=`, `if`, `then`, `else`, `while`, `do`, `getint`, `printint`, `begin`, `end`, `(`, `)` are terminals
|
||||
|
||||
```haskell
|
||||
data Command =
|
||||
@@ -134,7 +134,7 @@ func :: a -> b
|
||||
|
||||
Note file name must start with a capital
|
||||
|
||||
When you import a module, can can use functions defined in the module
|
||||
When you import a module, you can use functions defined in the module
|
||||
|
||||
```haskell
|
||||
data FileType = EXP | TAM
|
||||
@@ -143,7 +143,7 @@ data Option = Trace | Run | Evaluate
|
||||
main :: IO () --input output monad
|
||||
```
|
||||
|
||||
this is the entry point, to compile
|
||||
This is the entry point; to compile:
|
||||
|
||||
```shell
|
||||
$ ghc Main.hs -o aec
|
||||
@@ -161,4 +161,3 @@ stGet = S (\s -> (s,s))
|
||||
stRevise :: (st -> st) -> ST st ()
|
||||
stRevise f = stGet >>= stUpdate . f
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user