{"id":19564333,"url":"https://github.com/antlr/antlr5-lab","last_synced_at":"2025-02-26T09:21:36.063Z","repository":{"id":217760883,"uuid":"744728667","full_name":"antlr/antlr5-lab","owner":"antlr","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-22T14:43:20.000Z","size":431,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-08T23:41:49.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antlr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-17T22:14:14.000Z","updated_at":"2024-02-04T00:45:43.000Z","dependencies_parsed_at":"2024-01-22T16:54:21.958Z","dependency_job_id":null,"html_url":"https://github.com/antlr/antlr5-lab","commit_stats":null,"previous_names":["antlr/antlr5-lab"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antlr%2Fantlr5-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antlr%2Fantlr5-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antlr%2Fantlr5-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antlr%2Fantlr5-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antlr","download_url":"https://codeload.github.com/antlr/antlr5-lab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240823420,"owners_count":19863434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T05:21:31.423Z","updated_at":"2025-02-26T09:21:36.026Z","avatar_url":"https://github.com/antlr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# antlr4-lab\nA client/server for trying out and learning about ANTLR\n\n## Building and launching server\n\nUbuntu with lab.antlr.org static IP\n\n```bash\ncd ~\nsudo apt-get update\nsudo apt install -y openjdk-11-jre\nsudo apt install -y maven\nsudo apt install -y git\nsudo apt install -y ghostscript # gets ps2pdf\nsudo apt install -y pdf2svg\ngit clone https://github.com/antlr/antlr4-lab.git\ncd antlr4-lab\nmvn install\n\nsudo mkdir /var/log/antlrlab\nsudo chmod 777 /var/log/antlrlab\nssh-keygen -t ed25519 -C 'parrt@...'  # add key to github\ngit config --global user.email \"parrt@...\"\ngit config --global user.name \"Terence Parr\"\n```\n\nLaunch!\n\n```bash\ncd ~/antlr4-lab\nsudo nohup java -cp ~/.m2/repository/org/antlr/antlr4-lab/0.2-SNAPSHOT/antlr4-lab-0.2-SNAPSHOT-complete.jar org.antlr.v4.server.ANTLRHttpServer\n```\n\nIf you are running the server locally on your box, visit [http://localhost/index.html](http://localhost/index.html) to run the client.\n\n### React\n\nThe UI is now build using react/typescript.\n\nTo build the UI, you'll need node 16.17+ and yarn 1.22+.\n\n````bash\ncd react\nyarn install # fetches the dependencies\nyarn build  # builds the web app into the parent 'web' folder\n````\n\nTo work on the UI, run the backend in Docker, and open your favorite UI dev tool (WebStorm, VSCode...)\n\n````bash\ncd react\nyarn install # fetches the dependencies\nyarn start  # runs the UI on port 3000, redirecting backend calls to 80\n````\n\n\n### Docker\n\nI created a [Dockerfile](Dockerfile), which is useful when working on the UI, you can run the backend locally in docker and the UI on port 3000. This might also be useful for deploying in the cloud later.\n\nHere's how to build the docker file:\n\n```bash\ncd antlr4-lab\nmvn clean package  # has to be built first as docker copies in the jar\ndocker build --tag antlr4-lab-docker .\n```\n\nand here's how to use the docker to launch:\n\n```bash\ndocker run -p80:80 --rm antlr4-lab-docker\n```\n\n@kaby76 reports the following: Seems to work fine. But I had to do some things to get it to work on Windows/WSL2.\n\nIn Windows: Install Docker Desktop\n\nIn WSL2/Ubuntu:\n\n```bash\nsudo apt install docker.io\ngit clone https://github.com/antlr/antlr4-lab.git\ncd antlr4-lab\ngit checkout docker\nmvn clean; mvn install\ndocker build .\ndocker image ls # get image name.\ndocker run -d -p 127.0.0.1:80:80 -e BIND_ADDR=0.0.0.0:80 image-name-from-above\n```\n\nIn Windows again, run Firefox and connect to 127.0.0.1.\n\nIt looks like docker binds port 80 to 0.0.0.0 by default (after installing `net-tools`, and doing `netstat -a`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantlr%2Fantlr5-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantlr%2Fantlr5-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantlr%2Fantlr5-lab/lists"}