# call of the syntax check program  $syntax  with the file  $efile$ssuff  
#
# Copyright (C) 1999  G. Lamprecht, W. Lotz, R. Weibezahn; IWD, Bremen University

proc syntax {f austext} {

  upvar 1 $austext a

  global  vv syntax syoptions efile ssuff

  writescr0 $f ""
  set a ""

  if {$efile==""} {set a "${a}***** $vv(ea1)\n"; mybell 2; return}

  set dat $efile$ssuff

  if ![file exists $dat] {# file not found!
   set a "${a}\n*** $vv(aus5)  $dat  $vv(ea4)\n"; mybell 2; return
  }

  writescr $f "[datime] $vv(sy1) \"$dat\":\n $syntax $syoptions $dat\n"

  # translate as "German Umlaute" are not allowed for texchk!
  SigChldB; exec tr {"\344\366\374\304\326\334\337"} {"aouAOUs"} < $dat > $dat-chk; SigChldU

  eval mkCmd_wait $f $syntax [list "$syoptions $dat-chk"]
  unlink -nocomplain $dat-chk


}
