/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

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type"
  5. content="text/html; charset=iso-8859-1">
  6. <meta name="Author" content="Matthieu Casanova">
  7. <title>PHPParser Plugin</title>
  8. </head>
  9. <body>
  10. <table border="0" cellspacing="0" width="100%" bgcolor="#ccccff">
  11. <tr>
  12. <td valign="top" style="font-weight:bold;font-size:x-large">PHP Parser</td>
  13. <td align="right" valign="top" style="font-size:small">
  14. <span style="font-weight:bold">Version 1.3.0 (Sep 07, 2010)</span><br>
  15. Matthieu Casanova &lt;chocolat.mou@gmail.com&gt;&nbsp;
  16. </td>
  17. </tr>
  18. </table>
  19. <h2>Introduction</h2>
  20. <p>In the beginning of 2003 I found the <b>phpeclipse</b> project, a plugin to do php in <b>Eclipse</b>.
  21. I worked on it, and finaly wrote an alternative php parser for the project.
  22. The matter is that I don't like SWT very much so when I discovered discovered jEdit
  23. I loved it. So I decided to write a plugin using my php parser.
  24. It uses ErrorList plugin to show the errors and Sidekick plugin to manage parser.
  25. </p>
  26. <h2>Usage</h2>
  27. <h3>Parsing</h3>
  28. <p>
  29. The parser is now launched by Sidekick plugin. You can ask to reparse the file with the "parse buffer" action of
  30. Sidekick.
  31. You can choose to enable parse on keystroke within Sidekick, it should be slower, but with good computer there
  32. will be
  33. no problem.
  34. It supports php5 if you activate it in the options panel.
  35. </p>
  36. <h3>Project management</h3>
  37. <p>
  38. The project management is a feature that will allow you to describe a project. A project is a group of files
  39. (under a
  40. root folder). It supports VFS so you can
  41. have a root on a ftp for example. To manage project please open the dockable view.
  42. When you create a project you'll have to choose a root folder. After that, click on the "reparse" button. It
  43. will
  44. parse all php files in your project
  45. and keep track of them in memory (you can show the parsing progress in the jEdit's IO threads). Of course, each
  46. time
  47. you'll open a file in your project and
  48. work on it, this file will be updated in the project memory. But only files under your root will be added.
  49. This feature will be useful for code completion (there is a little but I hope I'll add a lot more after), and
  50. for code
  51. browsing
  52. </p>
  53. <h3>Code Browsing</h3>
  54. The parser will provide a Sidekick structure view of you file, to show it, use the "Structure browser" of Sidekick
  55. plugin.
  56. There are also 3 actions to browse php code : Find class, Find method and Find in file. Those actions will work if you
  57. have a project up to date.
  58. It will display a small dialog working like OpenIt plugin (I took a lot of ideas from this plugin), and you'll be able
  59. to do incremental search on classes, methods,
  60. displaying a little list of matching class or methods (depends on action you choosed). When you select one, the file
  61. will be opened at the good position.
  62. <h3>Code completion</h3>
  63. <p>
  64. I added some code completion, but it doesn't work very well for the moment. To enable it, please use the action
  65. "Show
  66. completion popup" from Sidekick.
  67. There are completion after the following situation :
  68. <ul>
  69. <li><b>extends</b></li>
  70. <li><b>new </b></li>
  71. <li><b>$this-></b></li>
  72. <li><b>AnyClass::</b></li>
  73. </ul>
  74. The completion will work better with a project too, for example after <b>new</b> and <b>extends</b>, I will display
  75. all classes in the project.
  76. After <b>$this-></b> I'll display methods and fields of the class and superclasses.
  77. After <b>AnyClass::</b> I'll display methods of the class and superclasses ...
  78. </p>
  79. <h3>Code analysis</h3>
  80. <p>
  81. There are some code analysis but you should be very careful because it's far from being perfect. If a variable
  82. is
  83. given to a
  84. method and is assigned by reference, the parser will not know that and report it as variable used but not
  85. assigned ...
  86. </p>
  87. <h2>History</h2>
  88. <ul>
  89. <li>1.3.0</li>
  90. <ul>
  91. <li><ul>Dropped specific php 4 support.</ul></li>
  92. <li>Features
  93. <ul>
  94. <li>conditional expression (ternary/elvis) inspection :
  95. a warning is created if true and false value are the same
  96. (very limited check).</li>
  97. <li>Added a warning when having $$ in code. While it may be wanted, it is usually a bug.</li>
  98. <li>Updated to use JavaCC 5.0.</li>
  99. </ul>
  100. </li>
  101. <li>Bugs fixed</li>
  102. <ul>
  103. <li>Fixed parsing of use($x,...) in closure declaration</li>
  104. <li>fixed parsing of variables in String (#2935111)</li>
  105. <li>exception during parsing of $ in strings that happens sometimes (#2897416)</li>
  106. <li>added short ternary operator ($a = $b ?:$c) (#2461597)</li>
  107. <li>several parsing bug in class declaration</li>
  108. <li>several parsing bug in double quoted strings (#2944017)</li>
  109. <li>fixes in heredoc (#2855209)</li>
  110. <li>better type detection for cast expressions</li>
  111. </ul>
  112. </ul>
  113. <li>1.2.7</li>
  114. <ul>
  115. <li>Bugs fixed</li>
  116. <ul>
  117. <li>Added basic namespace keyword support</li>
  118. <li>Allow $this->return syntax</li>
  119. <li>fixed an exception when parsing interface declaration (#1910321)</li>
  120. <li>the variables used in &lt;?=$tutu?&gt; were ignored by code analysis</li>
  121. <li>Fixed chained method call syntax (#2854175)</li>
  122. <li>The parser now accept methods with name = null (#2849929)</li>
  123. <li>closure parsing support (#2461603)</li>
  124. </ul>
  125. </ul>
  126. <li>1.2.6</li>
  127. <ul>
  128. <li>Bugs fixed</li>
  129. <ul>
  130. <li>public static method() declaration in interface (#1910321)</li>
  131. <li>Wrong use check of variables in "instanceof" expression (#1739752)</li>
  132. <li>"default" keyword confuses the parser (#1891144)</li>
  133. <li>it is now allowed to extends Object (#2318629)</li>
  134. </ul>
  135. </ul>
  136. <li>1.2.5</li>
  137. <ul>
  138. <li>Bugs fixed</li>
  139. <ul>
  140. <li>loading project where several classes have the same name</li>
  141. <li>Wrong use check of variables in "instanceof" expression (#1739752)</li>
  142. <li>"default" keyword confuses the parser (#1891144)</li>
  143. </ul>
  144. </ul>
  145. <li>1.2.4</li>
  146. <ul>
  147. <li>Bugs fixed</li>
  148. <ul>
  149. <li>clone keyword support</li>
  150. <li>1535949 fixed : default method call type was String, it is now Unknown</li>
  151. <li>syntax class::constant</li>
  152. </ul>
  153. <li>Changes</li>
  154. <ul>
  155. <li>Quick search sorted by name length (this is better now :)</li>
  156. </ul>
  157. </ul>
  158. </ul>
  159. <ul>
  160. <li>1.2.3</li>
  161. <ul>
  162. <li>Bugs fixed</li>
  163. <ul>
  164. <li>better modifier parsing</li>
  165. <li>a bug fixed in code analysis of try statements</li>
  166. <li>some bugs fixed in dockable panel</li>
  167. <li>1458668 fixed (&lt; while ($a) : ?&gt;blabla&lt;?endwhile;?&gt;</li>
  168. <li>1432935 fixed</li>
  169. <li>1489533 fixed (const keyword)</li>
  170. <li>Syntax like TR_TreeAction::getInstance('containers')->isRoot(5); fixed</li>
  171. <li>several fields declared in the same likes is now allowed in php 5</li>
  172. </ul>
  173. </ul>
  174. </ul>
  175. <ul>
  176. <li>1.2.2</li>
  177. <ul>
  178. <li>Missing '?>' is now reported as warning and can be deactivated in the options</li>
  179. <li>Better code completion handling for interfaces</li>
  180. <li>&lt;?xml token is now ignored (I think if you put such token, your php.ini config will only accept
  181. &lt;?php for
  182. starting php scripts
  183. </li>
  184. <li>Bugs fixed</li>
  185. <ul>
  186. <li>php 5 : better handling of type of the method parameters (array and several other keywords
  187. are now allowed)
  188. </li>
  189. <li>Class access are allowed after method calls ( $a->test()->tutu() )</li>
  190. <li>Interfaces can now extends several interfaces</li>
  191. <li>1378327 fixed</li>
  192. <li>981809 fixed</li>
  193. <li>1066608 fixed</li>
  194. <li>1368690 fixed : syntax like if ($a && $b = 3)</li>
  195. <li>Bug fixed when you had an interface in a project preventing the project to load</li>
  196. </ul>
  197. </ul>
  198. </ul>
  199. <ul>
  200. <li>1.2.1</li>
  201. <ul>
  202. <li>Option for conditional expression warning</li>
  203. <li>Bugs fixed</li>
  204. <ul>
  205. <li>Release 1.2.0 was missing some icons</li>
  206. <li>NPE fixed in smart code completion</li>
  207. <li>Some code analysis were executed twice</li>
  208. <li>NPE fixed in ArrayInitializer code analysis <i>array('foo',)</i> syntax</li>
  209. </ul>
  210. </ul>
  211. </ul>
  212. <ul>
  213. <li>1.2.0<br>
  214. <ul>
  215. <li>Bugs fixed
  216. <ul>
  217. <li>1203867 bugfix with code analysis</li>
  218. <li>1098323 A <b>?></b> in an heredoc syntax will not crash the parser anymore
  219. </li>
  220. <li>1098321 The keyword <b>xor</b> is now supported</li>
  221. <li>Fix warning in code analysis on global requiring super globals variables
  222. </li>
  223. <li>a memory leak, the PHPErrorSource was instantiated on each parse and never
  224. released
  225. </li>
  226. <li>Keywords that can be method names should now be managed.</li>
  227. </ul>
  228. </li>
  229. <li>Features
  230. <ul>
  231. <li>Sidekick completion</li>
  232. <li>Project handling</li>
  233. <li>Quick access to find class and methods</li>
  234. <li>new warning for syntax case '' ; (semicolon instead of colon)</li>
  235. <li>Parsing of double quoted strings</li>
  236. <li>php 5 support</li>
  237. </ul>
  238. </li>
  239. <li>Others
  240. <ul>
  241. <li>Some cleanup in the parser</li>
  242. </ul>
  243. </ul>
  244. </li>
  245. <li>1.1.0<br>
  246. <ul>
  247. <li>The files edited with jEdit php mode are parsed, no more option pane to choose them</li>
  248. <li>Sidekick structure tree</li>
  249. <li>Parse on keystroke with sidekick</li>
  250. <li>Code analysis:
  251. <ul>
  252. <li>Unused method parameters reported</li>
  253. <li>Variable used before being assigned are reported</li>
  254. </ul>
  255. </li>
  256. </ul>
  257. </li>
  258. <li>1.0.3<br>
  259. <ul>
  260. <li>Heredoc support</li>
  261. <li>My contact adress changed</li>
  262. </ul>
  263. </li>
  264. <li>1.0.2<br>
  265. <ul>
  266. <li>When you deactivate the parser in the options, it will really be deactivated</li>
  267. <li>lot of bugfixes in the parsing</li>
  268. </ul>
  269. </li>
  270. </ul>
  271. <h2>known issue</h2>
  272. <ul>
  273. <li>when you deactivate the parser the errors aren't removed from ErrorList (but is it really a bug or a feature
  274. ?)
  275. </li>
  276. <li>When you have several classes or methods with the same name in the project only one is kept in the project
  277. memory
  278. </li>
  279. </ul>
  280. <h2>Feedback</h2>
  281. <p>Please report bugs to the bug jEdit's plugin tracker on sourceforge.net</p>
  282. </body>
  283. </html>