By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

yacc, same token

P: n/a
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 (cm****@hotmail.com)

Dec 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
cm****@hotmail.com wrote:
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 (cm****@hotmail.com)

Well, how do you distinguish between a name and a value? (Perhaps you
shouldn't allow a number to be a name)

Robert
Dec 23 '05 #2

P: n/a
cm****@hotmail.com wrote:
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.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Dec 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.