PDA

View Full Version : Script Documenters


snapple
11-03-2005, 10:51 AM
From: http://www.actionscript.org/forums/showthread.php3?t=86995
( http://www.actionscript.org/forums/showpost.php3?p=411066&postcount=13 )
( http://www.actionscript.org/forums/showpost.php3?p=411069&postcount=14 )

----------------------------------------

Yeah, you got me :[ Damn AS 3.0!

The funny thing about the domain name; when i registered it, i had no idea that there was already an as2doc.com (should have guessed). But i think as2docs sounds better because you don't just produce 1 document really.

The reason why i built as2doc was because i looked at all the alternatives and i couldn't find a free, desktop actionscript 2.0 documenter for windows. As far as i am aware, mine might be (but probably is not) the first free desktop actionscript 2.0 documenter.

Senocular i cannot say that mine does even 20% of the things that yours does, with other languages and SEPY and stuff - in fact mine only supports @see, @return @param @author tags :[

But writing the parser in Java was a bit hard because parsers, as you know, by definition are not OO, they are more procedural. I'm a great fan of keeping all code dead simple and fuctional - but even with this mentality i still ended up with a parser class of 1046 lines.

Did you write a grammar for the AS 2.0 language senocular?

Regards, snapple :]

senocular
11-03-2005, 11:05 AM
Yeah I think docs thing makes more sense. What AS2Doc has for it, though, is its similarity to JavaDoc (with no s). Some of the ones I have listed ( http://www.senocular.com/projects/ZenDoc/?page=help#manual_credits ) I didn't even know existed prior to working on ZenDoc. And in case you're wondering, Pixelwit came up with ZenDoc ;) I made it mostly for the same reason you did - to have a free documenter, but not so much to have for the desktop (being that its PHP, it doesn't make it so viable) but more to be accessible to anyone, mac or PC or Linux or whatever as long as you have a browser, and completely customizable. I didn't like how you were stuck with mainly 1 or a few designs for documentation. Using templates, I was able to make them anything. And actually, the advantage of using templates made it possible to "support" so many tags since those tags are mostly just a result of the template saying "take tag name, place text next to it" and that tag name can be anything the template specifies.

My parser is pretty basic. Its mostly brute force string slicing based on recognized patterns (hand coded). Nothing special, but it kept things simple.

jsebrech
11-03-2005, 11:56 AM
I've written parsers both with the brute force approach and with lex and yacc, and I must say I vastly prefer the lex and yacc approach. Writing a full programming language parser (which I've done for C and ObjectPascal) could be a bit daunting if you couldn't use lex and yacc. Does anyone know of lex and yacc implementations for PHP or AS?

senocular
11-03-2005, 01:32 PM
None that I know of - though I wouldnt see much trouble in getting something used for JavaScript and adopting that.

hangalot
11-03-2005, 03:56 PM
i used pyparsing in the past to parse different languages. pretty handy library

jsebrech
11-03-2005, 04:05 PM
When I've had to parse in PHP I've used preg_match, but it's not an ideal solution (although it was fast enough to be workable).