cke: The syntax files

Nameversiondate
cke0.21 and latersseptember 5, 2006

1766 Visitas
last update agoust, 9 2006

A syntax file has a very simple syntax. It is composed of definitions of the form name = definition, where the possible names are described in the table bellow:
variablevaluespurpose
1,2,...,9 {[["word"],...]} The definition of each of this variables is followed by curly braces which contains a list of comma separated strings, which constitute the words to be highlithed using the corresponding color. An example is
1 = {"if","else","for","do","break",
     "case","char","const","int",...}
2 = {"#include","#define","#if",
     "#else","#endif",...}
ignorecase 0 or 1 If 1, instructs the program to ignore the case of the worlds in order to highlight them. If 0 or missing, only exact matches are highlighted.
mlinecommentbegin
mlinecommentend
strings Strings that begin and end multiline comments, for example "/*" and "*/". As in C syntax there are no nesting of multiline comments.
singlelinecomment string String that begins a single line comment. All the remaining of the line will be highlighted with the "comment" color.
stringbegin
stringend
strings Strings that begin and end strings, for example ".
stringbegin2
stringend2
strings Strings that begin and end strings, for example '.
stringescape string Character used within a string to avoid the next character to be used as part of the stringend string. In C it takes the value "\\".
wordfirstchars string Characters that can be at the beginning of a valid word in the corresponding language. In order to be highlighted, any word in the sets 1-9 has to begin with one of theese characters. For exemple in C it takes the value: "#_a-zA-Z0-9". If ignorecase=1 only uppercase chars need to be mentioned. If the character '-' is needed then it must be the first in the list, as in html: "-A-Z0-9".
wordchars string
emphbegin
emphend
strings Strings that begin and end emphasis. The intermediate text will be highlighted like normal text but the unhighlighted text will be colored with the emphasis color.
emphbegin2
emphend2
strings Another set of strings that begin and end emphasis. The intermediate text will be highlighted like normal text but the unhighlighted text will be colored with the emphasis color. This is useful for exemple in TeX where we eould have emphbegin = "$$", emphend = "$$", emphbegin2 = "$", emphend2 = "$"
syntaxemph 0 or 1 if 1 then syntax highlighting applies only to emphasized sections. This is used in HTML syntax with emphbegin = "<", emphend =">", and syntaxemph =1. If 0 or missing syntax highlighting applies to all the document.