Jump to: navigation, search

PDT/ASTView

< PDT

org.eclipse.php.astview - AST View

Purpose

A view to visualize the AST (abstract syntax tree) of a PHP file open in the editor. Navigate from text selection to AST nodes and from nodes to selections, also to show binding information provided.

Usage

  1. Open the AST view
    1. from the view menu: Window > Show View > Other..., PHP > AST View
    2. via shortcut: Alt+Shift+Q, A
  2. Open a PHP file in the editor
  3. Click on 'Show AST of active editor' to populate the view: The view shows the AST of the file opened in the editor and will also reveal the element corresponding to the current text selection
  4. Enable 'Link with editor' to automatically track the active editor and the selection in the active editor.
  5. Double click on AST nodes to get the corresponding element revealed in the editor.
  6. Double click again to see the 'extended range' of a node, that means the range including all comments associated with it (comment mapper heuristic).
  7. When the AST's underlying document has been changed use 'Refresh' "refresh.gif"   to update the AST.

AST View Elements

The AST view shows the following nodes:

ASTView

  1. AST nodes are shown in gray color and with source range information. Children of AST nodes are the node properties.
  2. node properties have names that are all all capitalized. Node properties represent lists of child nodes, a child node or a primitive node attribute (String, int or boolean)
  3. bindings are shown in blue. Only selected bindings are shown