Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Saturday, 12 May 2012 at 03:32:20 UTC, Ary Manzana wrote: I think you are wasting much more memory and performance by storing all the tokens in the lexer. Imagine I want to implement a simple syntax highlighter: just highlight keywords. How can I tell DCT to *not* store all tokens because

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Monday, 14 May 2012 at 15:00:37 UTC, Roman D. Boiko wrote: Could anybody suggest other pros and cons? Which option would you choose? Further discussion on this topic (struct vs class) is at http://forum.dlang.org/thread/asdrqlaydzcdpqwsb...@forum.dlang.org

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread deadalnix
Le 14/05/2012 17:00, Roman D. Boiko a écrit : On Saturday, 12 May 2012 at 03:32:20 UTC, Ary Manzana wrote: I think you are wasting much more memory and performance by storing all the tokens in the lexer. Imagine I want to implement a simple syntax highlighter: just highlight keywords. How can I

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Monday, 14 May 2012 at 16:30:21 UTC, deadalnix wrote: Le 14/05/2012 17:00, Roman D. Boiko a écrit : Making it a class would give several benefits: * allow not to worry about allocating a big array of tokens. E.g., on 64-bit OS the largest module in Phobos (IIRC, the std.datetime) consumes 1

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Tove
On Monday, 14 May 2012 at 16:58:42 UTC, Roman D. Boiko wrote: You are over engineering the whole stuff. I'm trying to solve this and other tradeoffs. I'd like to simplify but satisfy my design goals. What if there were two different lex:er modes... with different struct:s. 1. For an IDE wit

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Monday, 14 May 2012 at 19:04:20 UTC, Tove wrote: On Monday, 14 May 2012 at 16:58:42 UTC, Roman D. Boiko wrote: You are over engineering the whole stuff. I'm trying to solve this and other tradeoffs. I'd like to simplify but satisfy my design goals. What if there were two different lex:er m

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Monday, 14 May 2012 at 19:13:39 UTC, Roman D. Boiko wrote: On Monday, 14 May 2012 at 19:04:20 UTC, Tove wrote: What if there were two different lex:er modes... with different struct:s. 1. For an IDE with on the fly lexing: Assumption, the error rate is high.(need to keep much info) 2. For