Published 2006-06-01 08:55:54

I keep meaning to write a full log of the whole mythtv experience, as the number of hardware headaches that that has gone through is enough for at least 4 or 5 posts (including the need to rebuild from scratch this whole server a few weeks ago due to hard disk failures from overheating..). But this week, for what seems like the first time this year, I actually scraped 2 days to work on yet another new pet project. Phpmole's replacement....

Phpmole is my lifeblood for development, when I wrote it, I added all the features that where missing from other editors, and the resulting editor made a huge difference to my productivity.
  • code folding
    Although annoying at times, is a good way to dive into new code.
  • autocompletion
    look up PHP functions / variable names etc.
  • inline help hints
    show the signature of a php method inline.
  • List of open files on a left bar.
    Since I often have 30+ files open, this is very usefull to flip between them.
  • Standard editor features, like syntax highlighting etc.

However Phpmoles code base is now pretty old, and was written before I did much PEAR work (eg. it's messy....). There are alot of design decisions that related to PHPGTK1, and the need at the time to implement file transports (ssh/midgard/file) etc. Which are now redundant as things like sshfs do that much better.

So I've started hacking on leds, the editor I mentioned before when hacking on D. It has the benefit of being relatively small codebase wise, and very easy to understand. Let alone it's fast and runs as a binary, so I can eventually just compile the lib's and distribute them, rather than a huge array of php files.

Anyway, the first stage in the great conquest was to teach leds a little about PHP. So starting with Zend's lexer, I hand crafted a reasonably complete lexer in D, (it ignores variables in quoted strings, and heredocs), but should be enough to grab defined classes/methods/vars etc. and work out where to put the folding...

While at present, it's has a few in-efficiencies, as the design was a little organic. It is however quite an interesting way to build a generic language parser and only took 2 days to write and test..
Mentioned By: : php parser (90 referals) : april (76 referals) : php parse (73 referals) : php parsing (69 referals) : parse php (49 referals) : december (45 referals) : parsing php (41 referals) : php parse text file (39 referals) : Planet PHP (37 referals) : php parse text (37 referals) : php parse time (27 referals) : Alan Knowles' Blog: Parsing PHP in D. - (26 referals) : Alan Knowles' Blog: Parsing PHP in D. (25 referals) : php parsing text (23 referals) : php parse POST (22 referals) : International PHP Magazine::News::List of The News (19 referals) : PHP: Hypertext Preprocessor : Planet PHP : Parsing PHP in D. - SWiK (18 referals) : php parse variable (17 referals) : parser php (14 referals) : parse text php (12 referals)

Add Your Comment

Follow us on