[= autogen template -*- Mode: C -*-
#  $Id: agexpr.tpl,v 2.2 1999/06/04 16:28:08 bkorb Exp $
h =]
/*
[=_eval "# *  " _DNE=]
 *
 *  copyright 1992-1999 Bruce Korb
 *
[=_eval "AutoGen" "# *  " _GPL=]
 */

#ifndef AUTOGEN_AGEXPR_H
#define AUTOGEN_AGEXPR_H

typedef int (tExprFunc)( int         level,
                         tValStack*  pStk,
                         tDefEntry*  pCurDef );

typedef tExprFunc*  tpExprFunc;

#define funcTableCt [=_eval evalexpr _hilim 1 + =]

#ifndef EXPR_PRIVATE
#  ifndef EVAL_PRIVATE
#    error [=_eval _outfile=] is private to agExpr and agEval
#  endif

extern tpExprFunc*  pExprFuncTable;

#else
static tExprFunc[=

_FOR evalexpr =][=

  # Put a newline after every fourth entry. =][=

  _IF _index 4 % 0 = =]
  [=
  _ENDIF
  =]evalExpr_[=

  _IF _last
    =][=name =];[=
  _ELSE  =][=

    # Every name but the last one gets padded out for a nice table

    =][=name #, + "#%-10s" _printf =][=
  _ENDIF =][=

/evalexpr=]

static tpExprFunc exprFuncTable[ [=_eval evalexpr _hilim 1 + =] ] = {[=

_FOR evalexpr =][=
  _IF _index 4 % 0 = =]
  [=
  _ENDIF
  =]&evalExpr_[=

  _IF _last
    =][=name =] };[=
  _ELSE
    =][=name #, + "#%-9s" _printf =][=
  _ENDIF =][=

/evalexpr=]

tpExprFunc* pExprFuncTable = exprFuncTable;
#endif /* EXPR_PRIVATE */

#ifdef EVAL_PRIVATE
[=_FOR evalexpr =]
static const char zExprFunc[=name _cap #[] + "#%-12s" _printf
       =] = [=name _up _str=];[=
/evalexpr=]

static const char* apzExprName[ [=_eval evalexpr _hilim 1 + =] ] = {[=

_FOR evalexpr =][=

  # Put a newline after every fourth entry. =][=

  _IF _index 4 % 0 = =]
  [=
  _ENDIF
  =]zExprFunc[=

  _IF _last =][=
    name _cap=] };[=
  _ELSE =][=
    name _cap #, + "#%-10s" _printf =][=
  _ENDIF =][=

/evalexpr=]

#endif /* EVAL_PRIVATE */
#endif /* AUTOGEN_AGEXPR_H */
