Skip to content

n2o/PascalCompilerInJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

48d434a · Jan 4, 2016

History

64 Commits
Jan 1, 2016
Feb 15, 2014
Jan 1, 2016
Dec 2, 2012
Jan 20, 2013
Jan 16, 2013
Jan 16, 2013
Jan 20, 2013
Jan 20, 2013
Jan 1, 2016
Feb 15, 2014
Feb 15, 2014
Jan 16, 2013
Jan 16, 2013
Dec 2, 2012
Jan 16, 2013
Dec 21, 2012
Dec 5, 2012
Jan 10, 2013
Jan 16, 2013

Repository files navigation

Pascal Compiler in Java

Created a Compiler for Simple Pascal in Java with SableCC. Simple Pascal is a subset of the normal Pascal.

This Compiler takes a Pascal file and creates a *.class file for it, which can be executed using Java as usual.

Compiling a file and liveness analysis

  1. I attached a build.xml file to use sablecc automatically to use my specified grammar in Java. So just type in your shell:

> ant

or by hand:

> java -jar sablecc.jar sablecc.scc

  1. Compile all created classes

> javac *.java

  1. Start compiling with:

> java StupsCompiler -compile <Filename.pas>

  1. OR start a liveness analysis for all variables used in the Pascal file

> java StupsCompiler -liveness <Filename.pas>

  1. Create Bytecode with jasmin

> java -jar jasmin.jar <Filename.j>

  1. Execute compiled Pascal file

> java Filename

About

Compiler for Simple Pascal in Java with SableCC

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published