diff --git a/Exam1.txt b/Exam1.txt index 25acad39bb6909c4db6599f78b291917e17fe33f..51fad5db360b8b0e7b70da97bfe99ef48fd59855 100644 --- a/Exam1.txt +++ b/Exam1.txt @@ -1,2 +1,15 @@ t1 << tile1; -print t1; \ No newline at end of file +t2 << tile2; +t3 = joinH t1 t2; +t4 = joinH t2 t1; +t5 = t3; +t6 = t4; +repeat 31 {t5 = joinH t5 t3;}; +repeat 31 {t6 = joinH t6 t4;}; +t7 = joinV t5 t6; +t8 = t7; +repeat 31 {t8 = joinV t7 t8;}; +print t8; +t9 = width t8; +print t9; +print height t8; \ No newline at end of file diff --git a/Grammar.hi b/Grammar.hi index 151d36921e966e6b0f98da25e8eff52a9e7bf58a..2d594f029888cc813ae6e2b451229a33697e488f 100644 Binary files a/Grammar.hi and b/Grammar.hi differ diff --git a/Grammar.hs b/Grammar.hs index 87bda9a3ac09d3221241fb4ef5e8d5771aad04a9..85f591007d629719c4e3247828e47d408a8d3ddc 100644 --- a/Grammar.hs +++ b/Grammar.hs @@ -6,7 +6,7 @@ import qualified Data.Bits as Bits import Control.Applicative(Applicative(..)) import Control.Monad (ap) --- parser produced by Happy Version 1.20.1.1 +-- parser produced by Happy Version 1.20.0 data HappyAbsSyn t4 t5 = HappyTerminal (Token) diff --git a/Grammar.o b/Grammar.o index 8e45a8b543c5f82f9afa20bcafeb29acf820cae0..316c974c8fb73f84f97d4dd393f4ff94ae33cfc9 100644 Binary files a/Grammar.o and b/Grammar.o differ diff --git a/Julio.exe b/Julio.exe index c46c787a5d6ddfce7fc09278a76ffb07fedc7981..6d3ddae9efd5c057ecc6f07a96d8ae286d8dc0ae 100644 Binary files a/Julio.exe and b/Julio.exe differ diff --git a/Julio.hi b/Julio.hi index 5b1622cc92d9da7862cbf48527db20ee1ee8d948..c11ba93d261a4b9f149add0811101130f403c405 100644 Binary files a/Julio.hi and b/Julio.hi differ diff --git a/Julio.hs b/Julio.hs index adfe82ec2a54033e5068c220280e728478466ad2..37ee4d50a295a3dc6e9c21b6c236070ba42ce36b 100644 --- a/Julio.hs +++ b/Julio.hs @@ -16,20 +16,21 @@ main = catch lexing noLex lexing = do (fileName : _ ) <- getArgs sourceText <- readFile fileName - putStrLn ("Lexing : " ++ sourceText) + --putStrLn ("Lexing : " ++ sourceText) let lexedProg = alexScanTokens sourceText - putStrLn ("Lexed as " ++ (show lexedProg)) + --putStrLn ("Lexed as " ++ (show lexedProg)) catch (parsing lexedProg) noParse parsing lexedProg = do let parsedProg = parseJulio lexedProg - putStrLn ("Parsed as " ++ (show parsedProg)) + --putStrLn ("Parsed as " ++ (show parsedProg)) catch (doEnviroment parsedProg) runtimeError doEnviroment parsedProg = do finalEnv <- evalExpSeq parsedProg initEnv - putStrLn ("Finished with Enviroment") + --putStrLn ("Finished with Enviroment") + return (); --enviroment variables diff --git a/Julio.o b/Julio.o index 4c46c97f79d9eecb828a05fce8d4c90b2fd697c2..4a9cdc0b7c12e44f773264d48decf641565d7c7d 100644 Binary files a/Julio.o and b/Julio.o differ diff --git a/Tokens.hs b/Tokens.hs index b6f7beab50ebd96f73836903a2a0832efe4780e0..a926e764581362e145abf0a03c0cc2ad4389c115 100644 --- a/Tokens.hs +++ b/Tokens.hs @@ -160,7 +160,7 @@ alexGetByte (AlexInput {alexStr=cs,alexBytePos=n}) = -- Token positions -- `Posn' records the location of a token in the input text. It has three --- fields: the address (number of characters preceding the token), line number +-- fields: the address (number of chacaters preceding the token), line number -- and column of a token within the file. `start_pos' gives the position of the -- start of the file and `eof_pos' a standard encoding for the end of file. -- `move_pos' calculates the new position after traversing a given character, @@ -18545,10 +18545,9 @@ alex_scan_tkn user__ orig_input len input__ s last_acc = let base = alexIndexInt32OffAddr alex_base s offset = PLUS(base,ord_c) + check = alexIndexInt16OffAddr alex_check offset - new_s = if GTE(offset,ILIT(0)) - && let check = alexIndexInt16OffAddr alex_check offset - in EQ(check,ord_c) + new_s = if GTE(offset,ILIT(0)) && EQ(check,ord_c) then alexIndexInt16OffAddr alex_table offset else alexIndexInt16OffAddr alex_deflt s in diff --git a/pr1.tsl b/pr1.tsl new file mode 100644 index 0000000000000000000000000000000000000000..cfa059eac9fa77cb09df5a5d0ecfea64b6836a47 --- /dev/null +++ b/pr1.tsl @@ -0,0 +1,12 @@ +t1 << tile1; +t2 << tile2; +t3 = joinH t1 t2; +t4 = joinH t2 t1; +t5 = t3; +t6 = t4; +repeat 31 {t5 = joinH t5 t3;}; +repeat 31 {t6 = joinH t6 t4;}; +t7 = joinV t5 t6; +t8 = t7; +repeat 31 {t8 = joinV t7 t8;}; +print t8; \ No newline at end of file diff --git a/tile1.tl b/tile1.tl index b0fcc5b7fa80ae88855cc1a35690b5b1e6a228f8..c227083464fb9af8955c90d2924774ee50abb547 100644 --- a/tile1.tl +++ b/tile1.tl @@ -1,9 +1 @@ -000 -010 -000 -000 -000 -000 -000 -000 -000 \ No newline at end of file +0 \ No newline at end of file diff --git a/tile2.tl b/tile2.tl index 40cc308ddffd31eef637bd277473c70c16e37d13..56a6051ca2b02b04ef92d5150c9ef600403cb1de 100644 --- a/tile2.tl +++ b/tile2.tl @@ -1,3 +1 @@ -11 -11 -11 \ No newline at end of file +1 \ No newline at end of file