Yet Another Compiler Visualizer

Overview

yacv: Yet Another Compiler Visualizer

yacv is a tool for visualizing various aspects of typical LL(1) and LR parsers. Check out demo on YouTube to see sample visualizations

Introduction

Getting comfortable with parsing can be tough. While the legendary "Dragon Book" is an excellent resource for everything related to compilers, it still contains very minimal visualizations for the parsing process itself. That being said, there exist visualization tools such as LR(0) parser visualizer and LL(1) parser visualizer by Zak Kincaid and Shaowei Zhu, JSMachines, Jison etc. However, all of these tools are web-based and most of them show steps in a table which isn't very intuitive

yacv attempts to overcome all these shortcomings by using manim

Primary features

yacv takes in a context free grammar and a string and can be used to :

  1. Visualize the syntax tree
  2. Visualize the LR automaton
  3. Export the parsing table
  4. Visualize the parsing process step-by-step using manim

Installation

Requirements:

  1. Python 3.6+
  2. pygraphviz
  3. pandas
  4. manim : yacv should theoretically work with both manim versions ( ManimGL or ManimCE ) but ManimCE is recommended

Issues with pycairo ? Check this

To install yacv, clone the yacv repository on GitHub to your local machine and then install using pip

$ git clone https://github.com/ashutoshbsathe/yacv 
$ cd yacv 
$ pip install -e .

Usage

To verify installation, run yacv with the example configuration example_config.yml

$ yacv example_config.yml 

To run with your own grammar and string, create your own custom config and use that instead. Examples of config files with various grammars can be found in examples/ directory

Documentation

For more information, please refer to the documentation

License

MIT

Interesting Reads

  1. A good, free book for interpreters
  2. GCC does not use machine generated parsers
  3. Why LL and LR parsing is hard ?
You might also like...
Telegram bot to auto post messages of one channel in another channel as soon as it is posted, without the forwarded tag.

Channel Auto-Post Bot This bot can send all new messages from one channel, directly to another channel (or group, just in case), without the forwarded

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

Just Another Telegram Ai Chat Bot Written In Python With Pyrogram.
Just Another Telegram Ai Chat Bot Written In Python With Pyrogram.

OkaeriChatBot Just another Telegram AI chat bot written in Python using Pyrogram. Requirements Python 3.7 or higher.

Yet Another Sequence Encoder - Encode sequences to vector of vector in python !

Yase Yet Another Sequence Encoder - encode sequences to vector of vectors in python ! Why Yase ? Yase enable you to encode any sequence which can be r

Yet another Django audit log app, hopefully the simplest one.

django-easy-audit Yet another Django audit log app, hopefully the easiest one. This app allows you to keep track of every action taken by your users.

Yet Another Python Profiler, but this time thread&coroutine&greenlet aware.
Yet Another Python Profiler, but this time thread&coroutine&greenlet aware.

Yappi Yet Another Python Profiler, but this time thread&coroutine&greenlet aware. Highlights Fast: Yappi is fast. It is completely written in C and lo

Yet another Python binding for fastText

pyfasttext Warning! pyfasttext is no longer maintained: use the official Python binding from the fastText repository: https://github.com/facebookresea

Yet another Python binding for fastText

pyfasttext Warning! pyfasttext is no longer maintained: use the official Python binding from the fastText repository: https://github.com/facebookresea

Yet Another Time Series Model

Yet Another Timeseries Model (YATSM) master v0.6.x-maintenance Build Coverage Docs DOI | About Yet Another Timeseries Model (YATSM) is a Python packag

Chameleon is yet another PowerShell obfuscation tool designed to bypass AMSI and commercial antivirus solutions.

Chameleon is yet another PowerShell obfuscation tool designed to bypass AMSI and commercial antivirus solutions. The tool has been developed as a Python port of the Chimera project, by tokioneon_.

Yet Another Neural Machine Translation Toolkit

YANMTT YANMTT is short for Yet Another Neural Machine Translation Toolkit. For a backstory how I ended up creating this toolkit scroll to the bottom o

Yet Another Robotics and Reinforcement (YARR) learning framework for PyTorch.
Yet Another Robotics and Reinforcement (YARR) learning framework for PyTorch.

Yet Another Robotics and Reinforcement (YARR) learning framework for PyTorch.

YARR is Yet Another Robotics and Reinforcement learning framework for PyTorch.
YARR is Yet Another Robotics and Reinforcement learning framework for PyTorch.

Yet Another Robotics and Reinforcement (YARR) learning framework for PyTorch.

Yet Another MkDocs Parser

yamp Motivation You want to document your project. You make an effort and write docstrings. You try Sphinx. You think it sucks and it's slow -- I did.

Yet Another Reinforcement Learning Tutorial

This repo contains self-contained RL implementations

Volt is yet another discord api wrapper for Python. It supports python 3.8 +

Volt Volt is yet another discord api wrapper for Python. It supports python 3.8 + How to install [Currently Not Supported.] pip install volt.py Speed

Yet another Python Implementation of the Elo rating system.

Python Implementation - Elo Rating System Yet another Python Implementation of the Elo rating system (how innovative am I right?). Only supports 1vs1

Yet another random discord bot.

YARDB (r!) Yet another fully functional and random discord bot. I might add more features if I'm bored also don't criticize on my code. Commands: 4 Di

Yet another discord-BOT

Note I have not added comments to the initial code as it is for my educational purpose. Use This is the code for a discord-BOT API py-cord-2.0.0a4178+

Comments
  • No output on Ubuntu WSL

    No output on Ubuntu WSL

    Ubuntu-20.04 on WSL, installation using pip3 install -e . was successful. Running the example python3 -m yacv ll1-parsing-example.yml, resulted in no output from the logger and no yacv_ll1-simple/ was created.

    Could be a problem with dependencies, or some error thrown by external tools like graphviz. Is there a way to run yacv in a verbose mode, for debugging?

    opened by felipecustodio 3
  • Remove system specific path

    Remove system specific path

    Not sure what functionality this adds, but ideally shouldn't exist in a code base that is distributed. Replace it with something more generic (since an importable library shouldn't need to mess with env vars)? If needed, possibly add a note in the docs for additional setup instructions?

    https://github.com/ashutoshbsathe/yacv/blob/77a948c66f481f1d13b1f84cc9a88ddcdbe7d2d2/yacv/vis.py#L3

    opened by yashshah1 1
Owner
Ashutosh Sathe
CS grad from CoEP | Mathematics is undecidable
Ashutosh Sathe
Yet another Python binding for fastText

pyfasttext Warning! pyfasttext is no longer maintained: use the official Python binding from the fastText repository: https://github.com/facebookresea

Vincent Rasneur 230 Nov 16, 2022
Yet another Python binding for fastText

pyfasttext Warning! pyfasttext is no longer maintained: use the official Python binding from the fastText repository: https://github.com/facebookresea

Vincent Rasneur 228 Feb 17, 2021
Yet Another Neural Machine Translation Toolkit

YANMTT YANMTT is short for Yet Another Neural Machine Translation Toolkit. For a backstory how I ended up creating this toolkit scroll to the bottom o

Raj Dabre 121 Jan 5, 2023
YACLC - Yet Another Chinese Learner Corpus

汉语学习者文本多维标注数据集YACLC V1.0 中文 | English 汉语学习者文本多维标注数据集(Yet Another Chinese Learner

BLCU-ICALL 47 Dec 15, 2022
Snowball compiler and stemming algorithms

Snowball is a small string processing language for creating stemming algorithms for use in Information Retrieval, plus a collection of stemming algori

Snowball Stemming language and algorithms 613 Jan 7, 2023
Snowball compiler and stemming algorithms

Snowball is a small string processing language for creating stemming algorithms for use in Information Retrieval, plus a collection of stemming algori

Snowball Stemming language and algorithms 471 Feb 9, 2021
Nateve compiler developed with python.

Adam Adam is a Nateve Programming Language compiler developed using Python. Nateve Nateve is a new general domain programming language open source ins

Nateve 7 Jan 15, 2022
This is the Alpha of Nutte language, she is not complete yet / Essa é a Alpha da Nutte language, não está completa ainda

nutte-language This is the Alpha of Nutte language, it is not complete yet / Essa é a Alpha da Nutte language, não está completa ainda My language was

catdochrome 2 Dec 18, 2021
A high-level yet extensible library for fast language model tuning via automatic prompt search

ruPrompts ruPrompts is a high-level yet extensible library for fast language model tuning via automatic prompt search, featuring integration with Hugg

Sber AI 37 Dec 7, 2022