summaryrefslogtreecommitdiff
path: root/src/pretty_typing.ml
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2013-12-05 22:20:54 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2013-12-05 22:20:54 +0100
commita01d09ca4730de4987d67e73a8ee895f77f57f9c (patch)
treee9f667f874572a51988225a45ab698ce079059a9 /src/pretty_typing.ml
parent6973d36261d8030c4836a8e25a0e95c19476978e (diff)
downloadLPC-Projet-a01d09ca4730de4987d67e73a8ee895f77f57f9c.tar.gz
LPC-Projet-a01d09ca4730de4987d67e73a8ee895f77f57f9c.zip
Added tests, corrected two failed tests.
Diffstat (limited to 'src/pretty_typing.ml')
-rw-r--r--src/pretty_typing.ml60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/pretty_typing.ml b/src/pretty_typing.ml
index 371b210..709611b 100644
--- a/src/pretty_typing.ml
+++ b/src/pretty_typing.ml
@@ -9,66 +9,6 @@ open Parser
open Typing
open Ast
-let token_str = function
- | CLASS -> "class"
- | ELSE -> "else"
- | FALSE -> "false"
- | FOR -> "for"
- | IF -> "if"
- | INT -> "int"
- | NEW -> "new"
- | NULL -> "NULL"
- | PUBLIC -> "public"
- | RETURN -> "return"
- | THIS -> "this"
- | TRUE -> "true"
- | VIRTUAL -> "virtual"
- | VOID -> "void"
- | WHILE -> "while"
- | IDENT(s) -> "'"^s^"'"
- | TIDENT(s) -> "\""^s^"\""
- | ASSIGN -> "="
- | LOR -> "||"
- | LAND -> "&&"
- | EQ -> "=="
- | NE -> "!="
- | LT -> "<"
- | LE -> "<="
- | GT -> ">"
- | GE -> ">="
- | PLUS -> "+"
- | MINUS -> "-"
- | TIMES -> "*"
- | DIV -> "/"
- | MOD -> "%"
- | NOT -> "!"
- | INCR -> "++"
- | DECR -> "--"
- | REF -> "&"
- (* and also : unary dereference, plus, minus *)
- | LPAREN -> "("
- | RPAREN -> ")"
- | RARROW -> "->"
- | DOT -> "."
- (* OTHER SYMBOLZ *)
- | SEMICOLON -> ";"
- | DOUBLECOLON -> "::"
- | LFLOW -> "<<"
- | LBRACE -> "{"
- | RBRACE -> "}"
- | COMMA -> ","
- | COLON -> ":"
- (* DATAZ *)
- | INTVAL(i) -> "#" ^ (string_of_int i)
- | STRVAL(s) -> "`" ^ s ^ "`"
- (* STUPIDITIEZS *)
- | STD_COUT -> "std::cout"
- | INCLUDE_IOSTREAM -> "#include <iostream>"
- | EOF -> "end."
-
-let print_tok t =
- print_string ((token_str t) ^ "\n")
-
let csl f l =
List.fold_left
(fun x t -> (if x = "" then "" else x ^ ", ") ^ (f t)) "" l