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
MATE Layouts is a small panel layout switching application for the MATE Desktop.

a small panel layout switching application for the MATE Desktop

Wilbur Wetterquarz 6 Oct 14, 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
Use any of the 1k+ free FontAwesome icons in your tkinter application.

TkFontAwesome A library that enables you to use FontAwesome icons in your tkinter application. You may use any of the 1k+ free FontAwesome 5.0 icons.

Israel Dryer 33 Dec 20, 2022
A python Script For Taking Screenshot Of Windows

PyShot A Python Script For Taking Screenshot Of Windows Disclaimer This tool is for educational purposes only ! Don't use this to take revenge I will

Nazim Cp 2 Jun 22, 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
A Python based Connect 4 game made with DearPyGUI

Ultimate-Connect-4 A Python based Connect 4 game made with DearPyGUI NOTICE: If you connect to the game server hosted by Jah-On and attempt to send ma

4 Jun 01, 2022
Transparent & click through tkinter window. WINDOWS ONLY

REQUIREMENTS: WINDOWS ONLY pip install pywin32 NOTES: Will not work on top of a fullscreen application, if you are using this to draw on top of a gam

francis 2 Nov 04, 2022
All you need to learn Tkinter!

Tkinter This repository contains the codes and resources which I used to learn the standard GUI library of Python, Tkinter! Best Tkinter Resources Vid

Samyak Jain 3 May 02, 2022
ZFS Administration GUI

ZYGGY ZFS Administration GUI Zyggy is a very simple GUI for basic ZFS administration. The system provides graphical access for most frequently used ZF

51 Dec 18, 2022
Basic calculator using Tkinter GUI

Basic calculator using Tkinter GUI

Rogerio Penchel 17 Jan 09, 2022
A desktop application for JupyterLab, based on Electron.

A desktop application for JupyterLab, based on Electron.

JupyterLab 2.1k Jan 02, 2023
A really minimalistic operating system made using python's GUI module Tkinter.

BoxOS V1.0.0 About A really minimalistic operating system made using python's GUI module Tkinter. What seperates it from the other operating systems m

Fahim 2 Dec 08, 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 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
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
A simple one-line quick entry GUI for your Obsidian daily notes in markdown format.

Quick-note-entry-for-Obsidian A simple one-line quick entry GUI for your Obsidian daily notes in markdown format. Log your day quickly with this simpl

Adrian Papineau 22 Oct 04, 2022
A desktop application developed in Python with PyQt5 to predict demand and help monitor and schedule brewing processes for Barnaby's Brewhouse.

brewhouse-management A desktop application developed in Python with PyQt5 to predict demand and help monitor and schedule brewing processes for Barnab

Isaac Cheng 2 Jul 09, 2022
Aplicação GUI feita em Python para estudos de cadastro (forms).

Cadastro de DEVs GUI 💻 A ideia original veio do repositório do https://github.com/PedroTomazeti nomeado 'Projetos-Independentes-HTML-CSS' Nele há um

Yago Goltara 3 Aug 15, 2021
OpenPort scanner GUI tool (CNMAP)

CNMAP-GUI- OpenPort scanner GUI tool (CNMAP) as you know it is the advanced tool to find open port, firewalls and we also added here heartbleed scanni

9 Mar 05, 2022