Friday, February 11, 2011

hoc: hoc3 completed

hoc3 is complete, minus the exercises. I nearly bashed my head into the wall trying to track down the following segfault:

yyval.sym = s;

yyval should be yylval!?!? yyval is defined by yacc, and this is a valid statement. Ugh.

[tja@tja-desktop hoc3]$ ./hoc3
1.5^2.3
 2.5410306
exp(2.3*log(1.5))
 2.5410306
sin(PI/2)
 1
atan(1)*DEG
 45
?
 45

Again, '?' will print the last computed value.

TODO:


  1. 8-6: add support for built-ins with multiple parameters.
  2. 8-7: facility to execute commands (done?)
  3. 8-8: revise math.c to use a table instead

No comments:

Post a Comment