LTGen provides classic algorithms used in Language Theory.

Related tags

MiscellaneousLTGen
Overview

LTGen

LTGen stands for Language Theory GENerator and provides tools to implement language theory.

Command Line

LTGen is a collection of tools to implement basic algorithms used in Language Theory. The command line arguments are mostly the same for the provided tools:

$ ltgen.py GRAMMAR OPTIONS

Where GRAMMAR is path to a file containing the grammar to work with (format is detailed below).

OPTIONS are detailed in the following sections but some (provided below) are shared by all tools:

  • --k -- select the lookup depth used in the tools.
  • --table -- output the analysis table (if any).
  • --gen-csv -- output the analysis table in CSV (if any).
  • --output|-o PATH? -- output to the analysis table to a file (with the given PATH or to path derived from the grammar file).
  • --word|-w "WORD" -- scan the WORD with the current analysis (separate non-terminals in the word by spaces).
  • --print -- print the current grammar (useful un conjunction with --word).

If no options is given, the used grammar is just displayed.

LL(k) Analysis

LTgen provides basics for LL(k) analysis:

  • --first -- computes first_k(X) for all or for listed non-terminals,
  • --follow -- computes follow_(k) for all or for listed non-terminals,
  • --lookahead -- computes k-lookahead(X -> s) for all or for listed nion-terminal productions.
  • --ll -- Test if the given grammar is LL(k).

.gram Files

Grammar can be expressed using .gramfiles. The format is very simple:

  • Rules are organized by lines.
  • A rule has the format: NAME -> SYM1 SYM2 ...
  • A symbol or a rule name can be any sequence of character that do contain spaces or tabulations.
  • The name of the first rule is the axiom of the grammar.
  • Empty lines are accepted.
  • Comments spans from the # to the end of the line.
  • Notice that the symbol $ is reserved to mark the end of word.

Example of grammar:

S'	->	S
S	->	a S b
S	->	R
R	->	b
R	->	c R

Testing

Unit is performed using pytest with the command:

$ pytest test.py
Owner
Hugues Cassé
Professor-assistant in University of Toulouse, France.
Hugues Cassé
A Python version of Canvacord

A copy of canvacord made in python! Installation Run any of these commands in terminal: Mac / Linux pip install canvacord Windows python -m pip insta

10 Mar 28, 2022
Hacktoberfest2021 🥳- Contribute Any Pattern In Any Language😎 Every PR will be accepted Pls contribute

✨ Hacktober Fest 2021 ✨ 🙂 All Contributors are requested to star this repo and follow me for a successful merge of pull request. 🙂 👉 Add any patter

Md. Almas Ali 103 Jan 07, 2023
Install packages with pip as if you were in the past!

A PyPI time machine Do you wish you could just install packages with pip as if you were at some fixed date in the past? If so, the PyPI time machine i

Thomas Robitaille 51 Jan 09, 2023
[draft] tools for schnetpack

schnetkit some tooling for schnetpack EXPERIMENTAL/IN DEVELOPMENT DO NOT USE This is an early draft of some infrastructure built around schnetpack. In

Marcel 1 Nov 08, 2021
This is a simple bank management system based on Python.

Python Bank Management This is a simple bank management system based on Python. It's able to do basic operations of simple bank management. Outcome: W

Md. Rakibul Islam 3 Jan 06, 2022
UF3: a python library for generating ultra-fast interatomic potentials

Ultra-Fast Force Fields (UF3) S. R. Xie, M. Rupp, and R. G. Hennig, "Ultra-fast interpretable machine-learning potentials", preprint arXiv:2110.00624

Ultra-Fast Force Fields 24 Nov 13, 2022
Automatic certificate unpinning for Android apps

What is this? Script used to perform automatic certificate unpinning of an APK by adding a custom network security configuration that permits user-add

Antoine Neuenschwander 5 Jul 28, 2021
List Less Than Ten with python

List Less Than Ten with python

PyLaboratory 0 Feb 07, 2022
Edorado93 - Unraveling a Rockstar! -- Too much? Fine, Unraveling a humble programmer then?

Hi, I'm Sachin Malhotra ( ⛄ 💻 🎃 🍺 ) Let me set the records straight. Roger Federer is the GOAT and I will not hear otherwise! Now that we have that

Sachin Malhotra 7 Dec 25, 2022
Building an Investment Portfolio for Day Trade with Python

Montando um Portfólio de Investimentos para Day Trade com Python Instruções: Para reproduzir o projeto no Google Colab, faça o download do repositório

Paula Campigotto 9 Oct 26, 2021
Fused multiply-add (with a single rounding) for Python.

pyfma Fused multiply-add for Python. Fused multiply-add computes (x*y) + z with a single rounding. Useful for dot products, matrix multiplications, po

Nico Schlömer 18 Nov 08, 2022
The ROS package for Airbotics.

airbotics The ROS package for Airbotics: Developed for ROS 1 and Python 3.8. The package has not been officially released on ROS yet so manual install

Airbotics 19 Dec 25, 2022
Entitlement AND Hardened Runtime Check

Python3 script for macOS to recursively check /Applications and also check /usr/local/bin, /usr/bin, and /usr/sbin for binaries with problematic/interesting entitlements. Also checks for hardened run

Cedric Owens 79 Nov 16, 2022
A module to prevent invites and joins to Matrix rooms by checking the involved server(s)' domain.

Synapse Domain Rule Checker A module to prevent invites and joins to Matrix rooms by checking the involved server(s)' domain. Installation From the vi

matrix.org 4 Oct 24, 2022
Site de gestion de cave à vin utilisant une BDD manipulée avec SQLite3 via Python

cave-vin Site de gestion de cave à vin utilisant une bdd manipulée avec MySQL ACCEDER AU SITE : Pour accéder à votre cave vous aurez besoin de lancer

Elouann Lucas 0 Jul 05, 2022
A Dungeon and Dragons Toolkit using Python

Pythons-Dungeons A Dungeon and Dragons Toolkit using Python Rules: -When you are commiting please don't delete parts of the code that are important -A

2 Oct 21, 2021
XlvnsScriptTool - Tool for decompilation and compilation of scripts .SDT from the visual novel's engine xlvns

XlvnsScriptTool English Dual languaged (rus+eng) tool for decompiling and compiling (actually, this tool is more than just (dis)assenbler, but less th

Tester 3 Sep 15, 2022
DOP-Tuning(Domain-Oriented Prefix-tuning model)

DOP-Tuning DOP-Tuning(Domain-Oriented Prefix-tuning model)代码基于Prefix-Tuning改进. Files ├── seq2seq # Code for encoder-decoder arch

Andrew Zeng 5 Nov 02, 2022
ioztat is a storage load analysis tool for OpenZFS

ioztat is a storage load analysis tool for OpenZFS. It provides iostat-like statistics at an individual dataset/zvol level.

Jim Salter 116 Nov 25, 2022
Automatically unpin old messages so you can always pin more!

PinRotate Automatically unpin old messages so you can always pin more! Installation You will need to install poetry to run this bot locally for develo

3 Sep 18, 2022