Traversers

traverse a given AST in a depth-first-search pattern and orchestrate the execution of processors

Execution Steps:

  1. push a new empty map on the local context stack
  2. search the feature collection for matching processors for the current processing context by evaluating their execution conditions
  3. for all selected processors: run the pre-processing step
  4. 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
  5. for all selected processors: run the post-processing step and collect newly extracted concepts
  6. pop the current local context map
  7. apply metadata assignment rules to all newly extracted concepts
  8. 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