Giter Site home page Giter Site logo

praj's Introduction

RCode Interpreter

RCode is a simple programming language interpreter built in Rust. This project showcases the implementation of a basic interpreter with lexical analysis, parsing, and evaluation.

Table of Contents

Introduction

This project is a Rust-based interpreter for a custom language, RCode. It includes components for tokenization, parsing, and evaluating expressions. The interpreter can read source code from .pr files, parse them into an abstract syntax tree (AST), and evaluate the expressions.

Features

  • Lexical analysis and tokenization
  • Expression parsing with basic arithmetic operations
  • Evaluation of expressions with runtime error handling

Getting Started

To get started with RCode, you need to have Rust installed on your machine. You can download and install Rust from rust-lang.org.

Prerequisites

  • Rust (installed via rustup)
  • A text editor or IDE (optional, but recommended)

Usage

  1. Clone the repository:

    git clone https://github.com/yourusername/rcode-interpreter.git
    cd rcode-interpreter
  2. Build the project:

    cargo build
  3. Run the interpreter with a .pr file:

    cargo run <path to .pr file>

    Example:

    cargo run examples/add.pr

Example

Here is an example .pr file to test the interpreter:

examples/add.pr

let x = 5;
let y = 10;
print(x + y);

praj's People

Contributors

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