Skip to content

A Java-based compiler functionality project for the "Κ31 Compilers" course at DiT, NKUA. It generates a Symbol Table and performs semantic checks on MiniJava programs. It involves visitor patterns for class/type extraction, field/method aggregation, and extensive semantic analysis within method bodies.

Notifications You must be signed in to change notification settings

NikosMav/Compilers-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Compilers Assignment - Symbol Table Generation and Semantic Checks

Program Structure

The code for the assignment is organized across the following Java files:

  • Data.java
  • IdData.java
  • MethodData.java
  • ClassData.java
  • SymbolTable.java
  • Visitor1.java
  • Visitor2.java
  • Visitor3.java
  • Main.java

The Visitor1, Visitor2, and Visitor3 files are responsible for the collection of all classes and new types, the aggregation of all fields and methods of the classes, and performing semantic checks on various expressions and statements within methods, respectively.

Throughout these processes, various other semantic checks are concurrently performed. During the execution of all Visitors, a correctly structured Symbol Table is constructed, which, at the end, is printed with the various offsets set for the fields and methods of each class according to the rules set forth in the assignment description.

Program Execution

The provided makefile from the original file distribution was used to execute the program. To run multiple files, the syntax should be as specified in the assignment description. However, if a file containing a semantic error is provided, the program will terminate and print an error message.

License

This project is for educational use only and is part of the coursework for Κ31 Compilers at DiT, NKUA.

About

A Java-based compiler functionality project for the "Κ31 Compilers" course at DiT, NKUA. It generates a Symbol Table and performs semantic checks on MiniJava programs. It involves visitor patterns for class/type extraction, field/method aggregation, and extensive semantic analysis within method bodies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages