View previous topic :: View next topic |
Author |
Message |
mingwu
Joined: 25 Oct 2004 Posts: 3
|
Posted: Mon Oct 25, 2004 9:37 pm Post subject: Lexer? |
|
|
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 |
|
|
Ivan Senji
Joined: 03 Sep 2004 Posts: 8 Location: Zagreb, Croatia
|
Posted: Mon Nov 29, 2004 5:47 am Post subject: Re: Lexer? |
|
|
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). |
|
Back to top |
|
|
|