Git Product home page Git Product logo

scheme_interpreter_c's Introduction

Intepreter project

Tina Liu, Chae Kim, James Yang

Our interpreter project takes in a file of Scheme codes and evaluate them according to the syntax of R5RS, a dialect of Scheme.

Our project supports methods that include:

  1. Special forms: let, letrec, let*, quote, define, lambda, set!, and, or, cond, begin
  2. Primitive functions: +, -, *, /, null?, car, cdr, cons, <=, pair?, eq?
  3. Library procedures (the following functions can be used by calling (load "XX.scm") in your file):

i) library.scm: not, equal?

ii) math.scm: =, zero?, >=, <, >, positive?, negative?, abs, truncate, ceiling, floor, round, modulo, even?, odd?, max, min, gcd, lcm

iii) lists.scm: list, append, caar, cadr, list?, length, list-ref, list-tail, member

Here is the list of extensions we implemented for this project:

  1. lambda/let/letrec/let* support multiple body expressions, in which case they evaluate all and return the last one
  2. if supports missing alternative statement
  3. 'expr works as an alternative to (quote expr)
  4. Our tokenizer/parser/intepreter give out informative error messages
  5. Supports the syntactic sugar for binding variables to procedure
  6. Supports internal definitions in the body of lambda/let/letrec/let* expressions (unless define is the last in the body with no preceding non-definition expressions (matches behavior of DrRacket))
  7. Supports correct return types for + (ex. it returns an integer if all the input numbers are integers)
  8. Supports dotted pair notation for input
  9. Implements the function "load" such that (load "filename") will read the file and execute the Scheme codes within it
  10. Supports correct behaviors for the primitive functions - and / such that it allows only one argument as well
  11. Cond supports clauses with zero or more arguments
  12. We support additional built-in functions for lists.scm: caar, cadr, list?, length, list-ref, list-tail, member
  13. We support additional built-in functions for math.scm: =, >=, <, >, zero?, positive?, negative, even?, odd?, max, min, abs, gcd, lcm, modulo, floor, ceiling, truncate, round

Thanks for viewing our project!

scheme_interpreter_c's People

Contributors

tinaliu000 avatar kimcw2 avatar formidify 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.