Skip to content

Commit

Permalink
parser skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
lamg committed Dec 28, 2024
1 parent a6a292f commit 7089e49
Show file tree
Hide file tree
Showing 9 changed files with 1,556 additions and 2,306 deletions.
14 changes: 12 additions & 2 deletions go/internal/antlr4_sqlite_parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@

- Download Antlr4 https://www.antlr.org/download.html

Generate parser:

```sh
alias antlr='java -jar antlr-4.7-complete.jar'
antlr -Dlanguage=Go SQLiteLexer.g4
antlr -Dlanguage=Go SQLiteParser.g4
antlr -Dlanguage=Go -package sqlite_parser SQLiteLexer.g4
antlr -Dlanguage=Go -visitor -no-listener -package sqlite_parser SQLiteParser.g4
```

Clean generated code:

```sh
rm *.interp *.tokens *.go
```

More examples at https://blog.gopheracademy.com/advent-2017/parsing-with-antlr4-and-go/
2 changes: 1 addition & 1 deletion go/internal/antlr4_sqlite_parser/sqlite_lexer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7089e49

Please sign in to comment.