Giter Site home page Giter Site logo

antlr5-lab's Introduction

antlr4-lab

A client/server for trying out and learning about ANTLR

Building and launching server

Ubuntu with lab.antlr.org static IP

cd ~
sudo apt-get update
sudo apt install -y openjdk-11-jre
sudo apt install -y maven
sudo apt install -y git
sudo apt install -y ghostscript # gets ps2pdf
sudo apt install -y pdf2svg
git clone https://github.com/antlr/antlr4-lab.git
cd antlr4-lab
mvn install

sudo mkdir /var/log/antlrlab
sudo chmod 777 /var/log/antlrlab
ssh-keygen -t ed25519 -C 'parrt@...'  # add key to github
git config --global user.email "parrt@..."
git config --global user.name "Terence Parr"

Launch!

cd ~/antlr4-lab
sudo nohup java -cp ~/.m2/repository/org/antlr/antlr4-lab/0.2-SNAPSHOT/antlr4-lab-0.2-SNAPSHOT-complete.jar org.antlr.v4.server.ANTLRHttpServer

If you are running the server locally on your box, visit http://localhost/index.html to run the client.

Docker

I created a Dockerfile, although I'm not sure how useful it will be to people. This might be useful for deploying in the cloud later.

Here's how to build the docker file:

cd antlr4-lab
mvn clean package  # has to be built first as docker copies in the jar
docker build --tag antlr4-lab-docker .

and here's how to use the docker to launch:

docker run -p80:80 --rm antlr4-lab-docker

@kaby76 reports the following: Seems to work fine. But I had to do some things to get it to work on Windows/WSL2.

In Windows: Install Docker Desktop

In WSL2/Ubuntu:

sudo apt install docker.io
git clone https://github.com/antlr/antlr4-lab.git
cd antlr4-lab
git checkout docker
mvn clean; mvn install
docker build .
docker image ls # get image name.
docker run -d -p 127.0.0.1:80:80 -e BIND_ADDR=0.0.0.0:80 image-name-from-above

In Windows again, run Firefox and connect to 127.0.0.1.

It looks like docker binds port 80 to 0.0.0.0 by default (after installing net-tools, and doing netstat -a).

antlr5-lab's People

Contributors

parrt avatar kaby76 avatar qligier avatar nullndr avatar hanjoes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.