LTGen provides classic algorithms used in Language Theory.

Related tags

Miscellaneous LTGen
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
You might also like...
Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file
Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file

Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file. VISD can also perform vehicle speed detection on a video. All these features of VSID are provided to the user using a Web Application which is created using Flask

skimpy is a light weight tool that provides summary statistics about variables in data frames within the console.
skimpy is a light weight tool that provides summary statistics about variables in data frames within the console.

skimpy Welcome Welcome to skimpy! skimpy is a light weight tool that provides summary statistics about variables in data frames within the console. Th

a package that provides a marketstrategy for whitelisting on golem

filterms a package that provides a marketstrategy for whitelisting on golem watching requestor logs distribute 10 tasks asynchronously is fun. but you

pvaPy provides Python bindings for EPICS pvAccess

PvaPy - PvAccess for Python The PvaPy package is a Python API for EPICS7. It supports both PVA and CA providers, all standard EPICS7 types (structures

Provides guideline on how to configure pre-commit hooks in your own python project
Provides guideline on how to configure pre-commit hooks in your own python project

Pre-commit Configuration Guide The main aim of this repository is to act as a guide on how to configure the pre-commit hooks in your existing python p

Blender Add-on That Provides Quick Access to Render Controls
Blender Add-on That Provides Quick Access to Render Controls

Blender Render Buttons Blender Add-on That Provides Quick Access to Render Controls A Blender 3.0 compatablity update of Blender2.8x-RenderButton v0.0

This script provides LIVE feedback for On-The-Fly data collection with RELION

README This script provides LIVE feedback for On-The-Fly data collection with RELION (very useful to explore already processed datasets too!) Creating

This repository provides a set of easy to understand and tested Python samples for using Acronis Cyber Platform API.

Base Acronis Cyber Platform API operations with Python !!! info Copyright © 2019-2021 Acronis International GmbH. This is distributed under MIT licens

A Python package that provides astronomical constants.

AstroConst A Python package that provides astronomical constants. The code is being developed by Marc van der Sluys of the department of Astrophysics

Owner
Hugues Cassé
Professor-assistant in University of Toulouse, France.
Hugues Cassé
Repository for DNN training, theory to practice, part of the Large Scale Machine Learning class at Mines Paritech

DNN Training, from theory to practice This repository is complementary to the deep learning training lesson given to les Mines ParisTech on the 11th o

Alexandre Défossez 6 Nov 14, 2022
the classic version Of torrentleechx #Unmaintained #Archived

TorrentleechX-Classic Old Modified Version Repo #Unmaintained #Archived for support join here working example group Leech Here For Any Issues/Imroveme

XcodersHub 18 Jan 30, 2022
Data Structures and Algorithms Python - Practice data structures and algorithms in python with few small projects

Data Structures and Algorithms All the essential resources and template code nee

Hesham 13 Dec 1, 2022
Originally used during Marketplace.tf's open period, this program was used to get the profit of items bought with keys and sold for dollars.

Originally used during Marketplace.tf's open period, this program was used to get the profit of items bought with keys and sold for dollars. Practically useless for me now, but can be used as an example of tkinter.

BoggoTV 1 Dec 11, 2021
Rick Astley Language is a rick roll oriented, dynamic, strong, esoteric programming language.

Rick Roll Language / Rick Astley Language A rick roll oriented, dynamic, strong, esoteric programming language. Prolegomenon The reasons that I made t

Rick Roll Programming Language 658 Jan 9, 2023
PyGo custom language, New but similar language programming

New but similar language programming. Now we are capable to program in a very similar language to Python but at the same time get the efficiency of Go.

Fernando Perez 4 Nov 19, 2022
A simple language for new programmers and a toy language ;)

Yell An extremely simple, yet powerful language for new programmers, as well as a toy language ;) Explore the docs » Report Bug · Request Feature Yell

Yell 4 Dec 28, 2021
A C-like hardware description language (HDL) adding high level synthesis(HLS)-like automatic pipelining as a language construct/compiler feature.

██████╗ ██╗██████╗ ███████╗██╗ ██╗███╗ ██╗███████╗ ██████╗ ██╔══██╗██║██╔══██╗██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝ ██████╔╝██║██████╔╝█

Julian Kemmerer 391 Jan 1, 2023
💻 Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your DSA journey.📰🔥 This repository contains the REST APIs of the application.✨

Algo-Phantom-Backend ?? Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your D

Algo Phantoms 44 Nov 15, 2022
Socorro is the Mozilla crash ingestion pipeline. It accepts and processes Breakpad-style crash reports. It provides analysis tools.

Socorro Socorro is a Mozilla-centric ingestion pipeline and analysis tools for crash reports using the Breakpad libraries. Support This is a Mozilla-s

Mozilla Services 552 Dec 19, 2022