antlr parser

This commit is contained in:
2024-08-11 15:01:18 +02:00
parent 154e9597ae
commit b79b00e2d9
11 changed files with 104 additions and 232 deletions
+2 -11
View File
@@ -1,18 +1,9 @@
package main
import (
"fmt"
"github.com/wyst-lang/wyst/parser"
)
func main() {
code := "int x;"
ast, err := parser.ParseString(code)
if err != nil {
fmt.Printf("SyntaxErr: %s\n", err)
}
for i := 0; i < len(ast); i++ {
fmt.Printf("%s\n", ast[i])
}
tree, parser := Parse("")
iterateTree(tree, parser, 0)
}