Lexer in D

Dmitry Olshansky dmitry.olsh at gmail.com
Thu Mar 14 14:27:18 PDT 2013


15-Mar-2013 01:17, Artur Skawina пишет:
> On 03/14/13 18:24, Dmitry Olshansky wrote:
>> 14-Mar-2013 21:20, Namespace пишет:
>>> Yes, and it's really fun. :)
>>> By the way, the code can be found here:
>>> https://github.com/Dgame/Puzzle/blob/master/DLexer.d
>>> Maybe some of you have an idea how I could improve anything.
>>> Last trace.log is also there:
>>> https://github.com/Dgame/Puzzle/blob/master/trace.log
>>> My goal is about 20 msecs. :D
>>
>> And my is 15 with Dscanner. But it's stuck at around 21-22.
>> But both of us can just cheat and buy a newer PC :)
>
> What are you both actually measuring? IOW what happens with the
> resulting tokens?
>
> artur
>

I'm counting and/or filtering out specific tokens. The latter is a tiny 
bit slower.

The other options of Dscanner are to generate e.g. HTML highlighting for 
code or measure token frequencies. Haven't timed those as their speed 
doesn't entirely depend on lexer as is.

-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list