let's try a tiny Haskell subset:

- functions of one integer argument, producing one integer result

parsing, treebuilding, semantic checking and then codegenning
equivalent Dafny (was C) code, ready for compilation and execution.

lexer.l:	the lex file describing the tokens.

types.in:	datadec input file describing the AST.

parser.y:	the yacc file describing the Haskell subset grammar.

consthash.[ch]: a constant hash module, defining a hash constname->value
	        and a lookup symbol routine which calls yyerror() if undefined.

genpair:	variant tiny-tool perl script

arithfuncs.in:	variant tiny-tool format input to build plus(a,b) etc

boolfuncs.in:	variant tiny-tool format input to build equals(a,b) etc

mainprog.c:	the separate main program (previously in parser.y)

Makefile:	the Makefile describing how to build haskell2dafny, now
		linking against datadec-generated types, and directly
		invoking the tiny-tool.

callhash.[ch]:	a simple hash (or set) of all functions called.
		key=funcname, value=1 (i.e, it's a sethash or set)

funchash.[ch]:	a hash of all functions defined in tiny-Haskell.
		key=funcname, value=fdefn tree

semchecks.[ch]:	semantic checks (invoked by main() after parsing).

codegen.[ch]:	Dafny code generation (after semantic checking).

testme:		Perl testing script - turn a tiny-Haskell input (with a
		cmd line arg) into Dafny. repeat for
		each cmd line arg after the input filename.

haskell-egs/*:
		test cases for haskell2dafny (some need arg1 set, via cmd line
		arg i.e. run "haskell2dafny 3 < FILE" predefines arg1=3)
		including some semantic error inputs, and even a runtime error

haskell2dafny:	(after a make:-)) our tiny Haskell to Dafny translator.

Build and test haskell2dafny via:
  make
then the following will produce Dafny translations on stdout:
  ./haskell2dafny 3 < ../06.haskell-egs/input6
  ./haskell2dafny 4 < ../06.haskell-egs/input6
  ./haskell2dafny 5 < ../06.haskell-egs/input6
or:
  ./testme ../06.haskell-egs/input6 1 2 3 4 5

		Duncan White
		2nd April 2014
