Input an antlr grammar and file for python to test it out

Overview

py-antlr-input

Input an ANTLR grammar and test file for python to render a parser tree of the file. This program will make use of the grun command that comes with ANTLR.

Requirements

  • python 3.5 or higher
  • tkinter (python library)
  • java
  • ANTLR (with antlr4 and grun commands configured)

Usage

With your terminal, go to the repo directory and run:

python ./main.py

from there, the program should guide you. Take into account that you'll need:

  • The name of the grammar
  • An ANTLR4 grammar file (.g4)
  • The name of the start rule
  • A test file for your output language

You may also use the default Decaf grammar file specified in Decaf/Decaf.g4 by adding Decaf as an argument

python ./main.py Decaf

This will make the program only ask for the .decaf file you want to see the parser tree of.

Examples

Cow.decaf

This file has a lot of defined rules covered. Here's the parse tree for the code:

test.decaf

Just a regular test file. Useful when testing the grammar for the first time. Here's the code

Error handling

If there's just a small amount of errors, then the program will still render the parse tree with a bit of red highlighted where the code wasn't correcty specified. Make sure to check the terminal output for more details.

Support

This tools has support for both Windows and Unix based operative systems.

References

Author

  • Oscar Juárez
Owner
Oscar Juárez
Oscar Juárez
A GUI frontend developed in Python3 for simple admin tasks on MySQL-Server running on the localhost

A GUI frontend developed in Python3 for simple admin tasks on MySQL-Server running on the localhost. Developed for my CS School Project.

1 May 29, 2022
An offline python frontend for the QuadVisions Colab Notebook using tkinter.

Visions GUI An offline python frontend for the QuadVisions Colab Notebook using tkinter. It offers basic options and interactively displays the genera

7 Feb 15, 2022
Firefox 96 Webapps for Gnome 3

mozapp Do you prefer Firefox to Chrome? Me too! But ever since Firefox dropped support for standalone web applications, I've resorted to using Chrome

Marten de Vries 8 Oct 31, 2022
Basic browser based on PyQt5

goneDev-browser "basic browser based on PyQt5" This application is primarily built on macOS with more adaptibility for MacOS than Windows. v1.0 will s

Harsh ADV) 1 Jan 19, 2022
Write desktop and web apps in pure Python

Flexx Want to stay up-to-date about (changes to) Flexx? Subscribe to the NEWS issue. Introduction Flexx is a pure Python toolkit for creating graphica

flexxui 3.1k Jan 08, 2023
A Simple GUI application to organize and store accounts/passwords.

PyssView A Simple GUI application to organize and store accounts/passwords. Install/Run (Linux) Via script This way will install a binary version and

Jefferson Richard Dias 1 Nov 24, 2021
Yasb is a highly configurable and hackable taskbar written in python with Qt6.

Yasb: Yet Another Status Bar Yasb is a highly configurable and hackable taskbar written in python with Qt6. This project is still in (very) early deve

Dan 355 Jan 01, 2023
This is a GUI application to plot functions in the form Y = F(X)

Plotter This is a GUI application to plot functions in the form Y = F(X) Technologies Python Qt designer Python unittest matplotlib Running Navigate

ahmedasad236 3 Dec 26, 2021
AppQuickLauncher is a tool that can quickly launch apps by clicking the app tray icon.

AppQuickLauncher AppQuickLauncher is a tool that can quickly launch apps by clicking the app tray icon. On Windows 7 or Windows 10, we can add a folde

yin kaisheng 2 Sep 11, 2022
This a pythonTkinter GUI with sqlite3 Project.

FootballGym_MIS This a pythonTkinter GUI with sqlite3 Project. This software is useful if you want to enjoy running a gym. It helps you know which tea

Hikmatullah Mohammadi 2 Jun 19, 2022
A Virtual Desktop Assistant Written in Python

DesktopAssitant A Virtual Desktop Assistant Written in Python. It's generally a basic virtual assistant The basic purpose of this is to make work easi

Technerd brainiac 609 Jan 07, 2023
A small pomodoro GUI for Windows/Linux created in Python with PyQt5.

Pomodoro A small pomodoro GUI for Windows/Linux created with PyQt5. Features The "Timer" tab allows you to set your desired work and rest times aswell

Burak Martin 81 Dec 28, 2022
GUI Python Auto text bot.

Bagel Text Bot Auto text bot. Written in Python. Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what

Toby 3 May 14, 2022
Projeto de mini-games de azar com interface gráfica utilizando Python e PySimpleGui.

Gambling Mini jogos de azar unidos em uma mesma interface gráfica, utilizando a linguagem de programação Python em conjunto com a biblioteca de interf

Clayton Garcia da Silva 3 Nov 19, 2021
Pyint is the graphic software which is written in Python

Pyint About Pyint Pyint is the graphic software which is written in Python(I use the Turtle graphics). The name 'Pyint' is compound word of 'Python' a

John 1 Nov 06, 2021
A quick GUI script to pseudo-anonymize patient videos for use in the GRK

grk_patient_sorter A quick GUI script to pseudo-anonymize patient videos for use in the GRK. Source directory — the highest level folder that will be

Peter Somers 1 Dec 09, 2021
A desktop application for JupyterLab, based on Electron.

A desktop application for JupyterLab, based on Electron.

JupyterLab 2.1k Jan 02, 2023
Small Python scripts to take screenshot from a KaiOS/FFOS device and to mirror the screen of your phone.

This version of kaiscr is written by tkinter and can run in windows(use kailive-tk.py). "kailive-tk-speed.py" is speed optimization version. The sourc

openGiraffes Group 2 Mar 02, 2022
Example GUI for Command line capable machine learning programs

Example GUI for Command line capable machine learning programs This is an example GUI made in PysimpleGUI and Tkinter, mainly for machine learning pro

Kim Yongwook 4 May 31, 2022
Make desktop applications using HTML and CSS with python

Neutron Make desktop applications using HTML and CSS with python What is Neutron Neutron will allow developers to design modern applications in python

Ian Baldelli 284 Dec 29, 2022