language-oberon-0.3.3: Parser, pretty-printer, and more for the Oberon programming language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Oberon.Reserializer

Description

This module exports functions for reserializing the parsed tree from the tokens stored with every node.

Synopsis

Documentation

adjustPositions :: (Foldable (g (Const (Sum Int))), Foldable (Fold Parsed (Sum Int)) g, Traversable PositionAdjustment g) => Parsed (g Parsed Parsed) -> Parsed (g Parsed Parsed) Source #

Re-calculates the position of every node in the parse tree from the tokens stored with it and its children.

reserialize :: Foldable Serialization g => Parsed (g Parsed Parsed) -> Text Source #

Serializes the tree back into the text it was parsed from.

sourceLength :: (Foldable (g (Const (Sum Int))), Foldable (Fold Parsed (Sum Int)) g) => Parsed (g Parsed Parsed) -> Int Source #

The length of the source code parsed into the argument node

data Serialization Source #

Transformation type used by reserialize