Page 2 of 3
Posted: 24.03.2015 21:08
by senendds
Here you have the exported lexer and a dummy source example.
In your lexer you are using ENDCLASS to detect the end of a procedure, but that doesn't always work, because procedures can be outside classes.
I've tried something similar that I thought could work, that is: using the 'EndClass' rule in my lexer as the "Range end condition" for the 'Procedure' rule. That doesn't work either.
The tree view with your lexer is 'weird' because
is in fact a procedure call, not a class definition.
The lexer I've post, almost always work, the only problem is that I cannot collapse Procedures. And I afraid I don't get what 'Self closing range' really means.
Posted: 24.03.2015 22:19
by Alexey
added folded Procedure/Define. OK now??
added comment "* and text"
What to fix? example file.
http://sourceforge.net/projects/synwrit ... p/download
Posted: 25.03.2015 12:36
by Alexey
My file. I solved folding by usin "Close block at file end", even for procedure out of class this closes procedure at end
Posted: 01.04.2015 10:09
by senendds
I've updated the lexer with your suggestions. Thank you for them. I've seen that instead of reusing the EndClass rule to close the Procedures (as I had tried first) you have defined a new EndClass-2 rule to do that. I've renamed that rule to EndProcedure, to better reflect its role.
Beside that, I've added rules for the "do case" blocks:
Code: Select all
do case some-expression
case 1 ...
case 2 ...
otherwise...
endcase
and "do.. until" blocks:
I've added support for the "else" "elseif" constructs, with proper collapsing behavior.
I've added a rule for "DEFINE" statements (which had nothing to do with Procedures, a define statement is the old way of constructing objects,that the visual editor of forms uses).
I've added a 'Properties' rule as an special case of 'Keywords' that list properties in classes predefined in the language.
And finally, I've added some token types and parsers to better deal with some cases (for instance, to distinguish between the "do case" and the "case" expressions in the example above).
Posted: 01.04.2015 15:10
by Alexey
note: (next update). Add name to NOTES tab of lexr. Not to lexer name (dbase.3.senen)
>>>Author: senen (email@)
Posted: 01.04.2015 15:18
by Alexey
\:[a-z]+\:
Name cannot have 1..9?
[a-z_0-9]+
same as \w+
close?\s+proc.*
better at end "\w*" , not .* (. is any)
appe(nd?)?\x20+blank
better at end "\b" so "blankname" is not ok
Posted: 01.04.2015 15:25
by Alexey
"define"-No end rule; u can put "define" to "proc" rule (proc rule finds procedure and define);
or can set "Initial closed" for it
Posted: 02.04.2015 11:57
by senendds
Alexey wrote:note: (next update). Add name to NOTES tab of lexr. Not to lexer name (dbase.3.senen)
>>>Author: senen (email@)
That was only to distinguish your lexer from mine while doing my tests. I didn't intend to distribute that...
Posted: 02.04.2015 13:14
by senendds
Alexey wrote:\:[a-z]+\:
Name cannot have 1..9?
If you mean in 'Database' parser, maybe it can. I haven't found any information regarding which characters are allowed there so we are using only alpha.
Alexey wrote:
[a-z_0-9]+
same as \w+
Ok.
Alexey wrote:
close?\s+proc.*
better at end "\w*" , not .* (. is any)
It can be any character, except new line.
Alexey wrote:
appe(nd?)?\x20+blank
better at end "\b" so "blankname" is not ok
I've removed the parser and the rule. There is not real use for it.
Posted: 02.04.2015 18:35
by Alexey
Now at AddonManager- tks