2013-02-25 21:25:25 -08:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2013-02-28 22:49:34 -08:00
|
|
|
"fmt"
|
|
|
|
|
"io/ioutil"
|
|
|
|
|
"os"
|
2013-02-25 21:25:25 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2013-02-28 22:49:34 -08:00
|
|
|
input, _ := ioutil.ReadAll(os.Stdin)
|
2013-02-26 22:41:25 -08:00
|
|
|
|
|
|
|
|
// TEST LEXING
|
|
|
|
|
//_, tokens := lex(string(input))
|
|
|
|
|
//for t := range tokens {
|
|
|
|
|
//fmt.Printf("%s %s\n", t.typ, t.val)
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
// TEST PARSING
|
2013-02-28 22:49:34 -08:00
|
|
|
rs := parse(string(input), "<stdin>")
|
|
|
|
|
fmt.Println(rs)
|
2013-02-26 22:41:25 -08:00
|
|
|
|
|
|
|
|
// TEST STRING EXPANSION
|
2013-02-28 22:49:34 -08:00
|
|
|
//rules := &ruleSet{make(map[string][]string), make([]rule, 0)}
|
|
|
|
|
//println(rules.expand("\"This is a quote: \\\"\""))
|
2013-02-25 21:25:25 -08:00
|
|
|
}
|