writing a JavaScript Scanner/Parser

Kilik <kilik3000@gmail.com>
Thu, 17 Jan 2008 13:20:35 -0800 (PST)

          From comp.compilers

Related articles
writing a JavaScript Scanner/Parser kilik3000@gmail.com (Kilik) (2008-01-17)
Re: writing a JavaScript Scanner/Parser oliverhunt@gmail.com (oliverhunt@gmail.com) (2008-01-28)
| List of all articles for this month |

From: Kilik <kilik3000@gmail.com>
Newsgroups: comp.compilers
Date: Thu, 17 Jan 2008 13:20:35 -0800 (PST)
Organization: Compilers Central
Keywords: parse, question, comment
Posted-Date: 18 Jan 2008 00:49:25 EST

As a purely academic exercise I would like to write a scanner/parser
for JavaScript. I know that there are many existing alternatives for
this, but I want to do my own so that I can learn. I'm thinking that
the output of my program will be an abstract syntax tree for
JavaScript. No need for a full blown JS runtime or anything like
that.


I would, however, like to get off on the right foot. Can anyone
recommend the best place to start? For example should I use a parser
generator or try to implement this by hand.


I have very little background in compilers, but I'd like to use a real
project to get my feet wet.


Any feedback/insight will be greatly appreciated.


-Thx


[It depends what your goals are. If you want to learn how to write a
scanner and parser by hand, write a lexer and recursive descent parser
by hand. If you figure (probably correctly) that any real parser you
write will use scanner and parser generators, use them. Which tools
to use depend in large part on your favorite programming language,
since most tools only generate code in one or two target languages.
You can always read my book, too. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.