
Some parts of this message have been removed.
Learn more about Nabble's
security policy.
Hi, all!
I am writing a .jj file. The
function is:
void Start():{}{
(
LOOKAHEAD(3)
// Only do
someting when sequence <A><B><D> and
<A><C><D> appear
<A>{do something} <B>{do something} <D>{do
something}
|
<A>{do something} <C>{do something} <D>{do
something}
|
<B>{do nothing}
|
<C>{do nothing}
|
<D>{do nothing}
|
<A>{do nothing}
)*
}
JavaCC compiler reports an error
that <A> is unreachable.
But I can't see why it is
unreachable, because there are obvious other combinations of <A>,
<B>, <C> and <D> other than <A><B><D> and
<A><C><D>.
Can anyone give some
hint?
Thanks!
Aaron
发件人: Paul
Cager
发送时间:
2008-06-16 22:27:00
主题: [JavaCC] Re:
[JavaCC-Dev] Wrong line/column number reported in javacc
errormessage
On Mon, June 16, 2008 10:40, Stefan Hong wrote:
> Hi,
>
> I am using JavaCC with JJTree, it seems that the grammar errors
> reported by JavaCC frequently points to the wrong position in the
> source code. I am aware that the line/column numbers refer to the
> original *.jjt file instead of *.jj file generated by JJTree, but in
> my grammar, it is completely off (points to empty line etc). I can't
> reproduce this problem in smaller grammar file, but it happens
> regularly in grammar that I am working on, making it very hard to
> debug. A quick search through the issue database doesn't find
> anything related... am I doing anything wrong? Has anyone encountered
> similar problems?
>
>
> Thanks,
> Stefan
Hi Stefan,
Thanks for your email.
This is a known problem in JavaCC 4.0 (see issue
https://javacc.dev.java.net/issues/show_bug.cgi?id=80), and has been fixed
in release 4.1. (By default the "Issue List" does not display issues that
have been fixed in CVS).
There is a beta version of 4.1 available for download (see
https://javacc.dev.java.net/servlets/ProjectDocumentList). I'd be
interested to know if 4.1 fixes your problem.
Thanks,
Paul
---------------------------------------------------------------------