FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Lexer?

 
Post new topic   Reply to topic     Forum Index -> lr-lalr
View previous topic :: View next topic  
Author Message
mingwu



Joined: 25 Oct 2004
Posts: 3

PostPosted: Mon Oct 25, 2004 9:37 pm    Post subject: Lexer? Reply with quote

Is there anyway to say:

<decimal> -> ["1"-"9"] (["0"-"9"])*

instead of:

<znamenka> -> 0
<znamenka> -> 1
<znamenka> -> 2
<znamenka> -> 3
<znamenka> -> 4
<znamenka> -> 5
<znamenka> -> 6
<znamenka> -> 7
<znamenka> -> 8
<znamenka> -> 9
Back to top
View user's profile Send private message
Ivan Senji



Joined: 03 Sep 2004
Posts: 8
Location: Zagreb, Croatia

PostPosted: Mon Nov 29, 2004 5:47 am    Post subject: Re: Lexer? Reply with quote

mingwu wrote:
Is there anyway to say:

<decimal> -> ["1"-"9"] (["0"-"9"])*



Unfortunately no. At least not at the moment because the algorithm i implemented needs simple rules. But i have been thinking of adding a preprocessor for grammar files that will let you write something similar to that but rules like that will still internaly have to be converted to simple rules.

And there is also a problem with action-parts of rules, maybe they will have to be made a part of the rule, and not after the rule.

<decimal> -> ["1" - "2"]
-{ some D code with actions }-
(["0"-"9"])*
-{some more D-code }-

But all changes will have to wait until i have more time (maybe by the end of the year). Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> lr-lalr All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group