Skip to content

Releases: Samathingamajig/BarkScript

Version 0.0.3

05 Feb 18:54

Choose a tag to compare

This implements a simple lexer and simple parser.

Tokens:

  • PLUS = +
  • MINUS = -
  • ASTERISK = *
  • F_SLASH = /
  • OPEN_PAREN (not parseable yet) = (
  • CLOSE_PAREN (not parseable yet) = )
  • NUMBER = /d+
  • EEOF = \0
  • UNKNOWN = (anything else)

Syntax:

expr     : term ((PLUS|MINUS) term)*

term     : factor ((ASTERISK|F_SLASH) factor)*

factor   : NUMBER