Skip to content

Commit

Permalink
Add make setup-antlr
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy authored and pzbitskiy committed Apr 5, 2022
1 parent c9900fe commit 5f44ee0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default: build
all: go test grammar-java
build: go

algorand-link:
algorand-link:
SYM_DIR_LOC=$$(go env GOPATH)/pkg/mod/$$(echo $$(grep -F 'github.com/algorand/go-algorand' go.mod | sed 's/ /@/' | cut -d " " -f1 )) ; \
SYM_DIR_TARG=$$(go env GOPATH)/src/github.com/algorand/go-algorand; \
[ ! -d "$$SYM_DIR_TARG" ] && echo "error: target directory not found ($$SYM_DIR_TARG)" && exit 1; \
Expand All @@ -12,7 +12,12 @@ algorand-link:
echo "targ=$$SYM_DIR_TARG" "linkloc=$$SYM_DIR_LOC"; \
ln -s "$$SYM_DIR_TARG" "$$SYM_DIR_LOC"

ANTLR4_JAR := /usr/local/lib/antlr-4.9.2-complete.jar
ANTLR4_VER := 4.9.3
ANTLR4_JAR := /usr/local/lib/antlr-$(ANTLR4_VER)-complete.jar

setup-antlr:
sudo curl -o $(ANTLR4_JAR) https://www.antlr.org/download/antlr-$(ANTLR4_VER)-complete.jar
export CLASSPATH="$(ANTLR4_JAR):$$CLASSPATH"

grammar-all: grammar-go

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Checkout [syntax highlighter](https://github.com/pzbitskiy/tealang-syntax-highli
### Prerequisites

1. Set up **ANTLR4** as explained in [the documentation](https://www.antlr.org/)
Or run `make setup-antlr`
2. Install runtime for Go
```sh
go get -u github.com/antlr/antlr4/runtime/Go/antlr
Expand Down

0 comments on commit 5f44ee0

Please sign in to comment.