Hello,
I have written a template for creating a new language files. It contains all the currently available tags so one can just open it and edit it to his needs without constantly referring to the help file.
I hope that someone might find it useful.
I would welcome your comments to this template. Especially if all my statements there are true, if it is understandable and if I have not missed anything important.
Regards, Dalibor
Updated on 09.01.2007 according to Mofi's comments
Updated on 09.01.2007 - spell checked and reformatted to 80 chars/line
Updated on 29.12.2007 by Mofi - completely revised and reformatted
Updated on 02.08.2009 by Mofi - added new facts about max. length of function strings and usage of Perl function strings
Updated on 31.03.2012 by Mofi - added information about hierarchical function strings which can be used since UE v16.00 and UES v10.00
Updated on 31.03.2012 by Mofi - added information about usage of up to 20 color groups with UE v17.00 and UES v11.00 or any later
Updated on 29.05.2012 by Mofi - added EnableCFByIndent introduced with UE v18.10 and UES v12.10
Attention: You can copy the template below to a new ASCII DOS file or to an existing wordfile and use it to create a language definition. But you have to delete all lines starting with # because they are just comments and comments are not possible in a wordfile. You also have to replace tab by a real horizontal tab character in the line starting with /Delimiters =. Wordfiles must have DOS line endings (carriage return CR + linefeed LF). UNIX or MAC line endings as well as any Unicode encoding are not allowed.
# Template for creating a new language files
# Created by Dalibor Jelinek - 9.1.2007
# Revised by Mofi last time on 29.5.2012
#
# The wordfile keywords are case sensitive and therefore must be specified
# exactly as written here or in help of UltraEdit. It is also important
# that after a keyphrase the character sequence single space, equal sign,
# single space (" = ") follows before the string you want to assign to
# the declaration. For example Line Comment=// is not recognized
# by UE or UES because of the missing spaces.
#
# The whole wordfile can be up to 372 kB.
#
# Using tabs is not recommended, except in /Delimiters = .
#
# Every line starting with a single / followed by an unknown word is ignored
# by the syntax highlighting function. This could be used for line comments
# inside the wordfile, for example /cmt: at start of the line could be used
# for a comment line. But per definition comments are not possible in a
# wordfile and so such comments should not exist when mailing a wordfile
# to IDM for the public download area or when testing a language definition
# with Mofis SyntaxTools macros. Such "comments" might cause also problems
# in the future.
#
# You might want to rename your tweaked wordfile.txt or wordfile.uew to
# a different name (and adjust UltraEdit configuration accordingly) so it
# does not get overwritten when installing a newer version of UltraEdit.
# You might want to use a different extension than TXT (like UWE) in your
# wordfile to syntax highlight the wordfile too.
#
# The maximum length of Language Name and Color Group Name may be up to
# 24 characters long. Every name longer is truncated. In previous versions
# of UltraEdit the limit was 18 characters. A creator of a public wordfile
# should not exceed the first limit of 18 characters or at least make sure
# the first 18 characters produce a unique description for a color group
# within the language definition.
#
# All the information provided is valid to the date of writing
# and for UltraEdit v13.20a.
#
# Please post your comments here:
# http://www.ultraedit.com/forums/viewtopic.php?t=4124
# Language Definition Line
# The following declarations must be specified all on the first line
# of a language definition - the language definition line. It does
# not matter how long the line will become. Do not break the line.
/L20"Language Name" Line Comment = // Line Comment Alt = # File Extensions = ext
# /Ln - Language number (1-20); must be unique in wordfile.
# It must be right at the beginning of the line.
# Languages 1-13 are included with UltraEdit by default.
# "Language Name" - up to 24 characters; must immediately follow /Ln.
# UltraEdit prior v9.00 support only up to 10 languages in a wordfile.
# Language Markers
# AASM_LANG ASP_LANG C_LANG COBOL_LANG CSHARP_LANG CSS_LANG ECMA_LANG
# FORTRAN_LANG HTML_LANG JAVA_LANG JSCRIPT_LANG LATEX_LANG MASM_LANG
# MATLAB_LANG NASM_LANG PASCAL_LANG PERL_LANG PHP_LANG PLB_LANG
# PUREBASIC_LANG PYTHON_LANG SQL_LANG VB_LANG VBSCRIPT_LANG XML_LANG
# XSL_LANG
# Those markers are used to define the type of a language for correct
# highlighting of multiple languages in a single file (like PHP in HTML)
# and to apply built-in defaults for brace strings, fold strings, etc.
# Every language which might be embedded in another should be marked
# by its marker.
# With HTML_LANG and XML_LANG, FORTRAN_LANG and LATEX_LANG there is a
# special handling activated in UltraEdit and UEStudio according to the
# special requirements of these languages. See UE/UES help page about
# Syntax Highlighting for further details.
# Only one instance of every language marker is allowed in a wordfile!
# Multi-language highlighting (for HTML file types only) is supported
# since UltraEdit v11.00.
Nocase
# Defines that the language is not case sensitive. The keywords in the
# up to 8 color groups are then converted internally always to lowercase
# (important for auto-completion).
# Depending on the version of UltraEdit the Nocase declaration is also
# applied to ASCII letters in brace and fold strings making them internally
# always lowercase and the case of the brace and fold string letters in the
# file to highlight is not important anymore as without Nocase.
Line Comment = string
# String marking the rest of a line as a comment. Up to 5 characters
# long. A line comment declaration must exist to be able to use the
# Comment Add / Remove commands in menu Edit.
Line Comment Alt = string
# Alternative string marking the rest of a line as a comment. Up to
# 5 characters long. The comment color is also used for alternative
# line comments.
Line Comment Num = ncc
# Allows to define a line comment containing space(s). n is number of
# consecutive characters which defines a line comment. For example:
# Line Comment Num = 3# !
Line Comment Preceding Chars = [RegExp]
# Defines the valid characters which can appear left to a line comment.
# RegExp is regular expression in UltraEdit style. The default is
# that all characters left to a line comment string are valid. This
# definition is supported since UltraEdit v9.10.
Line Comment Preceding Chars Alt = [RegExp]
# Defines the valid characters which can appear left to an
# alternative line comment. See above for further details.
Line Comment Valid Columns = [i-j,k]
# Defines the valid columns where the line comment can appear. There can be
# up to 10 ranges defined. Depending on your version of UltraEdit the first
# column of a line has either the number 0 or 1. Best test your language
# definition once with 0-x and once with 1-x and use the version which
# works for your version of UE. The default is that all columns are valid.
# This definition is supported since UltraEdit v9.10.
Line Comment Valid Columns Alt = [i-j,k]
# Defines the valid columns where the alternative line comment
# can appear. See above for further details.
Block Comment On = string
Block Comment Off = string
# Strings that enclose a block comment. Up to 19 characters long (in older
# versions only up to 5 characters). A block comment on/off string cannot
# include a space character. /* and */ are default for files with extension
# C and CPP (can be overridden). If Block Comment On is defined but Block
# Comment Off is not defined, then it works like a third set of Line Comment.
Block Comment On Alt = string
Block Comment Off Alt = string
# Second set of strings enclosing a block comment. Up to 19 characters long
# (in older versions only up to 5 characters). If Block Comment On Alt is
# defined but Block Comment Off Alt is not defined, then it works like a
# third or fourth set of Line Comment. While Line Comment, Line Comment Alt
# and Block Comment On are highlighted with the Comments color, the alternate
# block comment has its own color setting. So if a language has 2 different
# line comments, but only 1 block comment, it is sometimes better to use
# Block Comment On Alt for the second line comment instead of using Line
# Comment Alt.
NestBlockComments
# UE v13.00 and UES v6.20 and later versions support nested block comments.
# UltraEdit/UEStudio by default will end any block comment whenever a single
# block comment end string is encountered. To instruct UltraEdit/UEStudio to
# explicitly match all block comment start strings with all block comment
# end strings, the nest block comment declaration may be specified.
Noquote
# Turns off the default recognition of characters in single quotes
# and double quotes as literal strings. Using this keyword means the
# language does not have strings or string highlighting is not wanted
# or is done with different methods (marker characters or substrings).
String Chars = cc
# Defines the characters enclosing the literal strings. 1 or 2 characters
# only. Default string characters are ' and ". Additionally if you have
# 2 characters for the strings defined (or using the defaults) and you wish
# to have a different color for each type of string, you may include one of
# the characters (i.e. the double quote) in one of the color groups in a
# line by itself. This will override the configurable color for the strings
# that are encapsulated by this character.
Escape Char = c
# Defines the escape character which allows the string character
# to be used inside a string.
String Literal Prefix = c
# UE v13.00 and UES v6.20 and later versions support the specification
# of the string literal format by specifying a string prefix character
# in the language definition line as required for example for C#.
EnableMLS
DisableMLS
# Enables/disables the support for multi-line string highlighting.
# EnableMLS - enables to correctly highlight strings spread over more
# lines (containing end-of-line character).
# DisableMLS - string highlighting is ended by the end of the line,
# even if the string closing character is missing.
# UltraEdit has defaults for multi-line string highlighting capability for
# many languages. Those keywords are to override the defaults behaviour.
# Multi-line string highlighting is supported since UltraEdit v11.00.
EnableSpellasYouType
# By default UE/UES will not perform "spell check as you type" on any
# syntax-highlighted files. To change this setting and allow "spell check
# as you type" for a syntax-highlighted file, add this keyword to the
# language definition line. Spell check while typing is supported since
# UltraEdit v13.00 respectively UEStudio v6.20.
EnableCFByIndent
# UE v18.10 and UES v12.10 and later versions support code folding based on
# indent level in addition to code folding based on fold strings. For Python
# files (*.py) code folding by indent is automatically enabled. For all
# other files respectively languages this keyword can be used in the first
# line to enable code folding by indent instead of code folding by fold
# strings. If EnableCFByIndent is present in first line, do not specify any
# fold strings as they are ignored. Read below about Code Folding
# using fold strings.
File Extensions = ext1 ext2 ...
# Defines to which extensions this language definition will be applied.
# The file extensions declaration must be the last one on the language
# definition line. It is not possible to use also "File Names = " on
# a language definition line which already has a file extensions list.
#
# File extensions must be specified without point. (The point is per
# definition by Microsoft not part of the file extension.) The file
# extensions are not case sensitive because on Windows operating
# systems every file system handles file names not case sensitive.
#
# Up to 97 bytes may follow the "File Extensions = " declaration.
# If a list of file extensions exceeding 97 bytes is specified here, they
# will not all be parsed.
#
# You can use * as a file extension to highlight all files not specified
# at any language definition (for example new files). Very important is
# that the * must be the last (most right) in the list of extensions.
#
# Since UltraEdit v12.20 and UEStudio v6.10 at "Configuration - Editor
# Display - Syntax Highlighting - Highlight new files as a language"
# can be specified to be used for new files and so this trick must not be
# used anymore for new files. But it can be still used for automatically
# selecting a syntax highlighting for all already saved files with not
# known file extension or name.
File Names = filename1.ext1 filename2.ext2 ...
# Defines to which file names this language file will be applied.
# The file names declaration must be the last one on the language
# definition line. It is not possible to use also "File Extensions = "
# on a language definition line which already has a file names list.
#
# The file names specified must include their extensions. File names with a
# space inside the file name cannot be specified because the space character
# is used as names delimiter in the wordfile. Quotes cannot be used for file
# names with a space character. The file names are not case sensitive
# (according to Windows standard).
#
# Up to 125 bytes may follow the "File Names = " declaration.
#
# When using a language definition with a file names declaration for a
# type of file where also a language definition with a file extensions
# declaration exist in the wordfile, for example to highlight special
# XML files based on their file names different to all other XML files
# highlighted based on file extension XML, it is important that the
# language definition with the file names declarations has a lower
# language number and is above the language definition with the
# file extension declaration.
#
# Syntax highlighted based on file names is supported since UE v10.00.
# All the keywords above must be on the first language definition line.
# ---------------------------------------------------------------------
# From here below every keyword is on its own line.
# Delimiters
/Delimiters = ! "tab$%&'()*+,-./:;<=>?@[\]^_{|}~
# Defines a list of delimiters used to determine where a keyword starts
# and finishes.
# "tab" must be replaced after copying from the browser window
# to the ASCII file by a real horizontal tab character.
#
# A character which is a delimiter may not be part of the keyword, with
# an exception of <, </ and > in HTML_LANG and XML_LANG which can
# be at start or end of a keyword.
# Since UE v10.00 it is allowed that a delimiter character
# is the start character of a word in the up to 8 color groups.
#
# The default delimiters are used if no delimiters are specified.
# Delimiters should contain always a SPACE and a TAB character.
# It is possible to add delimiter characters in various color
# groups to highlight them in different colors.
# Function Definition Strings
/Function String = "%[a-z]*)"
/Function String 1 = "%[a-z]+^(*^))"
/Function String 2 = "%/L[0-9]+"^(*^)"
/Function String 3 = "%^[*^]$"
/Function String 4 = "%^([a-z_0-9^[^]*]+^)[ ^t]+([^p*&:, ^t^[^]a-z_0-9.!]++)[~;]"
/Function String 5 = "%*^{Sub^}^{Function^}*("
# Strings in quotes are regular expressions in UltraEdit's style which
# allows to extract a function name from a line of code and display it
# in a Function List in UltraEdit.
# Up to 6 function strings might be defined.
# Use a tagged expression to display only a part of the line -
# enclose the function name in ^( and ^).
# The regular expression string inside the double quotes should not be
# longer than 119 characters. With UE v13.00 and UES v6.20 and later
# versions it can be also longer because this limit was abolished.
# UltraEdit prior v9.00 support only 3 function strings per language.
# UltraEdit prior v8.00 support only 1 function string per language.
# The regular expression search(es) are always executed not case sensitive.
# So the regular expressions [A-Za-z], [a-z] or [A-Z] match all 3 always
# all ASCII letters independent of the case. Therefore using A-Za-z in a
# character class definition [...] does not really make sense.
# The function string definitions as explained above can be used in a wordfile
# for any version of UltraEdit or UEStudio. But since UE v16.00 and UES v10.00
# an alternate set of function strings can be used because of enhancing the
# function list from a flat list to a hierarchical list by IDM. To define
# function strings for a hierarchical list, it is best to remove the lines
# starting with /Function String if already present and save the wordfile.
# Next either open Advanced - Configuration - Function List, select the
# language to modify and click on button Modify Groups. Alternatively and
# even better is to have a file open syntax highlighted by the wordfile to
# update or define the hierarchical function strings, open the Function List
# view if not already open, right click into the Function List view and left
# click on context menu item Configuration. The syntax of the unlimited
# function strings for a hierarchical function list is not explained here
# because it is much more easier to define them in the dialog and let
# UE/UES update the wordfile then define them directly in the wordfile.
/Regexp Type = Perl
# Since UE v13.10 and UES v6.30 the function strings can be also
# Perl regular expressions instead of UltraEdit regular expressions.
# For Perl regexp function strings above line must be added to the
# language definition. The Perl compatible regular expression engine is
# more powerful than the UltraEdit regexp engine. With the Perl engine
# it is also possible to use more than one ( ) pair in the expression to
# determine which parts of the found string should be displayed in the
# function list view. The matching strings of all the expressions inside
# ( ) are concatenated with a space between the string parts. But when
# using the Perl engine one ( ) pair must exist in the regexp string or
# nothing will be displayed in the function list view. With the UltraEdit
# engine only the string of the first ^( ^) tagged expression is displayed
# in the function list view. So for an UE function string it does not make
# sense to specify more than on ^( ^) pair in the regexp function string
# in the wordfile.
# Indent Strings
/Indent Strings = "{" "if" "else" ":" "Then" "Select Case" "Do" "Do While" "<td>" "<tr>"
/Unindent Strings = "}" "End" "Next" "End If" "End Select" "Loop" "End Select" "Loop While" "Else" "</TD>" "</tr>"
# When such a string is contained in the line of code, UltraEdit
# can automatically indent the block of code lying in between them.
# Used for Format - ReIndent Selection and when configuration
# setting Auto indent new lines is enabled.
# /Indent Strings SOL = "#"
# Deprecated keyword.
# There has been a change to the way syntax highlighting works as support
# for these functions has evolved. It used to be necessary to define when
# an indent string occurred at start of line (SOL) because normally this
# was only checked for at the END of a line. Now an indent string is
# recognized regardless of where it occurs on a line so this is no
# longer used. Indent strings are always not case sensitive.
/Ignore Strings SOL = "#" "//"
# Lines which begin with those strings will be left un-indented
# when executing Format - ReIndent Selection.
# Brace Matching
/Open Brace Strings = "{" "(" "[" "<" "If" "For" "Select Case" "Else" "ElseIf"
/Close Brace Strings = "}" ")" "]" ">" "End If" "Next" "End Select" "End If" "ElseIf"
# Those strings extend the Match Brace command and Auto Brace Matching
# (in Syntax Highlighting Configuration).
# The open and close strings must be positionally matched in the lists.
# Defaults are "(" and ")". Case sensitivity of brace strings depends
# on keyword Nocase in the language definition line.
# Code Folding
/Open Fold Strings = "{" "If" "ElseIf" "Else" "Function" "Sub" "Select Case" "With"
/Close Fold Strings = "}" "ElseIf" "Else" "End If" "End Function" "End Sub" "End Select" "End With"
# Those strings are used to define the begin and end of the block of code
# which will be folded if requested by user. Defaults are "{" and "}".
# Case sensitivity of fold strings depends on keyword Nocase in
# the language definition line.
/Ignore Fold Strings = "// /" "Exit Function" "Exit Sub" "Declare Function"
# If one of those strings is found in the code, then the fold logic will
# ignore this line. There are no defaults. This definition is supported
# since UltraEdit v12.00 respectively UEStudio v5.10.
/Open Comment Fold Strings = "#Region"
/Close Comment Fold Strings = "#End Region"
# Those fold strings are recognized only in comments. No defaults.
# Normal open and close fold strings must be specified too or the
# code folding engine is not enabled. Specify an open and close fold
# string which never occurs in the highlighted files when there are
# no normal open and close fold strings. Comment fold strings are
# supported since UltraEdit v12.00 respectively UEStudio v5.10.
# Marker Characters
/Marker Characters = "[]&;"
# Up to four pairs can be defined. You must add all the character
# pairs into any of the color groups to define its highlight color.
# Every text between a pair of characters in the same line is
# highlighted with the same color. Identical start and end characters
# are supported since UE v9.20 to highlight for example everything
# between @...@.
# Undocumented Strings
/Member String = "^([A-Za-z0-9_:.]+^)[ ^t^*&]+$S[ ^t^[^]A-Za-z0-9_]++[(-);,]"
/Variable String = "%[ ^t]++^([!-?~ ^t<>]+*[~a-z^p]^)$S[ ^t;,()^-]"
# Only the IDM developers know what they are for and how they must be
# defined for the UEStudio Classviewer / IntelliTips support in UEStudio.
# Color Groups built-in
# Normal Text
# Words that are not recognized. Displayed with normal text color (black).
# Comments
# Words that appear in a comment line or block comments. Displayed in green.
# Alternate Block Comments
# Words that appear in alternate block comments. Displayed in green.
# Strings
# Strings enclosed in characters defined by String Chars. Displayed in gray.
# You can add a string character to a color group to change the color.
# Numbers
# Words starting with a digit (0-9). Displayed in red.
# Color Group definitions
# /Cn"Color Group Name" STYLE_KEYWORD
# n is color code in range 1-8.
# "Color Group Name" is displayed in Configuration; up to 24 characters.
# (or only 18 characters in older version of UltraEdit). The color used to
# display each word list can be changed in Syntax Highlighting Configuration.
/C1"Color Group 1"
# Keywords for group 1, displayed in blue.
/C2"Color Group 2"
# Keywords for group 2, displayed in red.
/C3"Color Group 3"
# Keywords for group 3, displayed in orange.
/C4"Color Group 4"
# Keywords for group 4, displayed in green.
/C5"Color Group 5"
# Keywords for group 5, displayed in brown.
/C6"Color Group 6"
# Keywords for group 6, displayed in blue.
/C7"Color Group 7"
# Keywords for group 7, displayed in blue.
/C8"Color Group 8"
# Keywords for group 8, displayed in blue.
# Further color groups up to /C20 can be used since UE v17.00 and UES v11.00.
# Style keywords
STYLE_ATTRIBUTE STYLE_COMMAND STYLE_ELEMENT STYLE_EVENT STYLE_EXTENSION
STYLE_FUNCTION STYLE_IDENTIFIER STYLE_KEYWORD STYLE_METHOD STYLE_OPERATOR
STYLE_STATEMENT STYLE_TAG STYLE_VARIABLE
# Style keywords are part of the color group definition line.
# They identify color groups for IntelliTip support in UEStudio.
# They are optional.
# Keyword list
# Keyword list follows the line with color group definition.
# All keywords starting with the same letter can either be all written
# on a single line or they can be split in more successive lines (but
# in this case the lines must not be separated with blank line or a
# keyword starting with different letter).
// /keyword1 /keyword2
# Keywords beginning with / must be preceded by // .
# This is to differentiate such keywords from wordfile's own
# keywords like "/Delimiters"
** string1 string2 ...
# Matches all keywords starting with string1 or string2. Only one such
# line in a color group is allowed. This is called substring definition.


