3

i am using ubuntu 14.04 and i have to follow a list of 3-4 steps to use antlr4 for parsing (everytime).In windows there is a temporary as well as a permanent way .but in ubuntu every time terminal opens then i have to follow these steps given on the official website.

http://www.antlr.org/

4 steps are:

$cd /usr/local/lib
$ sudo curl -O http://www.antlr.org/download/antlr-4.4-complete.jar
$ export CLASSPATH=".:/usr/local/lib/antlr-4.4-complete.jar:$CLASSPATH"
$ alias antlr4='java -jar /usr/local/lib/antlr-4.4-complete.jar'
$ alias grun='java org.antlr.v4.runtime.misc.TestRig'

curl is for downloading once into usr\local\lib

is there any permanent way of getting anlr4 work?

Sumit Singh
  • 153
  • 1
  • 7

1 Answers1

4

These 2 lines are needed one time only:

$ cd /usr/local/lib
$ sudo curl -O http://www.antlr.org/download/antlr-4.4-complete.jar

It is for download the antlr jar file so this is only needed once.

These lines need to be edited into a start up file for your session (or any user on your system that needs to use this).

$ export CLASSPATH=".:/usr/local/lib/antlr-4.4-complete.jar:$CLASSPATH"
$ alias antlr4='java -jar /usr/local/lib/antlr-4.4-complete.jar'
$ alias grun='java org.antlr.v4.runtime.misc.TestRig'

I would suggest .bashrc in /home/$USER/

Rinzwind
  • 299,756