GithubHelp home page GithubHelp logo

rlox's Introduction

rlox

rlox is a Rust-based interpreter for the Lox programming language. It offers a comprehensive implementation covering lexical analysis, parsing, environment management, and interpretation.

Overview of Modules

'ast.rs'

  • Function: Defines the abstract syntax tree (AST) for the interpreter.
  • Details: Uses macros for flexible AST structure definitions, crucial for handling Lox language expressions and statements.

'environment.rs'

  • Function: Manages the execution environment for variables and scopes.
  • Details: Implements scope management using hash maps, essential for variable handling in the interpreter.

'interpreter.rs'

  • Function: The core interpreter logic.
  • Details: Integrates lexer, parser, and environment modules. Handles expression evaluation and statement execution.

'lexer.rs'

  • Function: Tokenizes Lox source code.
  • Details: Detailed lexical analysis logic for handling various token types.

'main.rs'

  • Function: Entry point of the application.
  • Details: Initializes and starts the interpreter by integrating various modules.

'parser.rs'

  • Function: Parses tokens into an AST.
  • Details: Robust parsing logic, capable of handling complex syntactical structures.

'token.rs'

  • Function: Defines token structure and types.
  • Details: Fundamental to the lexer and parser modules, outlines syntax elements of Lox.

'value.rs'

  • Function: Defines value types in Lox.
  • Details: Handles value evaluation and is key for expression and statement operations.

'visitor.rs'

  • Function: Implements the visitor pattern for AST.
  • Details: Separates tree structure from operations, allowing modular and flexible design.

Installation

git clone [email protected]:dbolivar25/rlox.git
cd rlox

Usage

REPL Interpreter

cargo run

File Interpreter

cargo run -- -f <your_file_name>

rlox's People

Contributors

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