Skip to content

kadriandev/java-compiler

Repository files navigation

A JFlex+Cup implementation for the C Minus programming language.

To build the parser, type "make" in the current directory, which will 
generate an executable program called "Main".

  To test source code like "1.cm", type 

    "java -cp /usr/share/java/cup.jar:. Main test_files/1.cm" 

and the syntax tree will be displayed on the screen.

  To rebuild the parser, type "make clean" and type "make" again.

  Also note that all the abstract syntax tree structures are defined under
the directory "absyn" and the methods for showing a syntax tree is implemented
by the visitor pattern in "ShowTreeVisitor.java".  Since some java files are 
generated automatically, they may contain variables that are not used, which 
are safe to ignore in the compilation process.

Make will also compile tm.

To use tm, type
  "./tm 1.tm"

About

Project to create a compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •