X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=blobdiff_plain;f=compiler%2Fsrc%2Flib%2Ftiger%2Ftiger_absyn.ml;h=73a081a0df5dc906c1d5b4c3772726e5c9c35cd4;hp=6e4a7e901cdc74da51c3b863570c5a99cc1130fd;hb=c16dd441582b7c7c09cdb3e706f4767a5b266177;hpb=be22952d3228b62e546756299a0f9a127ae64921 diff --git a/compiler/src/lib/tiger/tiger_absyn.ml b/compiler/src/lib/tiger/tiger_absyn.ml index 6e4a7e9..73a081a 100644 --- a/compiler/src/lib/tiger/tiger_absyn.ml +++ b/compiler/src/lib/tiger/tiger_absyn.ml @@ -175,6 +175,21 @@ and fundec = type t = exp +(* For printing error messages *) +let op_show op = + match op with + | PlusOp -> "+" + | MinusOp -> "-" + | TimesOp -> "*" + | DivideOp -> "/" + | EqOp -> "=" + | NeqOp -> "<>" + | LtOp -> "<" + | LeOp -> "<=" + | GtOp -> ">" + | GeOp -> ">=" + +(* For printing AST *) let op_to_string op = match op with | PlusOp -> "PlusOp"