diff --git a/Main.hs b/Main.hs index 7a8719a..122a527 100644 --- a/Main.hs +++ b/Main.hs @@ -36,7 +36,7 @@ import ParseOccam import Pass import PreprocessOccam import PrettyShow -import RainParse +import ParseRain import RainPasses import SimplifyExprs import SimplifyProcs diff --git a/Makefile b/Makefile index 9f8a7e8..07da1f1 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,9 @@ targets = tock tocktest all: $(targets) -sources = $(wildcard *.hs) $(patsubst %.x,%.hs,$(wildcard *.x)) +sources = $(wildcard *.hs frontends/*.hs backends/*.hs transformations/*.hs common/*.hs) $(patsubst %.x,%.hs,$(wildcard frontends/*.x)) + +builtfiles = $(patsubst %.hs,%.hi,$(sources)) $(patsubst %.hs,%.o,$(sources)) $(patsubst %.x,%.hs,$(wildcard frontends/*.x)) %.hs: %.x alex $< @@ -12,6 +14,7 @@ ghc_opts = \ -fglasgow-exts \ -fallow-undecidable-instances \ -fwarn-unused-binds \ + -icommon -itransformations -ifrontends -ibackends \ $(profile_opts) tock: $(sources) @@ -74,7 +77,7 @@ haddock: @mv doc/index.html-2 doc/index.html clean: - rm -f $(targets) *.o *.hi + rm -f $(targets) $(builtfiles) # Don't delete intermediate files. .SECONDARY: diff --git a/TestMain.hs b/TestMain.hs index b0980f9..460f95d 100644 --- a/TestMain.hs +++ b/TestMain.hs @@ -27,8 +27,8 @@ with this program. If not, see . -- * "UsageCheckTest" module TestMain () where -import qualified RainParseTest (tests) -import qualified RainPassTest (tests) +import qualified ParseRainTest (tests) +import qualified RainPassesTest (tests) import qualified UsageCheckTest (tests) import qualified PassTest (tests) import Test.HUnit @@ -37,8 +37,8 @@ main :: IO () main = do runTestTT $ TestList [ PassTest.tests - ,RainParseTest.tests - ,RainPassTest.tests + ,ParseRainTest.tests + ,RainPassesTest.tests ,UsageCheckTest.tests ] return () diff --git a/AnalyseAsm.hs b/backends/AnalyseAsm.hs similarity index 100% rename from AnalyseAsm.hs rename to backends/AnalyseAsm.hs diff --git a/GenerateC.hs b/backends/GenerateC.hs similarity index 100% rename from GenerateC.hs rename to backends/GenerateC.hs diff --git a/GenerateCPPCSP.hs b/backends/GenerateCPPCSP.hs similarity index 100% rename from GenerateCPPCSP.hs rename to backends/GenerateCPPCSP.hs diff --git a/TLP.hs b/backends/TLP.hs similarity index 100% rename from TLP.hs rename to backends/TLP.hs diff --git a/AST.hs b/common/AST.hs similarity index 100% rename from AST.hs rename to common/AST.hs diff --git a/CompState.hs b/common/CompState.hs similarity index 100% rename from CompState.hs rename to common/CompState.hs diff --git a/Errors.hs b/common/Errors.hs similarity index 100% rename from Errors.hs rename to common/Errors.hs diff --git a/EvalConstants.hs b/common/EvalConstants.hs similarity index 100% rename from EvalConstants.hs rename to common/EvalConstants.hs diff --git a/EvalLiterals.hs b/common/EvalLiterals.hs similarity index 100% rename from EvalLiterals.hs rename to common/EvalLiterals.hs diff --git a/Intrinsics.hs b/common/Intrinsics.hs similarity index 100% rename from Intrinsics.hs rename to common/Intrinsics.hs diff --git a/Metadata.hs b/common/Metadata.hs similarity index 100% rename from Metadata.hs rename to common/Metadata.hs diff --git a/Pass.hs b/common/Pass.hs similarity index 100% rename from Pass.hs rename to common/Pass.hs diff --git a/Pattern.hs b/common/Pattern.hs similarity index 100% rename from Pattern.hs rename to common/Pattern.hs diff --git a/PrettyShow.hs b/common/PrettyShow.hs similarity index 100% rename from PrettyShow.hs rename to common/PrettyShow.hs diff --git a/TestUtil.hs b/common/TestUtil.hs similarity index 100% rename from TestUtil.hs rename to common/TestUtil.hs diff --git a/TreeUtil.hs b/common/TreeUtil.hs similarity index 100% rename from TreeUtil.hs rename to common/TreeUtil.hs diff --git a/Types.hs b/common/Types.hs similarity index 100% rename from Types.hs rename to common/Types.hs diff --git a/Utils.hs b/common/Utils.hs similarity index 100% rename from Utils.hs rename to common/Utils.hs diff --git a/LexOccam.x b/frontends/LexOccam.x similarity index 100% rename from LexOccam.x rename to frontends/LexOccam.x diff --git a/LexRain.x b/frontends/LexRain.x similarity index 100% rename from LexRain.x rename to frontends/LexRain.x diff --git a/ParseOccam.hs b/frontends/ParseOccam.hs similarity index 100% rename from ParseOccam.hs rename to frontends/ParseOccam.hs diff --git a/RainParse.hs b/frontends/ParseRain.hs similarity index 99% rename from RainParse.hs rename to frontends/ParseRain.hs index c92a116..7c830cf 100644 --- a/RainParse.hs +++ b/frontends/ParseRain.hs @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . -} -module RainParse where +module ParseRain where import qualified Text.ParserCombinators.Parsec.Token as P import qualified LexRain as L diff --git a/RainParseTest.hs b/frontends/ParseRainTest.hs similarity index 99% rename from RainParseTest.hs rename to frontends/ParseRainTest.hs index 8c98180..a8eefcd 100644 --- a/RainParseTest.hs +++ b/frontends/ParseRainTest.hs @@ -16,9 +16,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . -} -module RainParseTest (tests) where +module ParseRainTest (tests) where -import qualified RainParse as RP +import qualified ParseRain as RP import qualified AST as A import qualified LexRain as L import Text.ParserCombinators.Parsec (runParser,eof) diff --git a/PreprocessOccam.hs b/frontends/PreprocessOccam.hs similarity index 100% rename from PreprocessOccam.hs rename to frontends/PreprocessOccam.hs diff --git a/RainPasses.hs b/frontends/RainPasses.hs similarity index 100% rename from RainPasses.hs rename to frontends/RainPasses.hs diff --git a/RainPassTest.hs b/frontends/RainPassesTest.hs similarity index 99% rename from RainPassTest.hs rename to frontends/RainPassesTest.hs index c70c952..9574e20 100644 --- a/RainPassTest.hs +++ b/frontends/RainPassesTest.hs @@ -18,7 +18,7 @@ with this program. If not, see . -- #ignore-exports -module RainPassTest (tests) where +module RainPassesTest (tests) where import Test.HUnit hiding (State) import Control.Monad.State as CSM diff --git a/StructureOccam.hs b/frontends/StructureOccam.hs similarity index 100% rename from StructureOccam.hs rename to frontends/StructureOccam.hs diff --git a/PassTest.hs b/transformations/PassTest.hs similarity index 100% rename from PassTest.hs rename to transformations/PassTest.hs diff --git a/SimplifyExprs.hs b/transformations/SimplifyExprs.hs similarity index 100% rename from SimplifyExprs.hs rename to transformations/SimplifyExprs.hs diff --git a/SimplifyProcs.hs b/transformations/SimplifyProcs.hs similarity index 100% rename from SimplifyProcs.hs rename to transformations/SimplifyProcs.hs diff --git a/SimplifyTypes.hs b/transformations/SimplifyTypes.hs similarity index 100% rename from SimplifyTypes.hs rename to transformations/SimplifyTypes.hs diff --git a/Unnest.hs b/transformations/Unnest.hs similarity index 100% rename from Unnest.hs rename to transformations/Unnest.hs diff --git a/UsageCheck.hs b/transformations/UsageCheck.hs similarity index 100% rename from UsageCheck.hs rename to transformations/UsageCheck.hs diff --git a/UsageCheckTest.hs b/transformations/UsageCheckTest.hs similarity index 100% rename from UsageCheckTest.hs rename to transformations/UsageCheckTest.hs