GithubHelp home page GithubHelp logo

munz11 / assignment02141 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 127 KB

The overall goal of the assignment is to build a tool for running and analyzing programs written in a variant of the Guarded Command Language (GCL).

F# 100.00%

assignment02141's Introduction

Assignment02141

**We are currently still working through some issues concerning updating arrays and some type matching.

The overall goal of the assignment is to build a tool for running and analyzing programs written in a variant of the Guarded Command Language (GCL). The language for all the files is F# The assignment is divided in tasks. Each task is devoted to a module of the tool (a parser, a compiler, an interpreter and several analysers). Each module should be runnable as a standalone program that takes as input a GCL program and produces a result.

The currently the module represents a parser which reads a GCL program as input and returns an abstract syntax tree. At the moment the program is set up such that the GCL program input must start with the expressions supported by C. If the program is incorrect, currently no hints are given to fix it, rather an error message will appear.

The Guarded command language supported by this parser is: C ::= x := a | A[a] := a | skip | C ; C | if GC fi | do GC od GC ::= b -> C | GC [] GC a ::= n | x | A[a] | a + a | a - a | a * a | a / a | - a | a ^ a | (a) b ::= true | false | b & b | b | b | b && b | b || b | !b | a = a | a != a | a > a | a >= a | a < a | a <= a | (b)

The variables x are strings matching the regular expression ['a'-'z''A'-'Z']['a'-'z''A'-'Z'\d_]* The numbers N match the regular expression \d+ A whitespace matches the regular expression [\u00A0 \n \r \t], with a mandatory whitespace after if, do, and before fi, od. Whitespaces are ignored anywhere else. Precedence and associativity rules:

  • In arithmetic expressions, precedence is highest for - (unary minus), then ^, then * and /, and lowest for + and - (binary minus).
  • In boolean expressions, precedence is highest for !, then & and &&, and lowest for | and ||.
  • Operators *, /, +, -, &, |, &&, and || are left-associative.
  • Operators ^, [], and ; are right associative.

We are currently still working through some issues concerning array memory and the GC [] GC command.

assignment02141's People

Contributors

munz11 avatar kinolita avatar

Watchers

 avatar

assignment02141's Issues

Test cases for A

there should be atleast 1 test case for each type of expression

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.