8.6.2. Lexcial concepts in parse tree elements
The lexical concepts relate to the parse tree in a straightforward way. We discuss the case of AutomaticEffectE, the lexical representation of do (module Perspectives.Parsing.Arc.AST).
8.6.2.1. current subject and current object
The newtype AutomaticEffectE has members subject and object. The former is a RoleIdentification; the latter a Maybe RoleIdentification (not every do has a current object in scope). The RoleIdentification that is subject is precisely the value of the member subject of ArcParserState as it was available to the parser handling the body of the do. In other words, it represents the current subject in the scope of the do.
Mutatis mutandis, the same holds for object.
8.6.2.2. Current context
The AutomaticEffectE is constructed with a member transition whose value is a StateTransitionE:
data StateTransitionE = Entry StateSpecification | Exit StateSpecification A StateSpecification is: data StateSpecification = ContextState ContextType (Maybe SegmentedPath) | SubjectState RoleIdentification (Maybe SegmentedPath) | ObjectState RoleIdentification (Maybe SegmentedPath)
Let’s dissect the three data constructors. For a ContextState, the ContextType represents the current context from lexical analysis.
For a SubjectState and ObjectState, the RoleIdentification contains (as we’ve seen above) a part ContextType, that represents the current context.
How do we know? The parsers keep members onEntry and onExit in ArcParserState. These end up in AutomaticEffectE. They are built from currentcontext
, subject and object in ArcParserState: meaning they are constructed from the representation of the corresponding lexical concepts for the body of the do.
8.6.2.3. Other lexical representations
We’ve discussed AutomaticEffectE above in detail. It happens that the following lexical representations exhibit the same pattern of a subject, object and transition, or, in some cases, a state member:
-
RoleVerbE
-
PropertyVerbE
-
SelfOnly
-
ActionE
-
NotificationE
-
AutomaticEffectE
The first three represent various qualifications of a perspective. The latter three have to do with state transition, assignments and notification.