Skip to content

bweir/spindrake

Repository files navigation

spindrake

Experiments in using Bison/Flex for Spin parsing

Design Goals

  • Fewer operators
    • Replaced operators
      • ^^x -> sqrt(x)
      • ||x -> abs(x)
      • x #> y -> max(x, y)
      • x <# y -> min(x, y)
      • ?x -> rand(x)
      • =< -> <=
      • => -> >=
    • Removed operators
      • =>=
      • =<=
      • <=
      • >=
      • <>=
      • ===
      • and=
      • or=
      • **
      • **=
      • x?
      • |<
      • >|
      • +x
    • Removed keywords
      • constant
      • string
  • Single address operator: @
  • Automatic constant folding
  • Automatic string termination (no string() keyword)
  • address[0] -> address
  • Unused code removal
  • Subdirectory support
  • Dedicated ASM block for assembly

Specification

Operators

From highest precedence to lowest:

  1. Unary: --, ++, ~, ~~, @
  2. Unary: -, !
  3. Shift: <<, >>, ~>, <-, ->, ><
  4. Bitwise and: &
  5. Bitwise or: |, ^
  6. Multiplicative: *, /, //
  7. Additive: +, -
  8. Relational: ==, <>, <, >, <=, =>
  9. Boolean not: not
  10. Boolean and: and
  11. Boolean or: or
  12. Assignment: :=, +=, -=, *=, /=, //=, <<=, >>=, ~>=, ->=, <-=, ><=, &=, |=, ^=

About

Experiments in using Bison/Flex for Spin parsing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published