An AST program normally has the following structure:
/* Include the interface to the AST library. */ #include "ast.h" /* Main program (or could be any function). */ main () { <normal C declarations and statements> /* Enclose the parts which use AST between the astBegin and astEnd macros. */ astBegin; <C statements which use AST> astEnd; <maybe more C statements> }
The use of astBeginastBegin and astEndastEnd is optional, but has the effect of tidying up after you have finished using AST, so is normally recommended. For more details of this, see 4.10. For details of how to access the ``ast.h'' header file, see 22.1.