Re: [gtk-list] Re: Syntax Highlighting Text Widgets

>Er...the c-scanner lib is generated by the test application on
>runtime.  The editor doesn't require it as such, it is capable of
>generating what it needs.  And, as mentioned above, you can also
>simply link scanners in statically.

Ah, I see.  That makes more sense than the way I was reading it.

>We need some kind of lexical analysis of the text to do highlighting.
>Earlier versions of gtkeditor used the regex library from emacs to
>translate regexps into scanners.  With this approach you need to link
>in this library, but you get rid of creating dynamic libraries and
>loading these.  With the current approach we use flex.  Here we get
>rid of the regex library, but we need to handle dynamic libraries.

I understand.  That's where my problem lies.  I have to support this software
on several platforms, and having to troubleshoot flex and dynamic libraries on
Solaris or HPUX is not a job that I'm up to.  :)

>can be used.  So you can implement such a guy anyway you want and
>you're set for highlighting.  We create a lexer using flex, and load
>it as a dynamic library.  This is just one solution.  Other solutions
>would be to implement scanners through different regex libraries or
>code them by hand.  After you have installed a scanner, the
>highlighting is take care of by the gtkeditor code.

I guess under my rather restrictive conditions coding one by hand is the only
sure-fire way to guarentee that it would work everywhere.  And since my target
language isn't mainstream, the chances of pilfering one from another project
are slim.  I'll see what I can do with the autogenerated c-scanner.c.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]