Page 1 of 1

Lola-2 Lexer Grammar Rules Help

Posted: 28.01.2016 22:25
by captbill
Hi Alexey,
I am trying learn how to use the 'grammar rules' for a lexer for Lola-2. Lola-2 is an Oberon based Verilog code generator.

Here is the lexer file:
https://github.com/billbuzzell/PRJ_Ober ... a-2exp.zip

Can you take a look? I can't seem to locate where my problem is here:

Code: Select all

InputType = (IN|OUT|INOUT)
DataType = (BIT|BYTE|WORD)

InheritedList = '(' IdentList ')';
IdentList = InputType <Identifier> ':' DataType? ';';

TOPModuleDecl = 'MODULE' <Identifier> InheritedList ';';  
TMODULE = <Identifier> ':=' 'MODULE' InheritedList '^;' ;

Posted: 28.01.2016 22:59
by Alexey
first, replace IN|OUT to 'IN'|'OUT'. 2nd, missed ; at lineends. 3rd, missed end-rule for begin-rule.

Posted: 29.01.2016 16:52
by captbill
I like the idea of having everything in one place with the 'grammar rules', unfortunately it uses some non-standard regex notations. What I have decided is to use it just for notes, for now, and build it up, piece by piece in the typical fashion of the SynWrite 'customize lexer' dialogs. Seems to work well.

Here is my current work with Lola-2:
https://github.com/billbuzzell/PRJ_Ober ... Lola-2.zip

I am learning slowly but surely. It is a very tricky skill, it seems. You have done a fine job with the lexer builder of SynWrite. Much better than trying to code from scratch a lexer for SynEdit by hand.

Regards,
Bill

Posted: 19.09.2016 20:10
by Alexey
Hey Bill
What is the state of Lola-2 work? how is it finished, or not.

UPD:
now I took your 2 lexers. PICL and Lola. and finished em. I think so at last. Folding is ok, even from "module NN" to "end NN". deleted 2-3 styles, 2-3 rules. added style "types" for types of langs (bool-int-...). deleted crap "proc[]" and "proc()" rules.
Take all in AddonManager

Posted: 23.09.2016 04:53
by captbill
Excellent. Thanks, Alexey. I will now try them out. Sorry for delay. I missed the e-mail notification.

Posted: 23.09.2016 15:54
by Alexey
I welcome suggestions for them

Posted: 24.09.2016 00:19
by captbill
Alexey wrote:I welcome suggestions for them
Had a quick look at them and they seem good. I did notice a few issues with the color highlighting. Perhaps it's best to have no color highlighting and let that be user's choice to add, you think? Would also like to see the Oberon lexer with a nice tree view like the Lola-2 lexer.

Posted: 24.09.2016 00:50
by Alexey
>no color highlighting
Default must be like eg C++/Go, and u can change colors in Lexer Prop dlg

Oberon: pls make topic at github. post some examples for tree. https://github.com/Alexey-T/SynWrite

Posted: 24.09.2016 01:49
by captbill
Oh thanks, but I mean I would fix the Oberon treeview. It should not be hard. I will work on it shortly.

What I may need some help with is a "save file to Oberon" plugin/dialog for the Oberon emulator that I may make a topic on.

Posted: 24.09.2016 01:57
by Alexey
Plugin can make Open or Save dlg. it is function dlg_file in Cudatext+Synwrite https://sourceforge.net/p/synwrite/wiki ... %20dialog/