NYX-LANG: PROGRAMMING LANGUAGE INTERPRETER DESIGN USING TOP-DOWN OPERATOR PRECEDENCE

Abhinav Gyawali
Abhinav Gyawali
2023
BSc.CSIT
Semester 5
Downloads 18

The Nyx-lang programming language and interpreter were designed to be a simple, expressive tool for learning about programming language design and interpretation. The interpreter uses a top-down operator precedence (TDOP) approach to parse and interpret complex expressions, and supports various language features such as variables, loops, conditional statements, and functions. The interpreter first performs a lexical analysis pass over the source code, the tokens produced in this stage are then parsed into an abstract syntax tree (AST). The type-checker then performs a type checking pass over the AST, this check ensures that the source code doesn’t perform any invalid operation. The check also ensures that the expressions have the correct types and that the return types of functions and expressions are consistent. Finally, the evaluator walks the AST and evaluates each statement. The evaluator can handle complex control flow statements such as loops and conditional statements. Due to the presence of the type-checker, the evaluator is concise and efficient. Overall, the Nyxlang interpreter is an educational tool that provides insight into the design and interpretation of programming languages, and how type-checking can be used to ensure type safety and reliability when writing and executing programs.

Interpreter
Top-Down Operator Precedence
Language Design
Type System
Programming Languages
Interpreter
Top-Down Operator Precedence
Language Design
Type System
Programming Languages

Similar Projects