Experiments in using Bison/Flex for Spin parsing
- 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
- Replaced operators
- 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
From highest precedence to lowest:
- Unary:
--
,++
,~
,~~
,@
- Unary:
-
,!
- Shift:
<<
,>>
,~>
,<-
,->
,><
- Bitwise and:
&
- Bitwise or:
|
,^
- Multiplicative:
*
,/
,//
- Additive:
+
,-
- Relational:
==
,<>
,<
,>
,<=
,=>
- Boolean not:
not
- Boolean and:
and
- Boolean or:
or
- Assignment:
:=
,+=
,-=
,*=
,/=
,//=
,<<=
,>>=
,~>=
,->=
,<-=
,><=
,&=
,|=
,^=