-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.hs
More file actions
27 lines (22 loc) · 782 Bytes
/
Main.hs
File metadata and controls
27 lines (22 loc) · 782 Bytes
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
module Main (main) where
import qualified System as S
import Lexer
import Parser
import TablaSimbolos
import GeneracionCodigo
import System.IO
import qualified Data.Map as Map
main = do
args <- S.getArgs
nombreEntrada <- return $ head args
nombreSalida <- return $ (head args) ++ ".pl"
aSalida <- openFile nombreSalida WriteMode
contenido <- readFile nombreEntrada
arbol <- return $ parse (lexer contenido)
print arbol
putStr (unlines $ "set term postscript" : generarCodigo arbol (Map.empty))
--Cuando este listo activar esto, escribe en el archivo de texto
--directamente!
--hPutStr aSalida
-- (unlines $ "set term postscript" : generarCodigo arbol (Map.empty))
hClose aSalida