#
# This file fixes a bug (in a very dirty way) in a Token Manager generated 
# by JavaCC 0.8pre2. It should not be considered as a bugfix for JavaCC the
# applied fix works only for JEL. The fixing is done by automatic commenting
# out some lines in token manager.
#
# You need to run this script every time the parser is regenerated from .jj
# file otherwise two tests in the testsuite will fail. The bug affects only
# positions of errors reported by JEL in some particular cases, it does not
# influence JEL generated code.
#
# (c) 1999 by Konstantin L. Metlov.
#

BEGIN {
  commenting=0
  after=0
}

{
  if (commenting==1) 
    print "//   ", $0
  else
    print $0
}

(after==0) && ($0~/boolean EOFSeen = false/) {
  commenting=1
  after=1
}

(after==1) && ($0~/if \(!EOFSeen\)/) { 
  commenting=0
  after=2
}

(after==2) && ($0~/error_after = curPos/) {
  commenting=1
  after=3
}

(after==3) && ($0~/}/) {
  commenting=0
}
