yacc, same token

C

cmk128

Hi All

Here is my .l file, when the input is '1', the token will match mame,
but sometime i want it matches "values". how to?

chars [A-za-z0-9\_\'\.\"]
int [0-9]+
string \"{chars}+\"
words {chars}+
values {int}|{string}|{bool}
name [a-zA-Z0-9]+

thanks
from Peter ([email protected])
 
R

Robert Harris

Hi All

Here is my .l file, when the input is '1', the token will match mame,
but sometime i want it matches "values". how to?

chars [A-za-z0-9\_\'\.\"]
int [0-9]+
string \"{chars}+\"
words {chars}+
values {int}|{string}|{bool}
name [a-zA-Z0-9]+

thanks
from Peter ([email protected])
Well, how do you distinguish between a name and a value? (Perhaps you
shouldn't allow a number to be a name)

Robert
 
F

Flash Gordon

Hi All

Here is my .l file, when the input is '1', the token will match mame,
but sometime i want it matches "values". how to?

<snip>

Yacc is not C, please ask somewhere yacc is topical, not here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top