This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imprime.ml
59 lines (56 loc) · 1.86 KB
/
imprime.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module S = Sintatico
open Printf;;
let print_token = let open S in
function
| BOOL b -> printf "BOOL %B" b
| INT i -> printf "INT %d" i
| FLOAT f -> printf "FLOAT %f" f
| CHAR c -> printf "CHAR %c" c
| STRING s -> printf "STRING %s" s
| ID s -> printf "ID %s" s
| PROGRAM -> printf "PROGRAM"
| BEGIN -> printf "BEGIN"
| END -> printf "END"
| FUNCAO -> printf "FUNCAO"
| PROCEDURE -> printf "PROCEDURE"
| WRITE -> printf "WRITE"
| READLN -> printf "READLN"
| VAR -> printf "VAR"
| TBOOL -> printf "TBOOL"
| TINT -> printf "TINT"
| TFLOAT -> printf "TFLOAT"
| TCHAR -> printf "TCHAR"
| TSTRING -> printf "TSTRING"
| APAR -> printf "APAR"
| FPAR -> printf "FPAR"
| ACOL -> printf "ACOL"
| FCOL -> printf "FCOL"
| PTPT -> printf "PTPT"
| PF -> printf "PF"
| VIRG -> printf "VIRG"
| PTVIRG -> printf "PTVIRG"
| OR -> printf "OR"
| AND -> printf "AND"
| NOT -> printf "NOT"
| TRUE -> printf "TRUE"
| FALSE -> printf "FALSE"
| MENOR -> printf "MENOR"
| MAIOR -> printf "MAIOR"
| IGUAL -> printf "IGUAL"
| MAIORIGUAL -> printf "MAIORIGUAL"
| MENORIGUAL -> printf "MENORIGUAL"
| DIFERENTE -> printf "DIFERENTE"
| MAIS -> printf "MAIS"
| MENOS -> printf "MENOS"
| VEZES -> printf "VEZES"
| DIV -> printf "DIV"
| MOD -> printf "MOD"
| ATRIB -> printf "ATRIB"
| IF -> printf "IF"
| ELSE -> printf "ELSE"
| THEN -> printf "THEN"
| DO -> printf "DO"
| TO -> printf "TO"
| WHILE -> printf "WHILE"
| FOR -> printf "FOR"
| EOF -> printf "EOF"