TTG hsSyn for Batch and Interactive Parsing
Simon Peyton Jones
simonpj at microsoft.com
Tue May 8 08:54:44 UTC 2018
At first blush, “running the parser in two modes” and “changing the Pass” type don’t match up in my mind. One seems quite local (how to run the parser). The other seems more pervasive.
Can you say more about your proposed design, perhaps even on a wiki page?
From: ghc-devs <ghc-devs-bounces at haskell.org> On Behalf Of Alan & Kim Zimmerman
Sent: 07 May 2018 16:17
To: ghc-devs <ghc-devs at haskell.org>
Subject: TTG hsSyn for Batch and Interactive Parsing
I want to be able to run the GHC parser in one of two modes, batch which functions as now, and interactive which will (eventually) be incremental.
In addition, the hsSyn AST for each will have different TTG annotations, so that it can better support IDE usage.
I think this can be done by changing the types in HsExtension to introduce a 'Process' type as follows
data Pass = Parsed Process | Renamed | Typechecked
data Process = Batch | Interactive
deriving (Show, Data)
We then rename the pass synonyms so that batch is the default
type GhcPs = GhcPass ('Parsed 'Batch)
type GhcPsI = GhcPass ('Parsed 'Interactive)
I have attached a simple proof of concept file, which emulates parsing and renaming.
Is this an appropriate approach to take?
 Trees That Grow https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs