summaryrefslogtreecommitdiff
path: root/src/main.go
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-06-28 14:30:45 -0400
committerKyle Gunger <corechg@gmail.com>2020-06-28 14:30:45 -0400
commit8f9cf0d4856bb53009bb58b53a42e21e2cd1e947 (patch)
treeb022091a0c3105e2da54b9dc16e5f55852b788f3 /src/main.go
[Initial parser] Upload existing
Diffstat (limited to 'src/main.go')
-rw-r--r--src/main.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main.go b/src/main.go
new file mode 100644
index 0000000..ec3b14b
--- /dev/null
+++ b/src/main.go
@@ -0,0 +1,24 @@
+package main
+
+import "fmt"
+import "tparse"
+import "flag"
+import "os"
+
+func main() {
+ inputFile := flag.String("in", "", "The file to parse")
+ outputFile := flag.String("out", "out.tnp", "The file to store the parse in")
+
+ flag.Parse()
+
+ fd, err := os.Create(*outputFile)
+
+ if err != nil {
+ fmt.Println(err.Error())
+ return
+ }
+
+ fd.WriteString(fmt.Sprint(tparse.ParseFile(*inputFile)))
+
+ fd.Close()
+}