[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to discard data in scanner?
From: |
Jibin Han |
Subject: |
How to discard data in scanner? |
Date: |
Wed, 05 Mar 2003 00:39:59 -0700 |
Hi,
The data file I am parsing is kind of this format,
name = <value>, <property1>=val1>,<property2>=<val2>
In the scanner file, I set some start states, for example, if I read "name
=",
then I begin a state, <NAME>, then when I read coma, I begin state PROPERTY1,
and
so on.
So the coma here is the symbol to change the state. And the rule is like,
<NAME>, { BEGIN(PROPERTY1); }
<VALUE1>, { BEGIN(PROPERTY2); }
then when I run the parser, everything is OK, but I see many coma print out,
it seems I should do something with the coma, but I really do not want to pass
coma to parser. My question is is there any easy way to discard the coma?
Thanks.