I'm finding more and more reasons to have a parser, so I'm thinking
having a standard API would be a big plus in the long run. The API
might impact performance, but swapping out parsers would be much
easier and I guess the algorithms against the AST would be easier to
read.
The only candidate I know is mozilla's
https://developer.mozilla.org/en/SpiderMonkey/Parser_API
jjb
On 4/14/2011 8:21 AM, Richard Backhouse wrote:
I have done some work with the JS parser from UglifyJS. It just
needs a commonjs environment for module loading although
stripping the require calls should be sufficient. Let me know if
you want more details on what I have done with it.
Richard
"John J. Barton" ---04/14/2011 10:53:27
AM---On 4/14/2011 7:27 AM, Simon Kaegi wrote: Hi John,
On 4/14/2011 7:27 AM, Simon Kaegi wrote:
Hi John,
At the moment we're using JSLint but are not doing anything
with it at the parser level. We're just using it more or
less at the application level to help provide a basic
outline view as well as identifying problems.
At some point I suspect we're going to need to deeper
integration to let us have really amazing language tools and
I'm hoping there's some liberally licensed libraries we
might be able to use (we'd rather avoid reinventing the
wheel here). In addition to JSLint some of the libraries
probably also worth a deeper look are: UglifyJS, Narcissus,
and more recently I saw Reflect.js go by.
Here's my take:
JSLint is interesting because of its base function and unusual
parser algorithm. The license is barely acceptable.
This would be a one-way relationship, don't expect any changes
to be considered upstream. There is a new fork however. Both
main and fork likely to be around. I wanted to like this one,
but couldn't get in to the code easily.
UglifyJS code is easy to read and claims to be fast; generates
an AST; BSD license.
Very active now and growing adoption. Node.js/NPM centric
unfortunately. Based on the same parser techniques as
CodeMirror.
CodeMirror2 already used for editing, auto-complete; good
support. MIT. Code is harder to read.
Long time parser person behind it, good track record, used in
firerainbow for Firebug syntax highlighting, not blazing fast.
Narcissus older JS style, mozilla specific, focused on parsing
for compilers.
Around a long time, not active.
Reflect.js, uses new Mozilla API,
No track record.
I'll ask on the Firebug Working group also.
jjb
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/orion-dev
|