-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up parser code and a lot of other stuff
- Loading branch information
1 parent
61afa2a
commit 98de27a
Showing
23 changed files
with
501 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,46 @@ | ||
{- Configuration -- describing the overall behavior of the compiler | ||
Copyright (C) 2013 Benjamin Barenblat <bbaren@mit.edu> | ||
This file is a part of decafc. | ||
decafc is free software: you can redistribute it and/or modify it under the | ||
terms of the MIT (X11) License as described in the LICENSE file. | ||
decafc is distributed in the hope that it will be useful, but WITHOUT ANY | ||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
PARTICULAR PURPOSE. See the X11 license for more details. -} | ||
module Configuration ( Configuration | ||
, input, target, debug, opt, outputFileName | ||
, defaultConfiguration | ||
, CompilerStage(..) | ||
, OptimizationSpecification(..) | ||
, OptimizationName(..) | ||
) where | ||
|
||
-- Copyright (C) 2018-2024 Jun Zhang <zhangjunphy[at]gmail[dot]com> | ||
-- | ||
-- This file is a part of decafc. | ||
-- | ||
-- decafc is free software: you can redistribute it and/or modify it under the | ||
-- terms of the MIT (X11) License as described in the LICENSE file. | ||
-- | ||
-- decafc is distributed in the hope that it will be useful, but WITHOUT ANY | ||
-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
-- FOR A PARTICULAR PURPOSE. See the X11 license for more details. | ||
module Configuration | ||
( Configuration, | ||
input, | ||
target, | ||
debug, | ||
opt, | ||
outputFileName, | ||
defaultConfiguration, | ||
CompilerStage (..), | ||
OptimizationSpecification (..), | ||
OptimizationName (..), | ||
) | ||
where | ||
|
||
import Configuration.Types | ||
( CompilerStage (..), | ||
Configuration (..), | ||
OptimizationName (..), | ||
OptimizationSpecification (..), | ||
debug, | ||
defaultConfiguration, | ||
explicitTarget, | ||
input, | ||
opt, | ||
outputFileName, | ||
) | ||
import Data.Maybe (fromMaybe) | ||
|
||
import Configuration.Types ( Configuration(..) | ||
, input, debug, opt, outputFileName | ||
, explicitTarget | ||
, defaultConfiguration | ||
, CompilerStage(..) | ||
, OptimizationSpecification(..) | ||
, OptimizationName(..) | ||
) | ||
|
||
|
||
--------------------------- The configuration type ---------------------------- | ||
{- 'input', 'debug', 'opt', and 'outputFileName' are fine accessor functions. | ||
'target', on the other hand, is a bit special. -} | ||
|
||
target :: Configuration -> CompilerStage | ||
target conf = fromMaybe defaultTarget $ explicitTarget conf | ||
where defaultTarget = Parse -- this will change as the course proceeds | ||
where | ||
defaultTarget = Parse -- this will change as the course proceeds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.