Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module exports functions for resolving the syntactic ambiguities in a parsed module. For example, an Oberon
expression foo(bar)
may be a call to function foo
with a parameter bar
, or it may be type guard on variable
foo
casting it to type bar
.
- data Error
- type Predefined = Map Ident (Validation (NonEmpty Error) (DeclarationRHS Identity))
- predefined :: Predefined
- predefined2 :: Predefined
- resolveModule :: Predefined -> Map Ident (Validation (NonEmpty Error) (Module Identity)) -> Module Ambiguous -> Validation (NonEmpty Error) (Module Identity)
- resolveModules :: Predefined -> Map Ident (Module Ambiguous) -> Validation (NonEmpty (Ident, NonEmpty Error)) (Map Ident (Module Identity))
Documentation
type Predefined = Map Ident (Validation (NonEmpty Error) (DeclarationRHS Identity)) Source #
A set of Predefined
declarations.
predefined :: Predefined Source #
The set of Predefined
types and procedures defined in the Oberon Language Report.
predefined2 :: Predefined Source #
The set of Predefined
types and procedures defined in the Oberon-2 Language Report.
resolveModule :: Predefined -> Map Ident (Validation (NonEmpty Error) (Module Identity)) -> Module Ambiguous -> Validation (NonEmpty Error) (Module Identity) Source #
Eliminate the ambiguites in the parsed syntax tree of a single module. The first argument is a set of Predefined
declarations, such as predefined
or predefined2
. The second is a mapping of imported module names to their
already resolved syntax trees.
resolveModules :: Predefined -> Map Ident (Module Ambiguous) -> Validation (NonEmpty (Ident, NonEmpty Error)) (Map Ident (Module Identity)) Source #
Eliminate the ambiguites in the given map of module names to their parsed syntax trees. The first argument is a set
of Predefined
declarations, such as predefined
or predefined2
.