Coder Social home page Coder Social logo

alexlemna / pox Goto Github PK

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

A Python 3.12 implementation of a Lox interpreter, following along with Robert Nystrom's book "Crafting Interpreters"

Home Page: http://craftinginterpreters.com/

License: MIT License

Python 100.00%
crafting-interpreters interpreter lox parser tree-walk-interpreter

pox's Introduction

Pox

My attempt at crafting an interpreter for the Lox programming language in Python, following the wonderful Crafting Interpreters (full-text website, GitHub repository) by Robert Nystrom.

For this first implementation, I've decided to keep the code as close as possible to the Java code that Nystrom originally used.

When I get stuck or need inspiration, I'm referring to:

Current progress

  • Chapter 4: Scanning.

    • 4.1: The Interpreter Framework
    • 4.2: Lexemes and Tokens
    • 4.3 Regular Languages and Expressions (no code)
    • 4.4: The Scanner Class
    • 4.5: Recognizing Lexemes
    • 4.6: Longer Lexemes
    • 4.7: Reserved Words and Identifiers
  • Chapter 5: Representing Code

    • 5.1: Context-Free Grammers (no code)
    • 5.2: Implementing Syntax Trees
    • 5.3: Working with Trees
    • 5.4: A (Not Very) Pretty Printer
  • Chapter 6: Parsing Expressions

    • 6.1: Ambiguity and the Parsing Game
    • 6.2: Recursive Descent Parsing
    • 6.3: Syntax Errors
    • 6.4: Wiring up the Parser
  • Chapter 7: Evaluating Expressions

    • 7.1: Representing Values
    • 7.2: Evaluating Expressions
    • 7.3: Runtime Errors
    • 7.4: Hooking Up the Interpreter
  • Chapter 8: Statements and State

    • 8.1: Statements
    • 8.2: Global Variables
    • 8.3: Environments
    • 8.4: Assignment
    • 8.5: Scope
  • Chapter 9: Control Flow

    • 9.1: Turing Machines (Briefly)
    • 9.2: Conditional Execution
    • 9.3: Logical Operators
    • 9.4: While Loops
    • 9.5: For Loops
  • Chapter 10: Functions

    • 10.1: Function Calls
    • 10.2: Native Functions
    • 10.3: Function Declarations
    • 10.4: Function Objects
    • 10.5: Return Statements
    • 10.6: Local Functions and Closures
  • Chapter 11: Resolving and Binding

    • 11.1: Static Scope
    • 11.2: Semantic Analysis
    • 11.3: A Resolver Class
    • 11.4: Interpreting Resolved Variables
    • 11.5: Resolution Errors
  • Chapter 12: Classes

    • 12.1: OOP and Classes
    • 12.2: Class Declarations
    • 12.3: Creating Instances
    • 12.4: Properties on Instances
    • 12.5: Methods on Classes
    • 12.6: This
    • 12.7: Constructors and Initializers
  • Chapter 13: Inheritance

    • 13.1: Superclasses and Subclasses
    • 13.2: Inheriting Methods
    • 13.3: Calling Superclass Methods
    • 13.4: Conclusion

pox's People

Contributors

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