help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: Grammar for IPv6 address


From: Jeganatan, Srividhya
Subject: FW: Grammar for IPv6 address
Date: Wed, 7 Jul 2004 12:53:55 -0400


-----Original Message-----
From: Jeganatan, Srividhya 
Sent: Wednesday, July 07, 2004 12:35 PM
To: 'address@hidden'
Cc: 'address@hidden'
Subject: RE: Grammar for IPv6 address


Hi Dan
Thanks for the input.
Please see below:
============================================================
Can't you use something like:

%token     value
%left       '.' ':'

%%

IP6:        type1_IP6
|           type2_IP6
|           type3_IP6
;

type1_IP6:                value
|           type1_IP6 ':' value
;

Yes, I could. In fact my initial version started this way. But one problem
with this is that how to know which part of the address is being entered.
for example, when I parse "x1:x2:x3", I need to know that x3 is the third
value. Is there a way to use some kind of a counter?
Another problem is that it is possible to enter more than the max number of
"value" tokens. That is from the command line, some one can enter:
x:x:x:x:x:x:x:x:x:x:x
or
x::x:x:x:x:x:x:x:x

I want to define the limit on how many "values" can be entered after a
particular point.
For example, with the second example two lines above, I want to stop taking
input when I reach the 
7th x after "::".

One possibility will be to define all possible formats; I'm trying that out
but it seems to be exhaustive.

Thanks
SV




reply via email to

[Prev in Thread] Current Thread [Next in Thread]