Skip to content

Latest commit

 

History

History
43 lines (36 loc) · 1.23 KB

File metadata and controls

43 lines (36 loc) · 1.23 KB

What is Starxly 🌠🌌?

Starxly is an interpreted mini programming language based on BASIC. It offers features to do arithmetic with integers and floats and has a simple grammar that defines the language.

Features of Starxly

  • Simple syntax
  • Supports floating point and integer numbers
  • Additon: 1 + 2 = 3
  • Subtraction: 1 - 2 = -1
  • Multiplication: 1 * 2 = 2
  • Division: 1 / 2 = 0.5
  • Unary Operators: -1 + 2 = 1
  • Precedence Rules: (9 * 8) - (-4 * 5) + 47 = 139

Starxly's Grammar

Starxly's grammar is composed of expressions. Expressions are composed of terms and factors. Terms are composed of factors. Factors are the most fundamental elements in Starxly's grammar. With expressions, terms and factors, we can define the starxly programming language in its entirety.

Concept Pattern
expression term ((PLUS|MINUS) term)*
term factor ((MUL|DIV) factor)*
factor INT|FLOAT
(PLUS|MINUS) factor
LPAREN expression RPAREN