Skip to content

Commit

Permalink
rename antlr4 -> antlr
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Feb 7, 2023
1 parent 27a0af0 commit 4bf2d65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ jobs:
cd antlr
curl -o antlr.jar https://www.antlr.org/download/antlr-$ANTLR_VERSION-complete.jar
export PWD=`pwd`
echo '#!/bin/bash' > antlr4
echo "java -jar $PWD/antlr.jar \$*" >> antlr4
chmod +x antlr4
echo '#!/bin/bash' > antlr
echo "java -jar $PWD/antlr.jar \$*" >> antlr
chmod +x antlr
export CLASSPATH=".:$PWD/antlr.jar:$CLASSPATH"
export PATH="$PWD:$PATH"
cd ../current
antlr4 | grep "Version"
antlr | grep "Version"
npm run grammar:build && git diff --exit-code
check-migrations:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"schema:build": "pnpm run schema:build:json && pnpm run schema:build:python",
"schema:build:json": "ts-json-schema-generator -f tsconfig.json --path 'frontend/src/*.ts' --type 'QuerySchema' --no-type-check > frontend/src/queries/schema.json && prettier --write frontend/src/queries/schema.json",
"schema:build:python": "datamodel-codegen --collapse-root-models --disable-timestamp --use-subclass-enum --input frontend/src/queries/schema.json --input-file-type jsonschema --output posthog/schema.py && black posthog/schema.py",
"grammar:build": "cd posthog/hogql/grammar && antlr4 -Dlanguage=Python3 HogQLLexer.g4 && antlr4 -visitor -no-listener -Dlanguage=Python3 HogQLParser.g4",
"grammar:build": "cd posthog/hogql/grammar && antlr -Dlanguage=Python3 HogQLLexer.g4 && antlr -visitor -no-listener -Dlanguage=Python3 HogQLParser.g4",
"packages:build": "pnpm packages:build:apps-common && pnpm packages:build:lemon-ui",
"packages:build:apps-common": "cd frontend/@posthog/apps-common && pnpm i && pnpm build",
"packages:build:lemon-ui": "cd frontend/@posthog/lemon-ui && pnpm i && pnpm build",
Expand Down
12 changes: 6 additions & 6 deletions posthog/hogql/grammar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Grammar is located inside `HogQLLexer.g4` and `HogQLParser.g4` files.

To generate source code you need to install locally the `antlr4` binary:
To generate source code you need to install locally the `antlr` binary:

```bash
brew install antlr
Expand All @@ -18,9 +18,9 @@ mkdir antlr
cd antlr
curl -o antlr.jar https://www.antlr.org/download/antlr-$ANTLR_VERSION-complete.jar
export PWD=`pwd`
echo '#!/bin/bash' > antlr4
echo "java -jar $PWD/antlr.jar \$*" >> antlr4
chmod +x antlr4
echo '#!/bin/bash' > antlr
echo "java -jar $PWD/antlr.jar \$*" >> antlr
chmod +x antlr
export CLASSPATH=".:$PWD/antlr.jar:$CLASSPATH"
export PATH="$PWD:$PATH"
```
Expand All @@ -35,8 +35,8 @@ Or mess around with:

```bash
cd posthog/hogql/grammar
antlr4 -Dlanguage=Python3 HogQLLexer.g4
antlr4 -visitor -Dlanguage=Python3 HogQLParser.g4
antlr -Dlanguage=Python3 HogQLLexer.g4
antlr -visitor -Dlanguage=Python3 HogQLParser.g4
```

Original ClickHouse ANTLR grammar from: https://github.com/ClickHouse/ClickHouse/blob/master/utils/antlr/ClickHouseParser.g4
Expand Down

0 comments on commit 4bf2d65

Please sign in to comment.