In this variant of the calc demo, the parser's semantic actions are
parameterized over a structure, called Semantics
, which defines how numbers
should be interpreted. The parser is later instantiated with floating-point
numbers, so the calculator actually performs floating-point evaluation -- but
the grammar specification is independent of this detail.

POTTIER Francois
authored
I introduced this problem in a previous commit where I wanted to share the lexer between several demos.
Name | Last commit | Last update |
---|---|---|
.. | ||
Makefile | ||
README.md | ||
calc.exp | ||
calc.in | ||
calc.ml | ||
dune | ||
lexer.mll | ||
parser.mly | ||
tokens.mly |