Actipro SyntaxEditor .NET Languages Add-on
Compilation Unit
The .NET Languages Add-on uses SyntaxEditor's semantic parser service to construct an abstract syntax tree representing
the document being edited whenever changes are made to it.
The service executes the .NET Language Add-on's semantic parsing code in a separate worker thread
to avoid blocking the user interface during complex analysis of code.
An AST (abstract syntax tree) is a tree-like structure consisting of a hierarchy of AST nodes.
Each AST node represents a certain piece of the document such as a namespace or class declaration.
AST nodes can then be combined into a large tree, the AST, that give meaning to the entire code document.
ASTs are what all major IDE applications use to aid in providing IntelliPrompt-like features in their editors.
The document tokens returned by a lexical parser are parsed by a semantic parser.
The semantic parser constructs an AST based on the grammar rules for the language that
define what tokens can denote various non-terminal productions.
Once the parsing is complete the AST can easily obtain information such as what types/members are available in the code.
This information is used in populating member lists, quick info, etc. to provide full IntelliPrompt features.
The root AST node of a .NET language code document is a compilation unit.
The compilation unit provides easy access to the types defined in the compilation unit,
any syntax errors that were reported, and complete access to the AST node hierarchy.
The .NET Language Add-on defines over 100 types of AST nodes that fully represent a .NET language code document.
|