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
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
Multi-handle range slider widget for PyQt/PySide

QtRangeSlider The missing multi-handle range slider widget for PyQt & PySide The goal of this package is to provide a Range Slider (a slider with 2 or

Talley Lambert 28 Dec 26, 2022
FPKG Maker GUI - A user friendly User Interface for fPKG Tools for PS4

Know Issues being worked on Please place this application on the root of a drive

26 Nov 27, 2022
A very simple calculator with a modern UI made in Python thanks for the stunning Sun-Valley-ttk-theme and Segoe UI Variable font.

Fluent-Python-Calculator A simple Python calculator with Sun-Valley-ttk-theme About Fluent-Python-Calculator: A very simple calculator with a modern U

59 Dec 06, 2022
PyCG: Practical Python Call Graphs

PyCG - Practical Python Call Graphs PyCG generates call graphs for Python code using static analysis. It efficiently supports Higher order functions T

Vitalis Salis 185 Dec 29, 2022
QGUI - 0.1MB超轻量Python GUI框架,用模板来快捷制作深度学习模型推理界面

QGUI - 0.1MB超轻量Python GUI框架,用模板来快捷制作深度学习模型推理界面

QPT Family 92 Nov 18, 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 calculator made using Python and Tkinter

Abacus Abacus is a calculator used to compute expressions with the operators of Addition, Subtraction, Multiplication and Division. It is named after

0 Jun 24, 2022
Linux GUI app to codon optimize a directory with fasta files using taxonomy ids imported as a 1-column txt file (1 taxonomy id for each file)

codon optimize cds paired with taxids singlefastas gui Linux GUI app to codon optimize a directory with fasta files using taxonomy ids imported as a 1

Olga Tsiouri 1 Jan 09, 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
LittlePythonGUIGuide - This is a short GUI Guide with python

This is a short GUI Guide with python, learning how to use the simple and easy moduel built into python, named tkinter.

1cy50ng3b0b 1 Nov 21, 2021
A simple assistance and with a very basic GUI

J.A.R.V.I.S This is a simple assistance and with a very basic GUI (Graphical User Interface) Download all the dependencies by running the below code p

Abir Pal 7 Oct 12, 2022
pyglet is a cross-platform windowing and multimedia library for Python, for developing games and other visually rich applications.

pyglet pyglet is a cross-platform windowing and multimedia library for Python, intended for developing games and other visually rich applications. It

1.3k Jan 01, 2023
Declarative User Interfaces for Python

Welcome to Enaml Enaml is a programming language and framework for creating professional-quality user interfaces with minimal effort. What you get A d

1.4k Jan 07, 2023
Json IDE made with Python tkinter!

JIDE Json IDE made with Python tkinter! Download: https://github.com/LouisTheXIV/JIDE/releases/tag/v0.1 Features In JIDE everything is customisable do

n0 7 May 14, 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
Build GUI for your Python program with JavaScript, HTML, and CSS

https://pywebview.flowrl.com pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its o

Roman 3.3k Jan 01, 2023
Tukaan is the new framework that aims to replace Tkinter

Tukaan is the new, pythonic and colorful (like a keel-billed toucan) framework that aims to replace Tkinter. It has everything (on my computer, not at GitHub) that you need to develop cross-platform

Tukaan 101 Jan 08, 2023
Criando interfaces gráficas com Python e Qt 6 (PyQt6)

Criando interfaces gráficas com Python e Qt 6 (PyQt6) Qt O Qt é um framework para criação de interfaces gráficas multiplataforma, atualmente ele é des

Renato Cruz 1 Jun 07, 2022
LCD GUI for P4wnP1 ALOA

GUI for P4wnP1 Colorful UI interface for P4wnP1 ALOA Don't pwn just as a USB client. Use also the USB host capabilities! UPS Lite support Scalability

John 7 Dec 13, 2022