Personal tools

Libraries and tools/HJS

From HaskellWiki

< Libraries and tools(Difference between revisions)
Jump to: navigation, search
 
m
Line 1: Line 1:
= Javascript Parser (and Interpreter later) =
 
 
 
''Javascript - The World's Most Misunderstood Programming Language?'' [http://javascript.crockford.com/javascript.html]
 
''Javascript - The World's Most Misunderstood Programming Language?'' [http://javascript.crockford.com/javascript.html]
   

Revision as of 20:56, 13 February 2007

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 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.

2 Todo

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