Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spkenkare/Interpreter
https://github.com/spkenkare/Interpreter
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/spkenkare/Interpreter
- Owner: spkenkare
- Created: 2017-07-19T23:53:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-19T23:55:49.000Z (over 7 years ago)
- Last Synced: 2024-04-24T16:41:38.742Z (10 months ago)
- Language: C
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
- AwesomeInterpreter - Interpreter
README
Due date: Sunday 1/24/2016 @ 11:59pm
Objective:
~~~~~~~~~~- Become familiar with the project submission environment
- Introduction to C programming
- Help you think about test cases and ambiguities in specificationsAssignment:
~~~~~~~~~~~(1) Write an interpreter for a simple programming language:
- The program is passed as a command line argument to the interpreter
- A program consists of a sequence of assignment statements
- Each statement is terminated with ';'
- The left hand side of an assignment is always a simple variable
- Variable names can only contain a single lower-case letter
- The right hand side of an assignment is always a positive integer literal
- All variables are initialized to 0
- The interpreter prints the values of all the non-zero variables in
alphabetical order when it finishes interpreting the program- Unexpected characters are ignored
(2) Donate a test case by adding two files:
.test : the test
.ok : the expected outputWhere is you CS ID (not your UTEID)
(3) Answer the questions in REPORT.txt
Examples:
~~~~~~~~~./p1 "x = 10;"
x:10./p1 "x = 2_09 ; a = 17;"
a:17
x:209Files you're allowed to change:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~p1.c
.test
.okFiles you're supposed to leave alone:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Everything else
To compile:
~~~~~~~~~~~make
To run tests:
~~~~~~~~~~~~~make clean test
To make the output less noisy:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~make -s clean test
To debug with gdb
~~~~~~~~~~~~~~~~~make
gdb ./p1
(gdb) run "x = 100; a = 30;"