Thread overview | |||||
---|---|---|---|---|---|
|
June 02, 2007 Scanner (Lexer) using re2c http://re2c.org | ||||
---|---|---|---|---|
| ||||
Attachments: | Hi! Attached is a D example Scanner using re2c http://re2c.org. It can be used eg. together with Lemonade. greetings christoph |
June 02, 2007 Re: Scanner (Lexer) using re2c http://re2c.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christoph Singewald | Hi, I tried it. Very nice :) One small fix: if(args.length<1) { should be: if(args.length<2) { because args[0] == executablepath Best regards, Daniel |
June 02, 2007 Re: Scanner (Lexer) using re2c http://re2c.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel919 | yes right, I didn't see this mistake, not tested a lot:)
If the grammar is getting more complex, re2c places some "unsigned int" into the code. Under Unix I'll got around with
re2c -i lexer.re | sed s/unsigned\ int/uint/ > lexer.d
hope it helps
christoph
Daniel919 Wrote:
> Hi, I tried it. Very nice :)
>
> One small fix: if(args.length<1) {
> should be: if(args.length<2) {
> because args[0] == executablepath
>
> Best regards,
> Daniel
|
Copyright © 1999-2021 by the D Language Foundation