Next: TC-1 Improvements, Previous: TC-1 Code to Write, Up: TC-1 [Contents][Index]
Bison may report type clashes for some actions. For instance, if you
have given a type to "string"
, but none to exp
, then it
will choke on:
exp: "string";
because, unless you used ‘%define variant’, it actually means
exp: "string" { $$ = $1; };
which is not type consistent. So write this instead:
exp: "string" {};
ast::Exp
?Its real definition will be provided with TC-2, so meanwhile you have to provide a fake. We recommend for a forward declaration of ‘ast::Exp’ in libparse.hh.
When run, the compiler needs the file prelude.tih that includes
the signature of all the primitives. But the executable tc
is
typically run in two very different contexts:
An installed binary will look for an installed prelude.tih,
typically in /usr/local/share/tc/. The cpp
macro
PKGDATADIR
is set to this directory. Its value depends on the
use of configure
’s option --prefix, defaulting to
/usr/local.
When compiled, the binary will look for the installed prelude.tih, and of course will fail if it has never been installed. There are two means to address this issue:
TC_PKGDATADIR
If set, it overrides the value of PKGDATADIR
.
Using this option you may set the library file search path to visit the given directory before the built-in default value. For instance ‘tc -p /tmp foo.tig’ will first look for prelude.tih in /tmp.
Yes. Read the previous item.
Next: TC-1 Improvements, Previous: TC-1 Code to Write, Up: TC-1 [Contents][Index]