Code Monkey home page Code Monkey logo

minijs-repl-scala's Introduction

#MiniJS-REPL-Scala

Loyola University Chicago

COMP 372 - Programming Languages

Spring 2015 - Project 3 MiniJS REPL in Scala

Project 3a

In this project, you will write a front end (lexical and syntax analysis combined as a PEG) for a Scala-based interpreter/REPL for the simple imperative language MiniC (you will work on the actual interpreter in project 3b and subsequent stages). Your recommended starting point is the expressions-scala example.

  • Extend grammar to support MiniJS's imperative constructs (statements)
  • Extend abstract syntax tree to support the imperative constructs
  • Extend the parser to support the imperative constructs
  • Extend the unparser (pretty-printer) to support the imperative constructs

Project 3b

In this project, you will continue your work from project 3a by implementing the dynamic language semantics of MiniJS as part of the evaluator/interpreter. (This was disabled for project 3a because it did not yet handle the imperative constructs). Use the simple imperative language example for additional guidance.

  • Support dynamic semantics of the new imperative constructs (statements)
  • Create mutable store to map named variables to storage cells where values can be stored

Project 3c

In this project, you will add proper data structures (product or aggregation types) to the MiniJS language by adding constructs for:

- structure creation
- field selection
- assignment to an existing field in a structure
- addition of a new field to a structure

To this end, we will extend both the grammar and the interpreter. You may refer to this structural operational semantics example for a simpler version of this language (without field addition).

  • Changes to the grammar
  • Additions to the AST and unparser
  • Support in the interpreter

Note: If statements in our program do not work exactly like they do in the JavaScript console. The initial if statement contains an equals expr that returns a boolean indicating whether or not the left and right sides of the equals expr are in fact equal. Ex:

if(1+1=2){3;} else {4;}

returns 3, and

if(1+1=9){3;} else {4;}

returns 4.

Starting Point: A simple expression evaluator in Scala using parboiled2 for parsing.

minijs-repl-scala's People

Contributors

csoulakian avatar klaeufer avatar farhadnasimi avatar

Watchers

James Cloos avatar  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.