# call of the syntax check program  $syntax  with the file  $efile$ssuff  
#
# Copyright (C) 2000  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!
  exec tr {"\344\366\374\304\326\334\337"} {"aouAOUs"} < $dat > $dat-chk

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


}
