Keine Beschreibung

runningwater 11f87c94bc representing code vor 2 Jahren
.idea 73ff604276 first interpreter framework vor 2 Jahren
doc 73ff604276 first interpreter framework vor 2 Jahren
src 11f87c94bc representing code vor 2 Jahren
.gitignore 3d2508ae84 first commit vor 2 Jahren
README.md 11f87c94bc representing code vor 2 Jahren
pom.xml 3d2508ae84 first commit vor 2 Jahren

README.md

Lox

 // Your first Lox program!
 print "Hello, world!";
  • Dynamic typing
  • Automatic memory management
  • Data Types
    • Booleans
    • Numbers
    • Strings
    • Nil
  • Expressions
    • Arithmetic
    • Comparison and equality
    • Logical operators
    • Precedence and grouping
  • Statements
  • Variables
  • Control Flow
  • Functions
  • Closures
  • Classes

A Grammar for Lox expressions

  • Literals. Numbers,strings,Booleans, and nil
  • Unary expressions. A prefix ! to perform a logical not, and - to negate a number.
  • Binary expressions. The infix arithmetic(+,-,*,/) and logic operators (==, !=, <, <=,>,>=)
  • Parentheses. A pair of ( and ) wrapped around and expression.

    • Syntax tree
    expression     → literal
    | unary
    | binary
    | grouping ;
      
    literal        → NUMBER | STRING | "true" | "false" | "nil" ;
    grouping       → "(" expression ")" ;
    unary          → ( "-" | "!" ) expression ;
    binary         → expression operator expression ;
    operator       → "==" | "!=" | "<" | "<=" | ">" | ">="
    | "+"  | "-"  | "*" | "/" ;