Implemented: Support for parseErr
Also keep a list of tokens in the parseErr node and use these for the presentation (maybe even get rid of the Presentation field). Furthermore, if we keep the error and its location in the node, this can be used in the presentation. Probably, we need some special construct in Xprez to mark the parse errors, since old markings must be removed before presenting the parse error node again.
Implemented: Automatic recognizers
The recognizer parsers for structural presentations can be constructed automatically. The recognizer basically parses child tokens in the order in which they appear in the presentation. We can do this automatically, by inspecting the child token list and determining the immediate children of the recognized constructor. Duplicates can be resolved and the children that are present are passed to a reuse call (missing children are reused).
Implemented: Popups for self and for children
At the moment, popup menus are defined for an entire presentation, including its child presentations. A more sophisticated mechanism allows for both inherited popup menu items, which are defined for the entire area of the presentation, as well as local popup items, which are defined only for the area of the presentation and not for the areas of child presentations. The local popup menu items have to be reset at each child presentation, but this can be done automatically when pres attribute functionality is generated (see below).
The implementation is simple, just change the list of popup items to a tuple of lists, and add a few primitives.
Implemented: Generation of
If we define the presentation as a local attribute for each constructor, rather than a synthesized attribute, we can generate default presentation functionality (
) in the synthesized attribute.
This means that instead of
loc.pres = loc (Node_Leaf @self @lhs.path) $ presentFocus @lhs.focusD @lhs.path $
< presentation for CNSTR>
loc.pres = <presentation for CNSTR>
and the automatically generated
lhs.pres = loc (Node_<CNSTR> @self @lhs.path) $ presentFocus @lhs.focusD @lhs.path $ @pres
Moreover, this makes it easy to add type-specific popup menus to the presentation (now done in the renderer), removing the current popup-menu hack and the imports of generated modules by the renderer.
Implemented: Use GADT to guarantee that a
Token constructor in
Presentation does not appear on
type Presentation = PresentationBase Pres_
type Layout = PresentationBase Lay_
data PresentationBase tp where
RowP :: [PresentationBase tp] -> PresentationBase tp
StringP :: String -> PresentationBase tp
TokenP :: String -> PresentationBase Pres_
Now it is guaranteed that something of type
will not have a
Idea: Use GADT to do static checks on presentation
We can perform static checks, e.g. that tokens appear only in parsing presentations, or that a structural/parsing is always preceded by a locator. However, the additional typing causes problems for generic functions on the data type (such as getChildrenP), which cannot be typed anymore.
A solution that uses a phantom type and smart constructors is the best alternative.
Implemented: Settings module
Settings such as renderer/arranger incrementality and marking of updated regions in the user interface were defined in CommonUtils
, requiring modifications to the generic system. Hence, SVN marked this file as dirty if settings differed from the version in the repository. Now, settings are defined in an editor specific
module, which declares a record
that is passed to the appropriate functions. The application name is also defined in
Settings for the arranger (currently only
) are not put in the
, since this would require the record to be passed as an inherited attribute in the arranger AG, causing additional run-time costs.