Libraries and tools/HJS

From HaskellWiki
< Libraries and tools
Revision as of 20:51, 13 February 2007 by Mark Wassell (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Javascript Parser (and Interpreter later)

Javascript - The World's Most Misunderstood Programming Language? [1]

A Javascript [2] parser using Happy and Alex. It will parse the grammer detailed in ECMA-262 with some additions from [3] to support the parsing of specific test cases.

Possible applications of a Javascript interpreter:

  • Provide basis for experimenting with monadic interpreters and the addition of things like Software Transactional Memory to a 'mainstream language'
  • Basis for other 'large' language parsers
  • Embed Javascript in applications and application servers (such as HAppS)


Comes as a basic Cabal package [4]. If you do change the parser or lexer file you will need to manually run Alex and Happy *and* run FixHappy on the JavaScriptParser.hs file. This will add an 'action' argument to lexer call; this is a 'hack' to get parsing of regular expressions to work.


  • Extend scope of interpreter to all statements
  • Include function definition and calls
  • Include objects
  • Include built in objects and functions