Personal tools

Libraries and tools/HJS

From HaskellWiki

< Libraries and tools(Difference between revisions)
Jump to: navigation, search
m
m (Making some keywords into links)
Line 1: Line 1:
 
''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]
   
A Javascript [http://developer.mozilla.org/en/docs/About_JavaScript] parser using Happy and Alex. It will parse the grammer detailed in ECMA-262 with some additions from [http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference] to support the parsing of specific test cases.
+
A Javascript [http://developer.mozilla.org/en/docs/About_JavaScript] parser using [[Happy]] and [[Alex]]. It will parse the grammer detailed in ECMA-262 with some additions from [http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference] to support the parsing of specific test cases.
 
 
 
Possible applications of a Javascript interpreter:
 
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'
+
* Provide basis for experimenting with monadic interpreters and the addition of things like [[software transactional memory|Software Transactional Memory]] to a 'mainstream language'
 
* Basis for other 'large' language parsers
 
* Basis for other 'large' language parsers
* Embed Javascript in applications and application servers (such as HAppS)
+
* Embed Javascript in applications and application servers (such as [[HAppS]])
   
 
== Installing ==
 
== Installing ==
Comes as a basic Cabal package [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hjs-0.1]. If you do change the parser or lexer file you will need to manually
+
Comes as a basic [[Cabal]] package [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hjs-0.1]. 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
+
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.
 
to lexer call; this is a 'hack' to get parsing of regular expressions to work.
 
 

Revision as of 02:04, 15 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