#! /bin/sh

# nonsense for Java execution - works with Sun's Java interpreter
JAVA="java -classic"
export CLASSPATH=xalan/xerces.jar:.

# produce a single def file
makedef() {
  echo "Making $2 $3"
  $JAVA Defs $1 $3 > ../include/$2
  JAVA_EXIT_CODE=$?
  if [ $JAVA_EXIT_CODE -ne 0 ]; then exit $JAVA_EXIT_CODE; fi
  echo "done"
} # makedefs()

# create *.def files
makedef 14 QI_queries.def normalize
makedef 15 UD_queries.def normalize
makedef  1 DF_attribute_aliases.def
makedef  2 DF_attribute_aliases_map.def
makedef  3 DF_attribute_codes.def
makedef  4 DF_attribute_enum.def
makedef  5 DF_attribute_inv_attr_mask.def
makedef  6 DF_attribute_names.def
makedef  7 DF_class_aliases.def
makedef  8 DF_class_aliases_map.def
makedef  9 DF_class_codes.def
makedef 10 DF_class_dbase_code_map.def
makedef 11 DF_class_enum.def
makedef 12 DF_class_mask.def
makedef 13 DF_class_names.def
makedef 16 DF_class_templates.def
makedef 17 DF_class_templates_v.def
makedef 18 Diagrams.def
makedef 21 DF_radix_load.def

# create header and tab files
$JAVA RPSLSyntax                    # produce syntax_tab.h
$JAVA Defs 22 > attribute_tab.h     # produce attribute_tab.h
$JAVA Defs 23 > class_tab.h         # produce class_tab.h

