From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Richard F Weber" To: sourcenav@sourceware.cygnus.com Subject: New Parser/highlighter howto Date: Mon, 02 Apr 2001 10:59:00 -0000 Message-id: <3AC8BE00.4030700@link.com> X-SW-Source: 2001-q2/msg00004.html Jason Andrews wrote: > Richard, > > Good questions, I had the same ones when I created my own > Verilog parser. > >> 1) How does the color highlighter exactly work for SN? Does it use the >> parser to identify what is a comment, what is a function, etc? Or do I >> have to code the syntax checking in separately (ala VIM) > > > The colors are not at all related to the parser. > You have to hook into snavigator/hyper/highlight.c and create > your own flex .l file to specify what keywords to highlight. > I used ch_high.l as a template. > > You also have to find and edit sninit.tcl to turn it on, this was the trick > for me to get it working. Hey, that was easy. Now my ada code is color coded. But I do have to ask why other languages aren't included for color-coding. I mean adding support was _really_ easy (unless I really messed it up). But this does raise another question below: > >> 2) Testing parser offline. Is there a way to test the parser offline to >> make sure the database is getting what I think it's getting? > > > Create a file with the list of files you want to parse and feed this > to your parser. My verilog parser is named snvp so I run > > % snvp -y files.f -p /bin/more > > Now I can see what goes into the database and I can also debug > easier using gdb Thanks. Now I can see the first line going into the DB, but it decides to stop parsing after that line. I'm sure I'm just doing something stupid though. After perusing through the lists, I saw that there is plans to have a new system to dynamically load the highlighters(ala .so's & .dll's). So my question now is: 1) How is the new system going to be different with regards to the highlighter. I wouldn't imagine too different, but... 2) How is the new system going to be different with regards to the parser. I'd hate to have to dump a lot of time into working on a parser/highlighter if the syntax is just going to change in a few months (that is when v5.0 is getting released. right?) Thanks for the help --Rich