Skip to content
Snippets Groups Projects
Commit 974e95a5 authored by ik1g19's avatar ik1g19
Browse files

add task 3

parent 41d93e19
Branches
Tags
No related merge requests found
Showing with 4062 additions and 0 deletions
module Main where
import Tokens
import System.Environment
import Control.Exception
import System.IO
main :: IO ()
main = catch main' noLex
main' = do (fileName : _) <- getArgs
sourceText <- readFile fileName
putStrLn $ "Lexing: " ++ sourceText
let lexedProg = alexScanTokens sourceText
putStrLn $ "Lexed as: " ++ (show lexedProg)
noLex :: ErrorCall -> IO ()
noLex e = do let err = show e
hPutStrLn stderr ("Problem with lexing :" ++ err)
return ()
\ No newline at end of file
This diff is collapsed.
let x = 34 in x + 17
\ No newline at end of file
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment