Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > yacc, same token

Reply
Thread Tools

yacc, same token

 
 
cmk128@hotmail.com
Guest
Posts: n/a
 
      12-23-2005
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 ((E-Mail Removed))

 
Reply With Quote
 
 
 
 
Robert Harris
Guest
Posts: n/a
 
      12-23-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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 ((E-Mail Removed))
>

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

Robert
 
Reply With Quote
 
 
 
 
Flash Gordon
Guest
Posts: n/a
 
      12-23-2005
(E-Mail Removed) 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
This is an unexpected token. The expected token is 'NAME' =?Utf-8?B?Y2FzaGRlc2ttYWM=?= ASP .Net 2 07-13-2007 11:38 AM
Token pasting (## operator) - Add whitespace to a token Wessi C Programming 3 08-11-2005 01:02 PM
"token" "token sequence" "scalar variable" "vector" ?? G Fernandes C Programming 1 02-18-2005 05:32 AM
strange syntax: $var'token Michael Vilain Perl 1 09-15-2004 06:23 AM
preprocessor, token concatenation, no valid preprocessor token Cronus C++ 1 07-14-2004 11:10 PM



Advertisments