Discussion:
lexers written in lua
Sergio Spina
2012-09-22 21:25:55 UTC
Permalink
Hallo to all of you.

I'm trying to write a lexer in lua, according to the exampe in this page<http://www.scintilla.org/ScriptLexer.html>,
but it seems to be a difficult task.

Is there someone who has written a lexer in lua? Can he/she post the code?
What is the name of the file? In what directory was saved the file with the
lexer? Can he/she post the lines in the .properties file regarding the
lexer?

Many thank for every help.
--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To view this discussion on the web visit https://groups.google.com/d/msg/scite-interest/-/006CzGhW3bMJ.
To post to this group, send email to scite-***@googlegroups.com.
To unsubscribe from this group, send email to scite-interest+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.
Kagehi
2012-09-23 06:37:03 UTC
Permalink
Umm. I did one for the language in Second Life, LSL, but probably not the
same way. I used something called Scintillua:

http://foicica.com/scintillua/

I think what it does is, basically, define "preset" lexer functions, and
effects, for doing the basics, then allows you to "extend" that, using the
same sort of Lua stuff that you are trying to mess with. This means that,
as long as most of your language definitions don't require anything really
odd, its fairly easy to set up. The instructions are.. a bit inspecific to
follow, which was the problem I ran into. Certain things are "required",
for example:

{ 'any_char', l.any_char }

which is in the M._rules. This has the effect of "turning off" what ever
highlighting was already in effect. I discovered, without it, it would
react to the first thing it found, but then all other code would fail to
highlight. The documentation also talks about existing style definitions. I
ended up adding what I needed manually for those, but otherwise you have to
add a line to import them. Obvious, in retrospect, but not so obvious if
you are hacking the thing together, and making assumptions. In any case, I
posts the lexer I made using it in the thread, and it might be a lot easier
to use scintallua, than to start completely from scratch, especially since
I have no idea how much "pre-work" is included, which you would have to do
yourself, to make lua do anything at all, without the stuff the guy already
did:

https://groups.google.com/forum/#!topic/scite-interest/vPh1OhBnreU
Post by Sergio Spina
Hallo to all of you.
I'm trying to write a lexer in lua, according to the exampe in this page<http://www.scintilla.org/ScriptLexer.html>,
but it seems to be a difficult task.
Is there someone who has written a lexer in lua? Can he/she post the code?
What is the name of the file? In what directory was saved the file with the
lexer? Can he/she post the lines in the .properties file regarding the
lexer?
Many thank for every help.
--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To view this discussion on the web visit https://groups.google.com/d/msg/scite-interest/-/jontjHy4sCkJ.
To post to this group, send email to scite-***@googlegroups.com.
To unsubscribe from this group, send email to scite-interest+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.
Philippe Lhoste
2012-09-24 08:15:39 UTC
Permalink
Post by Sergio Spina
I'm trying to write a lexer in lua, according to the exampe in this page
<http://www.scintilla.org/ScriptLexer.html>, but it seems to be a difficult task.
Is there someone who has written a lexer in lua? Can he/she post the code? What is the
name of the file? In what directory was saved the file with the lexer? Can he/she post the
lines in the .properties file regarding the lexer?
If you search the mailing list around the time the feature was introduced (last year?),
you can find some (simple) examples.

I will make another more detailed answer later...
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-***@googlegroups.com.
To unsubscribe from this group, send email to scite-interest+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.
Jingcheng Zhang
2012-09-25 05:53:21 UTC
Permalink
Currently there is an OnStyle() handler defined.
When will OnFold() handler added?

Thanks.
Post by Philippe Lhoste
Post by Sergio Spina
I'm trying to write a lexer in lua, according to the exampe in this page
<http://www.scintilla.org/ScriptLexer.html>, but it seems to be a difficult task.
Is there someone who has written a lexer in lua? Can he/she post the code? What is the
name of the file? In what directory was saved the file with the lexer? Can
he/she post the
lines in the .properties file regarding the lexer?
If you search the mailing list around the time the feature was introduced
(last year?), you can find some (simple) examples.
I will make another more detailed answer later...
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
--
You received this message because you are subscribed to the Google Groups
"scite-interest" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/scite-interest?hl=en.
--
Best regards,
Jingcheng Zhang
Beijing, P.R.China
--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-***@googlegroups.com.
To unsubscribe from this group, send email to scite-interest+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.
Loading...