Module "JavaScript.curry"

A library to represent JavaScript programs.

Author: Michael Hanus

Version: January 22, 2007


 Exported names:

Datatypes:
JSBranch | JSExp | JSFDecl | JSStat

Constructors:
JSApply | JSAssign | JSBool | JSCase | JSDefault | JSFCall | JSFDecl | JSIArrayIdx | JSIf | JSInt | JSIVar | JSLambda | JSOp | JSPCall | JSReturn | JSString | JSSwitch | JSVarDecl

Functions:
jsConsTerm | showJSExp | showJSFDecl | showJSStat


 Summary of exported functions:

showJSExp  :: JSExp -> String  deterministic flexible+rigid
          Shows a JavaScript expression as a string in JavaScript syntax.
showJSStat  :: Int -> JSStat -> String  deterministic flexible+rigid
          Shows a JavaScript statement as a string in JavaScript syntax with indenting.
showJSFDecl  :: JSFDecl -> String  deterministic flexible
          Shows a JavaScript function declaration as a string in JavaScript syntax.
jsConsTerm  :: String -> [JSExp] -> JSExp  deterministic 
          Representation of constructor terms in JavaScript.

 Imported modules:

List
Prelude

 Exported datatypes:

JSExp

Type of JavaScript expressions.

Constructors:

JSString :: String -> JSExp

JSString - string constant

JSInt :: Int -> JSExp

JSInt - integer constant

JSBool :: Bool -> JSExp

JSBool - Boolean constant

JSIVar :: Int -> JSExp

JSIVar - indexed variable

JSIArrayIdx :: Int -> Int -> JSExp

JSIArrayIdx - array access to index array variable

JSOp :: String -> JSExp -> JSExp -> JSExp

JSOp - infix operator expression

JSFCall :: String -> [JSExp] -> JSExp

JSFCall - function call

JSApply :: JSExp -> JSExp -> JSExp

JSApply - function call where the function is an expression

JSLambda :: [Int] -> [JSStat] -> JSExp

JSLambda - (anonymous) function with indexed variables as arguments


JSStat

Type of JavaScript statements.

Constructors:

JSAssign :: JSExp -> JSExp -> JSStat

JSAssign - assignment

JSIf :: JSExp -> [JSStat] -> [JSStat] -> JSStat

JSIf - conditional

JSSwitch :: JSExp -> [JSBranch] -> JSStat

JSSwitch - switch statement

JSPCall :: String -> [JSExp] -> JSStat

JSPCall - procedure call

JSReturn :: JSExp -> JSStat

JSReturn - return statement

JSVarDecl :: Int -> JSStat

JSVarDecl - local variable declaration


JSBranch

Constructors:

JSCase :: String -> [JSStat] -> JSBranch

JSCase - case branch

JSDefault :: [JSStat] -> JSBranch

JSDefault - default branch


JSFDecl

Constructors:

JSFDecl :: String -> [Int] -> [JSStat] -> JSFDecl



 Exported functions:

showJSExp :: JSExp -> String  deterministic flexible+rigid

Shows a JavaScript expression as a string in JavaScript syntax.


showJSStat :: Int -> JSStat -> String  deterministic flexible+rigid

Shows a JavaScript statement as a string in JavaScript syntax with indenting.

Example call:  (showJSStat i jstat)

Parameters:
i - number of spaces to indent this statement
jstat - the JavaScript statement to print

showJSFDecl :: JSFDecl -> String  deterministic flexible

Shows a JavaScript function declaration as a string in JavaScript syntax.


jsConsTerm :: String -> [JSExp] -> JSExp  deterministic 

Representation of constructor terms in JavaScript.

Example call:  (jsConsTerm cons args)

Parameters:
cons - the name of the data constructor
args - the arguments of the constructor term
Further infos:
  • solution complete, i.e., able to compute all solutions


Generated by CurryDoc (Version 0.4.1 of June 7, 2007) at Aug 28 15:29:29 2008