language-oberon-0.3: Parser, pretty-printer, and more for the Oberon programming language
Safe HaskellNone
LanguageHaskell2010

Language.Oberon

Description

The programming languages Oberon and Oberon-2

Synopsis

Documentation

parseModule :: LanguageVersion -> Text -> ParseResults Text [NodeWrap (Module Language Language NodeWrap NodeWrap)] Source #

Parse the given text of a single module, without resolving the syntactic ambiguities.

parseAndResolveModule :: Options -> FilePath -> Text -> IO (Validation (Either (NonEmpty (Error Language)) (NonEmpty (Error Language))) (Placed (Module Language Language Placed Placed))) Source #

Given a directory path for module imports, parse the given module text and all the module files it imports, then use all the information to resolve the syntactic ambiguities.

parseAndResolveModuleFile :: Options -> FilePath -> IO (Validation (Either (NonEmpty (Error Language)) (NonEmpty (Error Language))) (Placed (Module Language Language Placed Placed))) Source #

Parse the module file at the given path, assuming all its imports are in the same directory.

data Options Source #

choice of modes of operation

Constructors

Options 

Fields

type NodeWrap = Compose ((,) (Int, Int)) (Compose Ambiguous ((,) ParsedLexemes)) Source #

The node wrapper in an ambiguous, freshly parsed AST, only with Position replaced with an offset from the beginning of the source.

type Placed = (,) (Int, ParsedLexemes, Int) Source #

The node wrapper in a fully resolved AST