Processors
→ extracts language concept from a given processing context
- orchestrated by traversers
Consists of:
- an execution condition, determining in which concrete context the processor should be executed
- a
preChildrenProcessing
function that can be used to execute logic before the concept extraction for any AST child nodes is attempted- usually used to set up local contexts
- a
postChildrenProcessing
function that constructs new language concept objects and returns them as a concept map- receives processing context and a concept map containing all previously extracted child concepts as input
- when composing more complex concept object out of child concepts, then these child concepts should be removed from their concept map
Implementation
classDiagram
class Processor {
<<abstract>>
+ExecutionCodition executionCondition*
+preChildrenProcessing(ProcessingContext context) void
+postChildrenProcessing(ProcessingContext context, ConceptMap childConcepts) ConceptMap
}
ConcreteProcessor
Processor <|-- ConcreteProcessor
- empty default implementations should be provided for
preChildrenProcessing
andpostChildrenProcessing