~ubuntu-branches/ubuntu/karmic/ocaml-doc/karmic

« back to all changes in this revision

Viewing changes to examples/pascal/syntaxe.mli

  • Committer: Bazaar Package Importer
  • Author(s): Vanicat Rémi
  • Date: 2002-02-05 10:51:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020205105143-a061tunf8tev07ne
Tags: 3.04-4
* New debian maintainer
* Split doc-base file
* Move to non-free
* Change the copyright file to the copyright of the documentation
* remove FAQs (their license prohibit their redistribution)
* corrected the examples

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
type constante =
 
2
  | Enti�re of int
 
3
  | Bool�enne of bool;;
 
4
 
 
5
type expr_type =
 
6
  | Integer                          (* le type des entiers *)
 
7
  | Boolean                          (* le type des bool�ens *)
 
8
  | Array of int * int * expr_type;; (* le type des tableaux *)
 
9
                         (* (les deux "int" sont les bornes) *)
 
10
type expression =
 
11
  | Constante of constante
 
12
  | Variable of string
 
13
  | Application of string * expression list
 
14
  | Op_unaire of string * expression
 
15
  | Op_binaire of string * expression * expression
 
16
  | Acc�s_tableau of expression * expression;;
 
17
 
 
18
type instruction =
 
19
  | Affectation_var of string * expression
 
20
  | Affectation_tableau of expression * expression * expression
 
21
  | Appel of string * expression list   (* appel de proc�dure *)
 
22
  | If of expression * instruction * instruction
 
23
  | While of expression * instruction
 
24
  | Write of expression
 
25
  | Read of string
 
26
  | Bloc of instruction list;;          (* bloc begin ... end *)
 
27
 
 
28
type d�cl_proc =
 
29
  { proc_param�tres: (string * expr_type) list;
 
30
    proc_variables: (string * expr_type) list;
 
31
    proc_corps: instruction }
 
32
and d�cl_fonc =
 
33
  { fonc_param�tres: (string * expr_type) list;
 
34
    fonc_type_r�sultat: expr_type;
 
35
    fonc_variables: (string * expr_type) list;
 
36
    fonc_corps: instruction };;
 
37
 
 
38
type programme =
 
39
  { prog_variables: (string * expr_type) list;
 
40
    prog_proc�dures: (string * d�cl_proc) list;
 
41
    prog_fonctions: (string * d�cl_fonc) list;
 
42
    prog_corps: instruction };;
 
43
 
 
44
val lire_programme : char Stream.t -> programme;;