Source code is colored in the DVT editor.
Some language constructs are colored based on a syntactical analysis of the code, while others require a more elaborate semantic analysis, as detailed in the table below.
Semantic coloring is only performed when the source code is compiled.
|Comment Hyperlinks|| || |
|Comment Pragmas||y||Compilation is required for Custom Pragmas|
|Comments|| || |
|Constants||y||Const fields, enum members and predefined constants like
|Default|| ||Any word which does not belong to other categories|
|Define Groups|| ||Syntactical category tag of a
define as or
define as computed macro
|Expansion Literals|| || |
|Expansion Replacements|| || |
|Fields||y||Struct fields and union fields|
|HDL Paths|| || |
|Javadoc Tags|| || |
|Keyphrases|| ||Combination of keywords: "is a", "keep for each"|
|Keywords|| || |
|Methods||y||Methods and time consuming methods|
|Numbers|| || |
|Ports - Input, Inout||y|| |
|Ports - Output||y|| |
|Preprocessing|| ||Preprocessing #macros|
|Replacement Terms|| ||Constructs like <any>, <exp>, <type>|
|Section Start/End|| ||Begin or end of code section
|String Literals|| || |
|Task Tags|| || |
|Types||y||scalar types, units, structs|
|Template Identifiers|| || |
|Time Units|| ||Time units like
You can change the coloring style for each of the categories.
Window > Preferences > DVT > e Language > Editor > Syntax Coloring, select the category you wish to modify from the list and set the color and font style.
A code sample in the Syntax Coloring preference page helps you preview the changes instantly. The default style is shown below:
Note: Inside macro definitions and macro calls, only syntactic coloring is performed.