Page 1 of 2
Tutorial: creating new lexer
Posted: 05.07.2013 17:04
by Alexey
Tutorials are in the [CudaText]/readme folder as ODT files.
(OpenOffice or Windows 7 WordPad).
LexerConfig.odt
TutorialLexer1.odt
TutorialLexer2.odt
TutorialLexer3.odt
TutorialLexer4.odt
TutorialLexerLig.odt
Posted: 05.07.2013 17:26
by Stefan
Whoa, this project is getting under way in true Alex-speed. Good, I am with you guys. How does this work out, format-wise, what am I supposed to do? Never been to any of these sharing portals google what-not platforms. Do we wait for Alex to post something there and then comment on it? Re-phrase it? Carry out little tasks and upload our screenshots?
Posted: 07.07.2013 08:59
by Stefan
Well done, Alex.
Right choice to use the tutorial format - it's better suited for complex things like lexers, making sure we're synced to the same actual settings.
Had to cope with some minor confusion, but overall I got a good kick-off start - thanks. For me it was important to see the connecting chain from RegEx via Parsers to Tokens. Finally I understand why I need tokens in the first place.
Seems like RegEx is really a central linchpin in this whole lexer concept. Need to boost my RegEx skills - and will translate the RegEx help topic along the way. And also the tutorial ...
Looking forward to the next episode.
Posted: 07.07.2013 10:44
by Alexey
Thank. The next one may be about "Rules" tab. thing i missed yet. maybe later- about "Grammar"
Posted: 10.07.2013 18:48
by Shadeclan
Can you explain to me what exactly is a token? Is it a type of language construct? Can I define different language constructs, such as variables, operators, logic syntax, etc as tokens?
What is the purpose of tokens? Is it to make parsing easier somehow?
Posted: 10.07.2013 18:52
by Alexey
Token is a minimal parsed element. E.g. dot, comma, equal, word, number, complex symbol like := or ==.
Ye, define as much of em as u wish. but too much of em will slow down lexer ...
Posted: 10.07.2013 19:09
by Shadeclan
I tried to create a style in the style tab but it doesn't let me change the name of the style - it just says "style 1". Do I have to change the name of the style somewhere else?
Posted: 10.07.2013 19:18
by Alexey
Use an edit field below the styles listbox
Posted: 15.07.2013 17:05
by Shadeclan
Found it! It was a bit subtle, though. The borders of the text box are difficult to see and it is positioned between the list and a blank area underneath the list. An unfortunate positioning - the eye tends to skip over it.
You might want to move the text box to the top of the list and enhance the borders or do away with it completely and allow editing directly in the list.
Posted: 15.07.2013 18:24
by Stefan
Shadeclan wrote:
An unfortunate positioning - the eye tends to skip over it.
I agree. Had the same problem, took me a few attempts to figure it out.
I also think the focus should stay in the list or edit-box when pressing Enter, and not trigger the overall OK button at the bottom.