help-flex
[Top][All Lists]
Advanced

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

RE: Help with Flex input matching


From: Vincent Zweije
Subject: RE: Help with Flex input matching
Date: Thu, 7 Apr 2005 09:06:59 +0200

Ruben:

> According to this, I would expect the next flex program:
> 
>      %%
>      uva {printf("3");}
>      xu {printf("4");}
> 
> 
> with this input:
>      xuva
> 
> to generate this output, because chosing the first rule would
> match more characters from the input:
>      x3
> 
> but it is generating this output instead:
>      4va

Flex matches patterns only at the beginning of the input.
Only xu matches at the beginning.
The v and the a are added by the default rule (when xu is removed),
which matches any character and copies it to the output.



reply via email to

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