/plugins/PHPParser/tags/PHPParser-1.3.0/docs/PHPParser.html
# · HTML · 302 lines · 283 code · 19 blank · 0 comment · 0 complexity · e23f0806c3e653d9af9be4b23ccb7cc1 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="Content-Type"
- content="text/html; charset=iso-8859-1">
- <meta name="Author" content="Matthieu Casanova">
- <title>PHPParser Plugin</title>
- </head>
- <body>
- <table border="0" cellspacing="0" width="100%" bgcolor="#ccccff">
- <tr>
- <td valign="top" style="font-weight:bold;font-size:x-large">PHP Parser</td>
- <td align="right" valign="top" style="font-size:small">
- <span style="font-weight:bold">Version 1.3.0 (Sep 07, 2010)</span><br>
- Matthieu Casanova <chocolat.mou@gmail.com>
- </td>
- </tr>
- </table>
- <h2>Introduction</h2>
- <p>In the beginning of 2003 I found the <b>phpeclipse</b> project, a plugin to do php in <b>Eclipse</b>.
- I worked on it, and finaly wrote an alternative php parser for the project.
- The matter is that I don't like SWT very much so when I discovered discovered jEdit
- I loved it. So I decided to write a plugin using my php parser.
- It uses ErrorList plugin to show the errors and Sidekick plugin to manage parser.
- </p>
- <h2>Usage</h2>
- <h3>Parsing</h3>
- <p>
- The parser is now launched by Sidekick plugin. You can ask to reparse the file with the "parse buffer" action of
- Sidekick.
- You can choose to enable parse on keystroke within Sidekick, it should be slower, but with good computer there
- will be
- no problem.
- It supports php5 if you activate it in the options panel.
- </p>
- <h3>Project management</h3>
- <p>
- The project management is a feature that will allow you to describe a project. A project is a group of files
- (under a
- root folder). It supports VFS so you can
- have a root on a ftp for example. To manage project please open the dockable view.
- When you create a project you'll have to choose a root folder. After that, click on the "reparse" button. It
- will
- parse all php files in your project
- and keep track of them in memory (you can show the parsing progress in the jEdit's IO threads). Of course, each
- time
- you'll open a file in your project and
- work on it, this file will be updated in the project memory. But only files under your root will be added.
- This feature will be useful for code completion (there is a little but I hope I'll add a lot more after), and
- for code
- browsing
- </p>
- <h3>Code Browsing</h3>
- The parser will provide a Sidekick structure view of you file, to show it, use the "Structure browser" of Sidekick
- plugin.
- There are also 3 actions to browse php code : Find class, Find method and Find in file. Those actions will work if you
- have a project up to date.
- It will display a small dialog working like OpenIt plugin (I took a lot of ideas from this plugin), and you'll be able
- to do incremental search on classes, methods,
- displaying a little list of matching class or methods (depends on action you choosed). When you select one, the file
- will be opened at the good position.
- <h3>Code completion</h3>
- <p>
- I added some code completion, but it doesn't work very well for the moment. To enable it, please use the action
- "Show
- completion popup" from Sidekick.
- There are completion after the following situation :
- <ul>
- <li><b>extends</b></li>
- <li><b>new </b></li>
- <li><b>$this-></b></li>
- <li><b>AnyClass::</b></li>
- </ul>
- The completion will work better with a project too, for example after <b>new</b> and <b>extends</b>, I will display
- all classes in the project.
- After <b>$this-></b> I'll display methods and fields of the class and superclasses.
- After <b>AnyClass::</b> I'll display methods of the class and superclasses ...
- </p>
- <h3>Code analysis</h3>
- <p>
- There are some code analysis but you should be very careful because it's far from being perfect. If a variable
- is
- given to a
- method and is assigned by reference, the parser will not know that and report it as variable used but not
- assigned ...
- </p>
- <h2>History</h2>
- <ul>
- <li>1.3.0</li>
- <ul>
- <li><ul>Dropped specific php 4 support.</ul></li>
- <li>Features
- <ul>
- <li>conditional expression (ternary/elvis) inspection :
- a warning is created if true and false value are the same
- (very limited check).</li>
- <li>Added a warning when having $$ in code. While it may be wanted, it is usually a bug.</li>
- <li>Updated to use JavaCC 5.0.</li>
- </ul>
- </li>
- <li>Bugs fixed</li>
- <ul>
- <li>Fixed parsing of use($x,...) in closure declaration</li>
- <li>fixed parsing of variables in String (#2935111)</li>
- <li>exception during parsing of $ in strings that happens sometimes (#2897416)</li>
- <li>added short ternary operator ($a = $b ?:$c) (#2461597)</li>
- <li>several parsing bug in class declaration</li>
- <li>several parsing bug in double quoted strings (#2944017)</li>
- <li>fixes in heredoc (#2855209)</li>
- <li>better type detection for cast expressions</li>
- </ul>
- </ul>
- <li>1.2.7</li>
- <ul>
- <li>Bugs fixed</li>
- <ul>
- <li>Added basic namespace keyword support</li>
- <li>Allow $this->return syntax</li>
- <li>fixed an exception when parsing interface declaration (#1910321)</li>
- <li>the variables used in <?=$tutu?> were ignored by code analysis</li>
- <li>Fixed chained method call syntax (#2854175)</li>
- <li>The parser now accept methods with name = null (#2849929)</li>
- <li>closure parsing support (#2461603)</li>
- </ul>
- </ul>
- <li>1.2.6</li>
- <ul>
- <li>Bugs fixed</li>
- <ul>
- <li>public static method() declaration in interface (#1910321)</li>
- <li>Wrong use check of variables in "instanceof" expression (#1739752)</li>
- <li>"default" keyword confuses the parser (#1891144)</li>
- <li>it is now allowed to extends Object (#2318629)</li>
- </ul>
- </ul>
- <li>1.2.5</li>
- <ul>
- <li>Bugs fixed</li>
- <ul>
- <li>loading project where several classes have the same name</li>
- <li>Wrong use check of variables in "instanceof" expression (#1739752)</li>
- <li>"default" keyword confuses the parser (#1891144)</li>
- </ul>
- </ul>
- <li>1.2.4</li>
- <ul>
- <li>Bugs fixed</li>
- <ul>
- <li>clone keyword support</li>
- <li>1535949 fixed : default method call type was String, it is now Unknown</li>
- <li>syntax class::constant</li>
- </ul>
- <li>Changes</li>
- <ul>
- <li>Quick search sorted by name length (this is better now :)</li>
- </ul>
- </ul>
- </ul>
- <ul>
- <li>1.2.3</li>
- <ul>
- <li>Bugs fixed</li>
- <ul>
- <li>better modifier parsing</li>
- <li>a bug fixed in code analysis of try statements</li>
- <li>some bugs fixed in dockable panel</li>
- <li>1458668 fixed (< while ($a) : ?>blabla<?endwhile;?></li>
- <li>1432935 fixed</li>
- <li>1489533 fixed (const keyword)</li>
- <li>Syntax like TR_TreeAction::getInstance('containers')->isRoot(5); fixed</li>
- <li>several fields declared in the same likes is now allowed in php 5</li>
- </ul>
- </ul>
- </ul>
- <ul>
- <li>1.2.2</li>
- <ul>
- <li>Missing '?>' is now reported as warning and can be deactivated in the options</li>
- <li>Better code completion handling for interfaces</li>
- <li><?xml token is now ignored (I think if you put such token, your php.ini config will only accept
- <?php for
- starting php scripts
- </li>
- <li>Bugs fixed</li>
- <ul>
- <li>php 5 : better handling of type of the method parameters (array and several other keywords
- are now allowed)
- </li>
- <li>Class access are allowed after method calls ( $a->test()->tutu() )</li>
- <li>Interfaces can now extends several interfaces</li>
- <li>1378327 fixed</li>
- <li>981809 fixed</li>
- <li>1066608 fixed</li>
- <li>1368690 fixed : syntax like if ($a && $b = 3)</li>
- <li>Bug fixed when you had an interface in a project preventing the project to load</li>
- </ul>
- </ul>
- </ul>
- <ul>
- <li>1.2.1</li>
- <ul>
- <li>Option for conditional expression warning</li>
- <li>Bugs fixed</li>
- <ul>
- <li>Release 1.2.0 was missing some icons</li>
- <li>NPE fixed in smart code completion</li>
- <li>Some code analysis were executed twice</li>
- <li>NPE fixed in ArrayInitializer code analysis <i>array('foo',)</i> syntax</li>
- </ul>
- </ul>
- </ul>
- <ul>
- <li>1.2.0<br>
- <ul>
- <li>Bugs fixed
- <ul>
- <li>1203867 bugfix with code analysis</li>
- <li>1098323 A <b>?></b> in an heredoc syntax will not crash the parser anymore
- </li>
- <li>1098321 The keyword <b>xor</b> is now supported</li>
- <li>Fix warning in code analysis on global requiring super globals variables
- </li>
- <li>a memory leak, the PHPErrorSource was instantiated on each parse and never
- released
- </li>
- <li>Keywords that can be method names should now be managed.</li>
- </ul>
- </li>
- <li>Features
- <ul>
- <li>Sidekick completion</li>
- <li>Project handling</li>
- <li>Quick access to find class and methods</li>
- <li>new warning for syntax case '' ; (semicolon instead of colon)</li>
- <li>Parsing of double quoted strings</li>
- <li>php 5 support</li>
- </ul>
- </li>
- <li>Others
- <ul>
- <li>Some cleanup in the parser</li>
- </ul>
- </ul>
- </li>
- <li>1.1.0<br>
- <ul>
- <li>The files edited with jEdit php mode are parsed, no more option pane to choose them</li>
- <li>Sidekick structure tree</li>
- <li>Parse on keystroke with sidekick</li>
- <li>Code analysis:
- <ul>
- <li>Unused method parameters reported</li>
- <li>Variable used before being assigned are reported</li>
- </ul>
- </li>
- </ul>
- </li>
- <li>1.0.3<br>
- <ul>
- <li>Heredoc support</li>
- <li>My contact adress changed</li>
- </ul>
- </li>
- <li>1.0.2<br>
- <ul>
- <li>When you deactivate the parser in the options, it will really be deactivated</li>
- <li>lot of bugfixes in the parsing</li>
- </ul>
- </li>
- </ul>
- <h2>known issue</h2>
- <ul>
- <li>when you deactivate the parser the errors aren't removed from ErrorList (but is it really a bug or a feature
- ?)
- </li>
- <li>When you have several classes or methods with the same name in the project only one is kept in the project
- memory
- </li>
- </ul>
- <h2>Feedback</h2>
- <p>Please report bugs to the bug jEdit's plugin tracker on sourceforge.net</p>
- </body>
- </html>