Skip to content

steven-freed/language-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

Interpreter

Interpreter Written in Python. The Language is still in progress...

EBNF Grammar

found in /src/grammar.md

Quick Start: Repl

  1. Clone Repo

  2. Start Repl

> python interpreter.py
  1. Expressions
> 2 + 4 * 5
22

Precedence (Default is Left Associative)

> (2 + 4) % 5
1
> 2 + 4 % 5
6
> (FALSE AND TRUE) OR TRUE
TRUE
> FALSE AND (TRUE OR TRUE)
FALSE
  1. Data Types; Empty, String, Number, Boolean
> x ::= {}
> x ::= "hello"
> x ::= 'world'
> x ::= 123
> x ::= 123.45
> x ::= TRUE
> x ::= FALSE
  • Functions and Lambda Functions
> func foo(x, y) -> { 
    return x + y
}
> func bar(x, y) -> x * y
> foo(1, 2)
3
> bar(3, 3)
9

To See History Press 'Up Arrow' Key

About

Interpreter for a specified Grammar

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages