File: README

package info (click to toggle)
ocaml-doc 3.09-1
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 10,428 kB
  • ctags: 4,963
  • sloc: ml: 9,244; makefile: 2,413; ansic: 122; sh: 49; asm: 17
file content (22 lines) | stat: -rw-r--r-- 606 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
This is a simple desk calculator, that illustrates the use of camllex 
and camlyacc. It handles integer arithmetics (+, - (unary and binary), *, /).

To compile: either type "make", "make opt" (native code version), or by hand:

        ocamlyacc parser.mly
        ocamlc -g -c parser.mli
        ocamllex lexer.mll
        ocamlc -g -c lexer.ml
        ocamlc -g -c parser.ml
        ocamlc -g -c calc.ml
        ocamlc lexer.cmo parser.cmo calc.cmo -o calc

To run:

        ./calc

To try interactively:

        ocaml               # or ledit ocaml if ledit is installed.
        #use "loadall.ml";;