Sketching out the parser.
This commit is contained in:
parent
9ba796161d
commit
d129ff285c
5 changed files with 258 additions and 18 deletions
14
mk.go
14
mk.go
|
|
@ -2,23 +2,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func main() {
|
||||
input, _ := ioutil.ReadAll(os.Stdin)
|
||||
l, tokens := lex(string(input))
|
||||
|
||||
for t := range tokens {
|
||||
if t.typ == tokenError {
|
||||
fmt.Printf("Error: %s", l.errmsg)
|
||||
break
|
||||
}
|
||||
|
||||
fmt.Println(t.String())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue