0xa48rx394r83e9 / Nutri-lang

Nutri-lang is an educational programming language designed to showcase the inner workings and concepts behind interpretive languages. It serves as a simple and straightforward example to demonstrate how source code is parsed, interpreted, and executed in a step-by-step manner.
1 stars 0 forks source link

Nutri-lang

example

  1. 📚 Language Specification

    • Syntax and Grammar:
      • Variables: var x = 10;
      • Arithmetic operations: +, -, *, /
      • Comparison operators: ==, !=, <, >, <=, >=
      • Control flow: if, else, while, for
      • Functions: func add(a, b) { return a + b; }
    • Data Types: int, float, bool, string
  2. 🧩 Lexical structure — (recursive descent parser for simplicity)

    • Lexical structure:
      • Keywords: var, if, else, while, for, func, return
      • Identifiers: Alphanumeric characters and underscores, starting with a letter or underscore.
      • Literals: Integers, floating-point numbers, booleans (true, false), strings (enclosed in double quotes).
      • Operators: +, -, *, /, ==, !=, <, >, <=, >=, =
      • Delimiters: (, ), {, }, ;