Giter Site home page Giter Site logo

clite's Introduction

Nate Moore

CLite Java Parser

There are four folders:
	src - All source files
	bin - Compiled class files
	doc - Generated javadocs (open Index.html to view)
	programs - Test programs to run with interpreter

To run, do 'java Runner ../programs/[program name]'. It should work with all the test programs. I removed all the main methods from everything except the runner, but I suppose I could add them back if you wanted to test each part individually.

I managed to complete all the parts that were labeled "student exercise" in the code (and then some), which I'm pretty sure covers all the labs (I didn't follow the labs, just "played it by ear").
Overall, this whole thing was almost trivial for me; I've implemented a lot of stuff similar to this before for various projects.

I kind of tore up the source code that the book gave me. I created four packages- syntax, parser, typing, and interpreter- to further distinguish the different parts of the program from each other. I also added a TON of comments and full javadocs.

Inside of the 'syntax' package is the abstract syntax. I split the abstract syntax up into multiple classes inside of a few seperate subpackages, rather than having them all crammed into one file like they had it (the abstract syntax didn't make much sense to me until I did this, then it became immediately clear).

Inside of the 'parser' package is the Lexer and the Parser. No drastic changes here.

Inside of the 'typing' package is the StaticTypeChecker, TypeTransformer and TypeMap.

Inside of the 'interpreter' package is the Semantics and State. I renamed the "Semantics" class to "Interpreter" because the name made more sense to me.

I didn't get around to implementing arrays, but I could probably do so easily.

clite's People

Contributors

tranquilmarmot 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.