And as next, It is also nearly impossible with Bmax to write
a highlighter with a good speed.(espacially in Win32) Thats because of the richedit control, which is used. There are several tweaks for this, but mostly they are already implemented in BMax.
I have tried a highlighter by myself, and finally comes to the conclusion that it isn't worth the time.
My Highlighter was able to parse a text of around 150kb in nearly 12 seconds (very bad,but better than Bmax IDE). I was
able to change the behaviour of the highlighter to just highlight the current visible region of the text. which increased the loading time to 10% of the previous. but this had some issues with the scrollbars, as the jump repeadly from beginning to the end. So not a good solution.
@Vertex: At first he only needs a Tokenizer (a simplier Form of a Lexer)
For Example:
You have the delimiters " ( , ) :
and your text to analyse is :
MyType:String = GetString("Hello")
this will return this tokens:
MyType -> : ->Stirng etc.
this tokens you could save with its position and then highlight them if needed. The only thing you have to do is to check if a Token is in the range of "" (in this case Hello ). More complicated is the adding of multirem support.
Cheers, klepto2
a highlighter with a good speed.(espacially in Win32) Thats because of the richedit control, which is used. There are several tweaks for this, but mostly they are already implemented in BMax.
I have tried a highlighter by myself, and finally comes to the conclusion that it isn't worth the time.
My Highlighter was able to parse a text of around 150kb in nearly 12 seconds (very bad,but better than Bmax IDE). I was
able to change the behaviour of the highlighter to just highlight the current visible region of the text. which increased the loading time to 10% of the previous. but this had some issues with the scrollbars, as the jump repeadly from beginning to the end. So not a good solution.
@Vertex: At first he only needs a Tokenizer (a simplier Form of a Lexer)
For Example:
You have the delimiters " ( , ) :
and your text to analyse is :
MyType:String = GetString("Hello")
this will return this tokens:
MyType -> : ->Stirng etc.
this tokens you could save with its position and then highlight them if needed. The only thing you have to do is to check if a Token is in the range of "" (in this case Hello ). More complicated is the adding of multirem support.
Cheers, klepto2