The latest version : 5.4.3

 

 

User Language Define System Manual

PDF version

The first question you'll ask is : What is User Language Define System for?

Well, for some reasons that some languages are not supported by Notepad++, User Language Define System can help you out in this case. This system allows user to define his own language : not only the syntax highlighting keywords definition, but also the syntax folding keywords definition, comment keywords definition and the operators definition.

Here is an example, a user define language named My Language :

As you can see, the syntax highlighting and the syntax folding are applied on the document userDefineLang.myl (on the left) thanks to the definition in the User Define Language dialog (on the right).

 

1. Overview of User Define Language dialog

It consists of 2 parts : global functionalities part and definition part.

The global functionalities are for the global operations : such as choosing / creating / renaming / removing a user define language. Whereas the definition part is to define the folder symbols / keywords / comments symbols / operators for a chosen user define language.

A default user define language is named User Define Language.

You can define your keywords, folder block and comment under the default User Define Language. In order to take effect, you have to define your current document as User Define Language document by clicking :

However, all the definition you made will be temporary under the User Define Language (ie. they will disappear in the next session). If you want to keep you definition, you have to save it by clicking Save as... button. Once you give it a name and save it, you can use it or modify it afterward.

You can also associate one file extension with your defined language - so every time you open the files with the extension that you associated, the highlighting of your defined language will be applied on the document automatically.

Of course, you can rename your language, use it as a model (Save as...), or remove it.

 

2. Folder & Default panel

This panel allows users to define the default style, folder keywords and folder styles.

The default style is all non-defined styles (i.e. all the non-defined words).

The folder definition consists of two parts : the open folder definition and the close folder definition. They should work together as a pair.

In the above figure, two blocks are defined by the keywords : blockBegin, blockEnd, if and fi. With the keywords defined, User Language Define System is able to form the block(s) that user can fold or unfold it. Notice that if you define several keywords in the open folder definition or/and in the close folder definition, all the close folder symbols will close whatever open folder symbol. In the given example, blockBegin and fi may form a block if you treat them as a pair.

 

3. Keywords lists panel

There are 4 groups of keywords : that means 4 styles are available for general use.

Anyway, it's not an obligation to use all the 4 groups.

 

4. Comment & Numbers panel

In this panel, user can define the style of number and the style of comment (as well the comment symbol definition) .

There're 2 kinds of comment that you can define in the User Language Define System - comment line and comment block. Different from the other styles, the comment style makes the style not only on the defined symbols, but also on the comment block or the comment line.

 

5. Operators Panel

There're two rules for User Language Define System that you should keep in mind :

  1. An elementary unit (a token) is always terminated by a white space, a TAB symbol ('\t'), a new line symbols ('\n') or an operator that you defined.
  2. All the symbol characters are a part of elementary unit (a token), unless they are defined as the operators.

With the 2 principle points we can understand easily the following example :

The token "INTEGER" is recognized thanks to keywords definition (i.e. "INTEGER" is in the keywords lists). If '(' is not defined as the operator, the second "INTEGER" won't be recognized, because "(INTEGER" will be treated as an unit (or a token), and it is not in the keywords lists.