Safe Haskell | None |
---|---|
Language | Haskell2010 |
Agda.Syntax.Translation.ConcreteToAbstract
Description
Translation from Agda.Syntax.Concrete to Agda.Syntax.Abstract. Involves scope analysis, figuring out infix operator precedences and tidying up definitions.
Synopsis
- class ToAbstract c where
- type AbsOfCon c
- toAbstract :: c -> ScopeM (AbsOfCon c)
- localToAbstract :: ToAbstract c => c -> (AbsOfCon c -> ScopeM b) -> ScopeM b
- concreteToAbstract_ :: ToAbstract c => c -> ScopeM (AbsOfCon c)
- concreteToAbstract :: ToAbstract c => ScopeInfo -> c -> ScopeM (AbsOfCon c)
- data TopLevel a = TopLevel {}
- data TopLevelInfo = TopLevelInfo {}
- topLevelModuleName :: TopLevelInfo -> ModuleName
- importPrimitives :: ScopeM [Declaration]
- checkAttributes :: Attributes -> ScopeM ()
Documentation
class ToAbstract c where Source #
Things that can be translated to abstract syntax are instances of this class.
Methods
toAbstract :: c -> ScopeM (AbsOfCon c) Source #
Instances
localToAbstract :: ToAbstract c => c -> (AbsOfCon c -> ScopeM b) -> ScopeM b Source #
This operation does not affect the scope, i.e. the original scope is restored upon completion.
concreteToAbstract_ :: ToAbstract c => c -> ScopeM (AbsOfCon c) Source #
concreteToAbstract :: ToAbstract c => ScopeInfo -> c -> ScopeM (AbsOfCon c) Source #
Temporary data type to scope check a file.
Constructors
TopLevel | |
Fields
|
Instances
ToAbstract (TopLevel [Declaration]) Source # | Top-level declarations are always
| ||||
Defined in Agda.Syntax.Translation.ConcreteToAbstract Associated Types
Methods toAbstract :: TopLevel [Declaration] -> ScopeM (AbsOfCon (TopLevel [Declaration])) Source # | |||||
type AbsOfCon (TopLevel [Declaration]) Source # | |||||
Defined in Agda.Syntax.Translation.ConcreteToAbstract |
data TopLevelInfo Source #
Constructors
TopLevelInfo | |
Fields
|
topLevelModuleName :: TopLevelInfo -> ModuleName Source #
The top-level module name.
importPrimitives :: ScopeM [Declaration] Source #
Declaration open import Agda.Primitive using (Set)
when optImportSorts
.
Prop
is added when optProp
, and SSet
when optTwoLevel
.
checkAttributes :: Attributes -> ScopeM () Source #
Raises an error if the list of attributes contains an unsupported attribute.