Libraries and tools/HJS

From HaskellWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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)

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.

Todo

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