Related articles |
---|
Syntax Highlighting and Lexical Analysis Dominic@tootedom.freeserve.co.uk (Dominic Tootell) (1999-09-11) |
Re: Syntax Highlighting and Lexical Analysis jacob.navia@wanadoo.fr (jacob.navia) (1999-09-16) |
Re: Syntax Highlighting and Lexical Analysis webid@asi.fr (Armel) (1999-09-16) |
Re: Syntax Highlighting and Lexical Analysis Marko.Makela@HUT.FI (Marko =?ISO-8859-1?Q?M=E4kel=E4?=) (1999-09-20) |
Re: Syntax Highlighting and Lexical Analysis maratb@CS.Berkeley.EDU (Marat Boshernitsan) (1999-09-20) |
Re: Syntax Highlighting and Lexical Analysis qjackson@wave.home.com (Quinn Tyler Jackson) (1999-10-04) |
From: | "jacob.navia" <jacob.navia@wanadoo.fr> |
Newsgroups: | comp.compilers |
Date: | 16 Sep 1999 01:54:26 -0400 |
Organization: | Wanadoo, l'internet avec France Telecom |
References: | 99-09-041 |
Keywords: | parse, tools, comment |
>I have to provide syntax highlighting of the input file. At the moment I
>just want a first open syntax highlighter or on command of the user, not an
>interactive one (I have no idea how they work yet, let alone an interactive
>one). ...
>[It is my impression that most of these highlighters do regular expression
>pattern matching rather than trying to parse the whole file. -John]
In the IDE of lcc-win32 the syntax highliting is very simple:
1) read the file
2) find all the words in it after stripping off comments and strings.
3) If a word is a keyword print it in the keyword color.
For commentaries this is slightly more complicated since all this is done
real time.
1) Find the last commentary before the first visible line in the screen.
2) Color commentaries starting with it.
I do NO reg expression match, since I want to ensure that
1) 'int' is colored but 'lint' is not!
2) lcc-win32's IDE is multi language. Fortran keywords are case
insensistive.
3) Finding comments with regular expressions???
The Linux IDE 'wipeout' does syntax highliting with RE, and it shows
why this will never work. The thing is so slow that even in a Pentium
200 it can't keep up with typing!
[That just shows that someone doesn't know how to implement REs. We did
RE-based stuff in a window editor on the PDP-10, laughably slow by modern
standards, and performance was fine. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.