public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* syntax highlighting
@ 2000-10-11  6:54 Jason Andrews
  2000-10-11 11:23 ` Ben Elliston
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Andrews @ 2000-10-11  6:54 UTC (permalink / raw)
  To: sourcenav

Hi,

I have integrated a new parser with sorucenav and I am looking for
documentation on
syntax highlighting.

Any advice on where to find it or which parser to look at as an example
is appreciated.

Thanks,
Jason


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: syntax highlighting
  2000-10-11  6:54 syntax highlighting Jason Andrews
@ 2000-10-11 11:23 ` Ben Elliston
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Elliston @ 2000-10-11 11:23 UTC (permalink / raw)
  To: Jason Andrews; +Cc: sourcenav

Hi,

   I have integrated a new parser with sorucenav and I am looking for
   documentation on syntax highlighting.

The syntax highlighters have specific hooks into the `hyper'
interpreter.  For an example, go to the `hyper' source directory and grep
for `ch_highlight' in highlight.c.

The idea is that an init function is called once to initialise things and
then an entry point is called periodically whenever S-N's editor wants a
memory buffer (usually the file currently loaded into the editor) to be
scanned for highlighting information.

Such scanners are usually written using Flex.

   Any advice on where to find it or which parser to look at as an
   example is appreciated.

Take a look at hyper/*.l.

Yes, it's not as clean as it ought to be.  Highlighters should be loaded
into the interpreter dynamically.

Cheers, Ben

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: syntax highlighting
  2000-10-13 17:27 ` Ben Elliston
@ 2000-10-14 18:13   ` Jason Andrews
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Andrews @ 2000-10-14 18:13 UTC (permalink / raw)
  To: Ben Elliston, sourcenav

Ben Elliston wrote:

>    Can you explain the relationship between what is in the
>    share/etc/sn_prop.cfg file specifically the -high_cmd argument for
>    adding parsers and the info you gave me below? I have entered my new
>    parser in the -brow_cmd and also the -high_cmd
>
> The -high_cmd is no longer applicable.  In fact, it needs to be
> removed.  Once upon a time, syntax highlighting was done by an external
> program.
>
>    I added hooks to the highlight.c stuff you mentioned below but this
>    code is never called for my parser's language.  I guess I don't see
>    the connection between my flex based parser and these other flex files
>    for syntax highlighting. Maybe I need something else for the -high_cmd
>    field.
>
> Can you post a diff for your changes to highlight.c?
>
> Ben

Thanks, but I got it. The key was to edit sninit.tcl and add my language to
the list of those with built-in-highlighting.  Now the functions in
highlight.c
are called as you described.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: syntax highlighting
  2000-10-13 15:31 Jason Andrews
@ 2000-10-13 17:27 ` Ben Elliston
  2000-10-14 18:13   ` Jason Andrews
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Elliston @ 2000-10-13 17:27 UTC (permalink / raw)
  To: Jason Andrews; +Cc: sourcenav

   Can you explain the relationship between what is in the
   share/etc/sn_prop.cfg file specifically the -high_cmd argument for
   adding parsers and the info you gave me below? I have entered my new
   parser in the -brow_cmd and also the -high_cmd

The -high_cmd is no longer applicable.  In fact, it needs to be
removed.  Once upon a time, syntax highlighting was done by an external
program.

   I added hooks to the highlight.c stuff you mentioned below but this
   code is never called for my parser's language.  I guess I don't see
   the connection between my flex based parser and these other flex files
   for syntax highlighting. Maybe I need something else for the -high_cmd
   field.

Can you post a diff for your changes to highlight.c?

Ben

^ permalink raw reply	[flat|nested] 5+ messages in thread

* syntax highlighting
@ 2000-10-13 15:31 Jason Andrews
  2000-10-13 17:27 ` Ben Elliston
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Andrews @ 2000-10-13 15:31 UTC (permalink / raw)
  To: sourcenav, bje

Can you explain the relationship between what is in the
share/etc/sn_prop.cfg file
specifically the -high_cmd argument for adding parsers and the info you
gave me below?
I have entered my new parser in the -brow_cmd and also the -high_cmd

I added hooks to the highlight.c  stuff you mentioned below but this
code is never
called for my parser's language.  I guess I don't see the connection
between my
flex based parser and these other flex files for syntax highlighting.
Maybe I need
something else for the -high_cmd field.

Any help is much appreciated.

Jason

--------------

Hi,

   I have integrated a new parser with sorucenav and I am looking for
   documentation on syntax highlighting.

The syntax highlighters have specific hooks into the `hyper'
interpreter.  For an example, go to the `hyper' source directory and
grep
for `ch_highlight' in highlight.c.

The idea is that an init function is called once to initialise things
and
then an entry point is called periodically whenever S-N's editor wants a

memory buffer (usually the file currently loaded into the editor) to be
scanned for highlighting information.

Such scanners are usually written using Flex.

   Any advice on where to find it or which parser to look at as an
   example is appreciated.

Take a look at hyper/*.l.

Yes, it's not as clean as it ought to be.  Highlighters should be loaded

into the interpreter dynamically.

Cheers, Ben

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-10-14 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-11  6:54 syntax highlighting Jason Andrews
2000-10-11 11:23 ` Ben Elliston
2000-10-13 15:31 Jason Andrews
2000-10-13 17:27 ` Ben Elliston
2000-10-14 18:13   ` Jason Andrews

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).