boolean/cmd/eval/main.go

26 lines
414 B
Go

package main
import (
"git.metznet.ca/MetzNet/boolean"
"fmt"
"bufio"
"os"
"strings"
)
func main() {
if len(os.Args) < 2 {
return
}
stream := bufio.NewReader(strings.NewReader(os.Args[1]))
token_stream, err := boolean.Tokenize(stream)
if err != nil {
panic(err)
}
expr, err := boolean.ParseExpr(token_stream)
if err != nil {
panic(err)
}
fmt.Printf("Expr: %s\n", expr)
}