customize highlighting

Discussion Forums discussion customize highlighting

This topic contains 0 voices and has 5 replies.

Viewing 6 posts - 1 through 6 (of 6 total)
Author Posts
Author Posts
August 1, 2006 at 3:56 pm #94



I want to use PN2 as a highlighting editor for my own configuration language.

Therefor I have to define my own keywords; comments ars c-like. I tried to use a customized copy of “vhdl.schemedef” but had no success. Which lexer can I use or must I write my own one (seems to be to difficult for my claim)? How does “Customscheme.lexer” work?

This is an short example of my configuration language:

javisWindows.UserScreen [

name = "anyName";

// a comment

element = rovScreenElements.RovLabel [

textID = 123;



Thanks for your help.

August 2, 2006 at 9:08 am #15056

Key Master

Can you post your attempt at customising vhdl.schemedef? It should be more than capable of highlighting your language.


August 3, 2006 at 6:34 am #15057


Hello Simon,

this is my customized schemedef (Javis.schemedef):

<?xml version=”1.0″ ?>



<keyword-class name=”userScreen”>

javisWindows UserScreen name element


<keyword-class name=”rovLabel”>

rovScreenElements RovLabel textID



<schemedef name=”javis” title=”Javis” author=”Holger Weis” url=”; version=”1″

casesensitive=”false” braces=”{[]}”>


<stringtype id=”0″ start=”"” end=”"” multiline=”false” escape=”" />


<identifiers start=”[`a-zA-Z]” />


<line start=”//” />


<numbers start=”[0-9]” content=”[0-9]” />

<lexer name=”vhdl” />


<style name=”Default” key=”32″ />

<style name=”Line Comment” key=”1″ class=”comment” />

<!– <style name=”Block Comment” key=”2″ class=”comment” /> –>

<style name=”Identifier” key=”3″ />

<style name=”Number” key=”4″ class=”number” />

<style name=”Keywords” key=”5″ class=”keyword” />

<style name=”Keywords 2″ key=”6″ class=”keyword” fore=”f80000″ />

<style name=”String” key=”10″ class=”string” />

<style name=”Pre-Processor” key=”12″ class=”preprocessor” />

<style name=”Special Identifier” key=”13″ fore=”478698″ />



<keyword key=”0″ name=”Keywords” class=”userScreen”/>

<keyword key=”1″ name=”Keywords 2″ class=”rovLabel”/>




The keywords “name” and “element” are highlighted (probably known in vhdl), others not. A line-comment starting with “//” isn’t recognized, opposite to comments starting with “–”.

If we can solve this problem I’ve one more question: How do I configure block-comments like used in C++?


August 4, 2006 at 9:21 am #15058

Key Master

A couple of problems with this one:

When using the quotes symbol in XML attributes you need to use " – although perhaps you’ve done that and the forums software is converting them!

Next, the lexer name is vhdl which is why you’re seeing vhdl behaviour. Change the lexer line to look like this:

<lexer name=”javis”/>

Finally, the reason the keywords are not working is that you have casesensitive=”false” which requires all keywords to be specified in lowercase. If your keywords are case sensitive then you need to set casesensitive=”true” otherwise change all keywords to all lowercase.

August 4, 2006 at 10:29 am #15059


The quotes symbol seams to be a problem of the forums software (but your quoted string “javis” was correctly shown to me).

I changed the lexers name and it works. Additionally I changed the schemedef’s attribute casesensitive to true and also keywords with uppercase letters are highlighted correctly ==> no bug.

At last I need to know how to configure block-comments. If you still can tell me I’m really grateful.

August 7, 2006 at 1:10 pm #15060

Key Master

Comment blocks work like this:


<block start="/*" end="*/"/>


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.