Skip to content

joseotoro/SyntacticAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Syntactic Analyzer

The treatment of languages is an essential part of computer science. As such, writing a syntactic analyzer as a way to better understand the behaviour of common compilers is quite interesting from the academic point of view.

This tool can help students understand how the process of syntactic analysis is performed, it includes two distinct parsers:

  • A Top-Down parser: LL(1) (Left-to-right, Leftmost derivation)
  • A Bottom-Up parser: SLR(1) (Simple Left-to-right, Rightmost derivation)

Also, this implementation shows the internal AT (Action / Transition) table for the SLR parser, list of items generated from the grammar's rules, director's symbols for the LL parser, as well as the derivation sequence from an input string.

Requeriments

  • Java JDK 6 (or higher)
  • Git
  • Ant (not mandatory)

Usage

Download:

$ git clone https://github.com/joseotoro/SyntacticAnalyzer.git
$ cd SyntacticAnalyzer

Compile:

$ ant compile
$ ant jar

Run:

$ java -jar Analyzer.jar

(You can also compile and run with javac and java, respectively)

Grammar formats

  • GRA grammar
  • DAT grammar

(You can check the examples on the 'grammars' folder)

Implementation notes

  • SLR Analysis: In case of conflict, reduction is applied.

About

Implementation of LL & SLR Parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages