Traversers
→ traverse a given AST in a depth-first-search pattern and orchestrate the execution of processors
Execution Steps:
- push a new empty map on the local context stack
- search the feature collection for matching processors for the current processing context by evaluating their execution conditions
- for all selected processors: run the pre-processing step
- recursively start the traversal process for all AST child nodes of the current node and retrieve any extracted language concepts in the form of a concept map
- for all selected processors: run the post-processing step and collect newly extracted concepts
- pop the current local context map
- apply metadata assignment rules to all newly extracted concepts
- return the union of all extracted child concepts and all newly extracted concepts on this AST level
Implementation
- visitor pattern for all scanned AST node types, which may either be self-implemented or provided by native APIs