![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | Makefile | 2004-11-27 05:11 | 276 | |
![]() | README.html | 2004-11-27 05:28 | 649 | |
![]() | arith.l | 2004-11-27 05:04 | 1.3K | |
![]() | arith.y | 2004-11-27 05:18 | 2.7K | |
This is a simple lexer/parser I wrote while teaching myself about lex and yacc. It evaluates expressions closely resembling C infix syntax, omitting the assignments, function calls, etc. For example:
1 + 2
3
1 * 56 - 2
54
(1 - 2) * 5
-5
(1 ^ 3) << 1
4
(true && false) || (false || true)
1
Throwing it on the web because when I searched around I found lots of examples much like this one but none of them in a state where they could actually be compiled, run and tinkered with.