Related articles |
---|
JavaCC question - why does this happen? megadeth@terra.com.br (Leonardo Hyppolito) (2002-09-03) |
Re: JavaCC question - why does this happen? vbdis@aol.com (VBDis) (2002-09-08) |
From: | "VBDis" <vbdis@aol.com> |
Newsgroups: | comp.compilers |
Date: | 8 Sep 2002 22:43:26 -0400 |
Organization: | AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com |
References: | 02-09-021 |
Keywords: | parse |
Posted-Date: | 08 Sep 2002 22:43:26 EDT |
<megadeth@terra.com.br> schreibt:
>< num: (<dig>) (<dig>)* ( (",") (<dig>) )? >
>
>IT SHOULD accept my number "9" as a <num> token, right??
I have no idea of JavaCC, but the most probable explanation here is: (<dig>)*
means 1 or more digits, not 0 or more. This would at least explain, why longer
numbers are accepted.
Consequently I'd try:
< num: (<dig>)* ( (",") (<dig>) )? >
and include ,9 into the test data, to determine whether * accepts 0 occurences.
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.