Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.
/ minipascal Public archive

Lexical and Syntax Analyzer for the "Mini" Pascal Language

License

Notifications You must be signed in to change notification settings

navossoc/minipascal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Objective

Develop a Lexical and Syntax Analyzer for the "Mini" Pascal Language (variant/simplified).

Description

The project was created using the Eclipse IDE with the JavaCC Eclipse Plug-in that aims to help the development of projects using the JavaCC.

The source code is located on the javacc folder, while the samples of the mini pascal language are located on the samples folder.

JJTree is a preprocessor for JavaCC, it was used to help the creation of syntax trees.

JUNG Framework is a library that can represent data as a graph, it was used to draw the abstract syntax tree.

Source code

JavaCC

The LMP.jjt file is the main project file that contains the grammar and syntax definitions using JavaCC rules.

It is processed by JJTree that generates the necessary classes to build the tree and creates LMP.jj file which contains the code needed to insert nodes in the tree.

Finally, the LMP.jj file is processed by JavaCC that generates the classes of the lexicon and syntactic analysis.

This whole process is automated by the plugin.

Java

SimpleNode2.java - Responsible for storing the abstract syntax tree and provide some extra functionality for handling the tree. This class extends SimpleNode.java generated by JJTree.

The classes responsible for extracting information from the input source code are in the tools package.

AST.java - Responsible for creating the graph (visual) of the abstract syntax tree.

Report.java - Responsible for extract and sort the symbols (tokens).

Symbols.java - Responsible for generating the list of identifiers (variables).

About

Lexical and Syntax Analyzer for the "Mini" Pascal Language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages