Skip to content

Ensiss/interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

interpreter

A small interpreter built in nodejs. Because why not ?

How to launch

To interpret a source code file just pass it to main.js like this:

node main expr

If you made changes to the project and want to check if you didn't break everything in the process, just type:

node test

Current state of the project

  • General

    • Error handling
    • Scopes
    • Code blocks
    • Variables and identifiers
    • Multiple instructions
    • If/else branching
    • Loops (do..while/while/for)
    • Custom functions
  • Mathematical expressions

    • Base operators (+-*/)
    • Operator predecence
    • Parenthesis
    • Nested parenthesis
    • Floating point numbers
    • Modulo operator
    • Power operator
    • Variables
    • Logical operators
    • Comparison operators
    • Binary operators
    • Increment and decrement
    • Operation and assignment operators
    • Math functions call (cos/sin/tan)
    • Post increment and decrement

About

A simple interpreter written in javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published