org.eclipse.php.astview - AST View
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.
- for Eclipse 3.4 org.eclipse.php.astview plugin (includes source code) (copy to 'dropins' directory)
- Open the AST view
- from the view menu: Window > Show View > Other..., PHP > AST View
- via shortcut: Alt+Shift+Q, A
- Open a PHP file in the editor
- 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
- Enable 'Link with editor' () to
automatically track the active editor and the selection in the active
- Double click on AST nodes to get the corresponding element revealed in the editor.
- Double click again to see the 'extended range' of a node, that means the range including all comments associated with it (comment mapper heuristic).
- When the AST's underlying document has been changed use
'Refresh' () to update the AST.
AST View Elements
The AST view shows the following nodes:
- AST nodes are shown in gray color and with source range
information. Children of AST nodes are the node properties.
- 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)
- bindings are shown in blue. Only selected bindings are shown
- (Not Implemented) You can toggle between the AST Level 2 and AST level 3 in the view menu (triangle). AST level 3 is the extended and modified AST that includes the new 5.0 language constructs. Note that the AST level 3 is only available in 3.1 and later builds
- You can choose to show or hide bindings in the view menu
- You can choose the method to generate an AST in 'Advance Options' in the view menu
- (Not implemented) You can choose 'Add to Comparison Tray' in the context menu of a binding. This moves the binding to a special area in the view. When you select another binding in the tree, the comparison tray shows various relationships between the selection and the chosen binding
Comments and Requests
Source is included in the plugin archive
- Comments to nirc[at]zend.com
Thanks and credits go to
Initial implementation from Martin_Aeschlimann[at]ch.ibm.com.
Also available from http://www.eclipse.org/jdt/ui/astview/index.php