Giter Site home page Giter Site logo

rose's Introduction

ROSE

This is a homework project for compiler principle course of Sun Yat-sen University. ROSE stands for Reverse Oberon Software Engineering, which is the main purpose of the project - design and implement a tool that is used for analysing oberon programs.

Structure

The project contains four parts:

  • ex1: Oberon-0 programming: Write several simple programs in Oberon-0 language
  • ex2: Lexical analysis: Write a lexical analyzer for Oberon-0 language
  • ex3: Semantic translation with JavaCup: Write a syntax analyzer for Oberon-0 language using JavaCup
  • ex4: Semantic translation from scratch: Write a Predictive Recursive Descent Parser for Oberon-0 language, and plot the flow chart of the program
.
├── dependencies   # Dependencies (JFlex, JavaCup, etc.)
|   ├── graphs
|   |   ├── callgraph.jar
|   |   ├── jgraph.jar
|   |   └── flowchart.jar
|   ├── jflex
|   └── javacup
├── ex1            # Oberon-0 programming
|   └── testcases  # Programs in Oberon-0
├── ex2            # Lexical analysis
|   ├── bin        # Compiled classes
|   ├── src        # Source codes
|   └── testcases  # Test cases
├── ex3            # Syntax analysis with JavaCup
|   ├── bin        # Compiled classes
|   ├── src        # Source codes
|   └── testcases  # Test cases
└── ex4            # Syntax analysis from scratch
    ├── bin        # Compiled classes
    ├── src        # Source codes
    └── testcases  # Test cases

Usage

The batch files in each ex folder have been designed with care. You can run them from any directory you like. Additionally for build.bat files, you can specify the very class you want to (re)-compile.

Here are some examples of using the batch files:

# Assume you are in the root folder of the project

# Generate lexer
ex4\generate

# Compile all the classes in ex4
ex4\build

# Run with test case in ex4\testcases\pow.obr
ex4\run .\ex4\testcases\pow.obr

# Assume you suddenly found a bug in the codes and modified Parser.java and Main.java, now you need to recompile them
ex4\build Parser Main

Used Dependencies

The dependencies that are used in this project are listed below:

License

The codes under the src\ folder are licensed under MIT License.

This license does not apply to any code that is directly relevant with or generated by the dependencies.

rose's People

Contributors

linloir avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.