[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: parsing-error-strangeness
From: |
Jan-Henrik Haukeland |
Subject: |
Re: parsing-error-strangeness |
Date: |
Thu, 07 Aug 2003 12:46:14 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Civil Service, linux) |
Jan-Henrik Haukeland <address@hidden> writes:
>> It should complain over line 5 and not with ''.
>
> Hit yourself on the head :-) I had to fix the line number counting in
> l.l for SERVICETOKENS you added and the reporting is better but it is
> still not perfect because of this, it may be off by one or more lines:
>
>
> [ \n\t]+[^,] {
> lineno++;
> unput(yytext[strlen(yytext)-1]);
> BEGIN(INITIAL);
> }
>
> lineno is incremented once but since [ \n\t]+[^,] may contain more
> than one \n line number is off by the number of \n + 1. I have been up
> all night and is to tired to find a good solution for this, but maybe
> you can?
Just to let you know if you plan to give it a stab. If you use this
version below, line number is correct when reporting the error. I
thought I got it right because I tested with the version below, but
with your example it turned out to be wrong after all (as explained
above)
check process crond with pidfile /var/run/crond.pid
depends ssh
alert address@hidden
check process ssh with pidfile /var/run/sshd.pid
port 22 protocol ssh
But if you do this, line number is off by n-1 (is the right offset)
check process crond with pidfile /var/run/crond.pid
depends ssh
^
Number of line numbers off
v
alert hauk
check process ssh with pidfile /var/run/sshd.pid
port 22 protocol ssh
or
check process crond with pidfile /var/run/crond.pid
depends ssh
^
Number of line numbers off
v
check process ssh with pidfile /var/run/sshd.pid
port 22 protocol ssh
--
Jan-Henrik Haukeland