Personal tools

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

1 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)

1.1 Installing

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.

1.2 Todo

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