Discussion:
Beginner's Tutorial for Lexing and Folding
Andreas Tscharner
2014-02-16 17:15:29 UTC
Permalink
Hello World,

When I started using Scintilla I had a very hard time to figure out how
to implement a lexer for a new language. To make things easier for other
beginners I've written a little tutorial.

But English is not my native language. I suppose I have quite a few
funny (completely wrong) sentences in the tutorial. So I'd really
appreciate it if you could read it and send me some feedback (e-mail,
patches, open a new issue in the tracker, ...).

Once its quality is acceptable I'll ask Neil if he could link it from
the Scintilla documentation page.

https://bitbucket.org/StarFire/scintilla-doc/downloads/Scintilla-var'aq-Tutorial.pdf
https://bitbucket.org/StarFire/scintilla-doc/downloads

Thank you very much!
Andreas
--
Andreas Tscharner ***@gmail.com
------------------------------------------------------------------------
Der entscheidende Vorteil eines Chats gegenueber einem normalen Telefon-
anruf ist der, dass ersterer langsamer geht und mehr kostet (fuer den
lebenswichtigen Austausch von Informationen wie "hya folks", "C U
l8er" und ":-)") ... Aus Murphy's Computergesetzen
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2014-02-16 21:54:23 UTC
Permalink
Since you are only implementing ILexer and not ILexerWithSubStyles, the Version method should return lvOriginal. If you return 1, this is interpreted as lvSubStyles so Scintilla may call methods not in ILexer and crash.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Andreas Tscharner
2014-02-17 22:10:12 UTC
Permalink
Post by Neil Hodgson
Since you are only implementing ILexer and not ILexerWithSubStyles,
the Version method should return lvOriginal. If you return 1, this is
interpreted as lvSubStyles so Scintilla may call methods not in
ILexer and crash.
Thank you Neil, I've corrected this mistake and uploaded an updated
version of the tutorial.

I am quite sure there is still more to fix in the tutorial...

https://bitbucket.org/StarFire/scintilla-doc/downloads

TIA and best regards
Andreas
--
Andreas Tscharner ***@gmail.com
------------------------------------------------------------------------
Der entscheidende Vorteil eines Chats gegenueber einem normalen Telefon-
anruf ist der, dass ersterer langsamer geht und mehr kostet (fuer den
lebenswichtigen Austausch von Informationen wie "hya folks", "C U
l8er" und ":-)") ... Aus Murphy's Computergesetzen
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2014-02-18 01:32:01 UTC
Permalink
Thank you Neil, I've corrected this mistake and uploaded an updated version of the tutorial.
Committed some more explanation for the Version method to Hg.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2014-02-22 00:47:51 UTC
Permalink
I couldn't find an easy way to download the lexer code. Copying it from the PDF munges line ends and adds page numbers so is difficult to examine.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Andreas Tscharner
2014-02-24 22:17:24 UTC
Permalink
Hello Neil,
Post by Neil Hodgson
I couldn't find an easy way to download the lexer code. Copying it
from the PDF munges line ends and adds page numbers so is difficult
to examine.
I have uploaded the lexer code next to the tutorial PDF:

https://bitbucket.org/StarFire/scintilla-doc/downloads

Best regards
Andreas
--
Andreas Tscharner ***@gmail.com
------------------------------------------------------------------------
Der entscheidende Vorteil eines Chats gegenueber einem normalen Telefon-
anruf ist der, dass ersterer langsamer geht und mehr kostet (fuer den
lebenswichtigen Austausch von Informationen wie "hya folks", "C U
l8er" und ":-)") ... Aus Murphy's Computergesetzen
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Chris Gillard
2014-02-27 12:01:54 UTC
Permalink
Hi Andreas,

Your document is very good timing for me and has saved me hours of reading,
quessing and 'trial and error' coding.

I have written a more complete thank you in my 'Beginner' thread just above
this one.

I may have future questions for you I'm afraid but I will try not to make
it too many.

Good luck with var'aq and the Klingons!

Thank you.

Chris
Post by Andreas Tscharner
Hello Neil,
Post by Neil Hodgson
I couldn't find an easy way to download the lexer code. Copying it
from the PDF munges line ends and adds page numbers so is difficult
to examine.
https://bitbucket.org/StarFire/scintilla-doc/downloads
Best regards
Andreas
--
------------------------------------------------------------------------
Der entscheidende Vorteil eines Chats gegenueber einem normalen Telefon-
anruf ist der, dass ersterer langsamer geht und mehr kostet (fuer den
lebenswichtigen Austausch von Informationen wie "hya folks", "C U
l8er" und ":-)") ... Aus Murphy's Computergesetzen
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...