new file: .gitignore new file: docs/grammar.md new file: haskell/Lexer.hi renamed: haskell/main.hs -> haskell/Lexer.hs new file: haskell/Lexer.o new file: haskell/Main new file: haskell/Main.hi new file: haskell/Main.hs new file: haskell/Main.o new file: haskell/NewParser.hs new file: haskell/Parser.hi new file: haskell/Parser.hs new file: haskell/Parser.o new file: pascal/arr.pas new file: pascal/modifiers.pas new file: pascal/reserved_words.pas modified: pascal/test.pas
23 lines
542 B
Haskell
23 lines
542 B
Haskell
module Main where
|
|
|
|
import System.IO
|
|
import Lexer
|
|
import Parser
|
|
|
|
{-
|
|
main = do
|
|
let x = [Token "(" OpenParen, Token "1" Number, Token ")" CloseParen, Token ";" EndStatement]
|
|
print (_extractExpression x) -}
|
|
|
|
main = do
|
|
handle <- openFile "../pascal/test.pas" ReadMode
|
|
contents <- hGetContents handle
|
|
let x = tokenize contents
|
|
print x
|
|
let y = parseIntoTree x
|
|
--print y
|
|
--print $ findFirstEmpty x 0
|
|
--print $ take (findFirstEmpty x 0) x
|
|
--print $ makeInt x
|
|
--print $ makeIdentifier x
|
|
hClose handle |