home *** CD-ROM | disk | FTP | other *** search
- /*
- * TSyntaxMemoParser Script
- * ------------------------
- *
- * Author : David Brock
- * Date : October 18 1997
- * Language: HTML
- */
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- //
- //
- // Macro definitions. Parameters may be specified and the replacement text terminates with the end of
- // line (watch trailing blanks).
- //
- #define ht_DEFAULT 0
- #define ht_TAGNAME 20
- #define ht_UNKNOWN 21
- #define ht_TAGSTART 22
- #define ht_TAGEND 23
- #define ht_COMMENT 24
- #define ht_WHITESPACE 25
- #define ht_IDENTIFIER 26
- #define ht_STRING 27
- #define ht_MISC 28
- #define ht_FIELDNAME 29
- #define ht_NUMBER 30
- #define ht_WEBURL 31
- #define ht_MAILURL 32
-
- #define ht_TAGNAME_A 100
- #define ht_TAGNAME_ADDRESS 101
- #define ht_TAGNAME_APPLET 102
- #define ht_TAGNAME_B 103
- #define ht_TAGNAME_BASEFONT 104
- #define ht_TAGNAME_BLINK 105
- #define ht_TAGNAME_BIG 106
- #define ht_TAGNAME_BLOCKQUOTE 107
- #define ht_TAGNAME_BODY 108
- #define ht_TAGNAME_BR 109
- #define ht_TAGNAME_CAPTION 110
- #define ht_TAGNAME_CENTER 111
- #define ht_TAGNAME_CITE 112
- #define ht_TAGNAME_CODE 113
- #define ht_TAGNAME_DD 114
- #define ht_TAGNAME_DIR 115
- #define ht_TAGNAME_DIV 116
- #define ht_TAGNAME_DL 117
- #define ht_TAGNAME_DOCTYPE 118
- #define ht_TAGNAME_DT 119
- #define ht_TAGNAME_EM 120
- #define ht_TAGNAME_EMBED 121
- #define ht_TAGNAME_FONT 122
- #define ht_TAGNAME_FORM 123
- #define ht_TAGNAME_FRAME 124
- #define ht_TAGNAME_FRAMESET 125
- #define ht_TAGNAME_H 126
- #define ht_TAGNAME_H1 127
- #define ht_TAGNAME_H2 128
- #define ht_TAGNAME_H3 129
- #define ht_TAGNAME_H4 130
- #define ht_TAGNAME_H5 131
- #define ht_TAGNAME_H6 132
- #define ht_TAGNAME_HEAD 133
- #define ht_TAGNAME_HR 134
- #define ht_TAGNAME_HTML 135
- #define ht_TAGNAME_I 136
- #define ht_TAGNAME_IMAGE 137
- #define ht_TAGNAME_INPUT 138
- #define ht_TAGNAME_ISINDEX 139
- #define ht_TAGNAME_KBD 140
- #define ht_TAGNAME_LI 141
- #define ht_TAGNAME_LINK 142
- #define ht_TAGNAME_MARK 143
- #define ht_TAGNAME_MARQUEE 144
- #define ht_TAGNAME_MENU 145
- #define ht_TAGNAME_META 146
- #define ht_TAGNAME_NEXTID 147
- #define ht_TAGNAME_NOBR 148
- #define ht_TAGNAME_NOFRAMES 149
- #define ht_TAGNAME_OL 150
- #define ht_TAGNAME_OPTION 151
- #define ht_TAGNAME_P 152
- #define ht_TAGNAME_PRE 153
- #define ht_TAGNAME_SAMP 154
- #define ht_TAGNAME_SCRIPT 155
- #define ht_TAGNAME_SELECT 156
- #define ht_TAGNAME_SMALL 157
- #define ht_TAGNAME_SOUND 158
- #define ht_TAGNAME_STRIKE 159
- #define ht_TAGNAME_STRONG 160
- #define ht_TAGNAME_SUB 161
- #define ht_TAGNAME_SUP 162
- #define ht_TAGNAME_TABLE 163
- #define ht_TAGNAME_TD 164
- #define ht_TAGNAME_TEXTAREA 165
- #define ht_TAGNAME_TH 166
- #define ht_TAGNAME_TITLE 167
- #define ht_TAGNAME_TR 168
- #define ht_TAGNAME_TT 169
- #define ht_TAGNAME_U 170
- #define ht_TAGNAME_UL 171
- #define ht_TAGNAME_VAR 172
- #define ht_TAGNAME_WBR 173
-
-
- #define _non_alpha_ '[^_A-Za-z0-9]'
- #define _all_chars_ '[\x00-\xFF]'
- #define _no_chars_ '[]'
- #define _dont_care_ _all_chars_
- #define _DEFAULT_BACKGROUND clWhite
- #define _DEFAULT_FOREGROUND clBlack
-
-
-
- /******************************************************************************
- *
- * HTML requires states within the parser to cope with scripts and text
- * outwith tags:
- * ss_START Start state
- * ss_INTAG Within <...........> section
- * Specifically -- parsing is performed in the ss_INTAG state. In the
- * ss_START state only tag/comment starts are recognised, everything
- * else is ignored and treated as plain text (i.e. default).
- *
- *****************************************************************************
- */
- #define ss_START 0
- #define ss_INTAG 1
- #define ss_STRING 2
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%language section
- //
- // Header section. Describes the textual name of the language, case sensitivity and options used by the language.
- //
- %%language
- Name = 'HTML'
- Case = __INSENSITIVE
- Options = __DEFAULT_OPTIONS
- WordWrapColumn = _EDGE
- Gutter = _DEFAULT_GUTTER
- Anchor = ht_TAGSTART
- ExampleText = '<!-- Syntax Highlighting -->\n\
- \<HTML>\n\
- \<HEAD><TITLE>New Page</TITLE></HEAD>\n\
- \<BODY>\n\
- \Plain HTML body text\n\
- \</BODY>\n\
- \</HTML>\n'
-
- EditableStyles ('Comment', ht_COMMENT),
- ('String', ht_STRING),
- ('Tag name', ht_TAGNAME),
- ('Field name', ht_FIELDNAME),
- ('Identifier', ht_IDENTIFIER),
- ('Number', ht_NUMBER),
- ('Web URLs', ht_WEBURL),
- ('Default', ht_DEFAULT)
-
-
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%words section
- //
- // Used to specify simple languge keywords. These are constant value lexemes that always contain the same characters
- // and only require the end style to be specified. The words present here will always be tried first. If they fail
- // then the entries in the %%tokens section will be allowed to try a match.
- //
- // %%words table entries have 3 columns:
- // Column 1 Quoted string giving the characters that make up the word
- // Column 2 Quoted string that specifies how the word is terminated
- // Column 3 Token value returned when word is recognised
- //
- %%words
-
- '</' _dont_care_ ht_TAGSTART
- '<' _dont_care_ ht_TAGSTART
- '>' _dont_care_ ht_TAGEND [ss_INTAG]
- '<!--' _dont_care_ ht_COMMENT
- '<!' _dont_care_ ht_TAGSTART
- 'a' _non_alpha_ ht_TAGNAME_A [ss_INTAG]
- 'address' _non_alpha_ ht_TAGNAME_ADDRESS [ss_INTAG]
- 'align' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'alt' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'applet' _non_alpha_ ht_TAGNAME_APPLET [ss_INTAG]
- 'b' _non_alpha_ ht_TAGNAME_B [ss_INTAG]
- 'basefont' _non_alpha_ ht_TAGNAME_BASEFONT [ss_INTAG]
- 'big' _non_alpha_ ht_TAGNAME_BIG [ss_INTAG]
- 'blink' _non_alpha_ ht_TAGNAME_BLINK [ss_INTAG]
- 'blockquote' _non_alpha_ ht_TAGNAME_BLOCKQUOTE [ss_INTAG]
- 'body' _non_alpha_ ht_TAGNAME_BODY [ss_INTAG]
- 'br' _non_alpha_ ht_TAGNAME_BR [ss_INTAG]
- 'caption' _non_alpha_ ht_TAGNAME_CAPTION [ss_INTAG]
- 'center' _non_alpha_ ht_TAGNAME_CENTER [ss_INTAG]
- 'cite' _non_alpha_ ht_TAGNAME_CITE [ss_INTAG]
- 'code' _non_alpha_ ht_TAGNAME_CODE [ss_INTAG]
- 'codebase' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'dd' _non_alpha_ ht_TAGNAME_DD [ss_INTAG]
- 'dir' _non_alpha_ ht_TAGNAME_DIR [ss_INTAG]
- 'div' _non_alpha_ ht_TAGNAME_DIV [ss_INTAG]
- 'dl' _non_alpha_ ht_TAGNAME_DL [ss_INTAG]
- 'doctype' _non_alpha_ ht_TAGNAME_DOCTYPE [ss_INTAG]
- 'dt' _non_alpha_ ht_TAGNAME_DT [ss_INTAG]
- 'em' _non_alpha_ ht_TAGNAME_EM [ss_INTAG]
- 'embed' _non_alpha_ ht_TAGNAME_EMBED [ss_INTAG]
- 'font' _non_alpha_ ht_TAGNAME_FONT [ss_INTAG]
- 'form' _non_alpha_ ht_TAGNAME_FORM [ss_INTAG]
- 'frame' _non_alpha_ ht_TAGNAME_FRAME [ss_INTAG]
- 'frameset' _non_alpha_ ht_TAGNAME_FRAMESET [ss_INTAG]
- 'h' _non_alpha_ ht_TAGNAME_H [ss_INTAG]
- 'h1' _non_alpha_ ht_TAGNAME_H1 [ss_INTAG]
- 'h2' _non_alpha_ ht_TAGNAME_H2 [ss_INTAG]
- 'h3' _non_alpha_ ht_TAGNAME_H3 [ss_INTAG]
- 'h4' _non_alpha_ ht_TAGNAME_H4 [ss_INTAG]
- 'h5' _non_alpha_ ht_TAGNAME_H5 [ss_INTAG]
- 'h6' _non_alpha_ ht_TAGNAME_H6 [ss_INTAG]
- 'head' _non_alpha_ ht_TAGNAME_HEAD [ss_INTAG]
- 'height' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'hr' _non_alpha_ ht_TAGNAME_HR [ss_INTAG]
- 'href' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'hspace' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'html' _non_alpha_ ht_TAGNAME_HTML [ss_INTAG]
- 'i' _non_alpha_ ht_TAGNAME_I [ss_INTAG]
- 'img' _non_alpha_ ht_TAGNAME_IMAGE [ss_INTAG]
- 'input' _non_alpha_ ht_TAGNAME_INPUT [ss_INTAG]
- 'isindex' _non_alpha_ ht_TAGNAME_ISINDEX [ss_INTAG]
- 'kbd' _non_alpha_ ht_TAGNAME_KBD [ss_INTAG]
- 'li' _non_alpha_ ht_TAGNAME_LI [ss_INTAG]
- 'link' _non_alpha_ ht_TAGNAME_LINK [ss_INTAG]
- 'mark' _non_alpha_ ht_TAGNAME_MARK [ss_INTAG]
- 'marquee' _non_alpha_ ht_TAGNAME_MARQUEE [ss_INTAG]
- 'menu' _non_alpha_ ht_TAGNAME_MENU [ss_INTAG]
- 'meta' _non_alpha_ ht_TAGNAME_META [ss_INTAG]
- 'methods' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'name' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'nextid' _non_alpha_ ht_TAGNAME_NEXTID [ss_INTAG]
- 'nobr' _non_alpha_ ht_TAGNAME_NOBR [ss_INTAG]
- 'noframes' _non_alpha_ ht_TAGNAME_NOFRAMES [ss_INTAG]
- 'ol' _non_alpha_ ht_TAGNAME_OL [ss_INTAG]
- 'option' _non_alpha_ ht_TAGNAME_OPTION [ss_INTAG]
- 'p' _non_alpha_ ht_TAGNAME_P [ss_INTAG]
- 'pre' _non_alpha_ ht_TAGNAME_PRE [ss_INTAG]
- 'samp' _non_alpha_ ht_TAGNAME_SAMP [ss_INTAG]
- 'script' _non_alpha_ ht_TAGNAME_SCRIPT [ss_INTAG]
- 'select' _non_alpha_ ht_TAGNAME_SELECT [ss_INTAG]
- 'small' _non_alpha_ ht_TAGNAME_SMALL [ss_INTAG]
- 'sound' _non_alpha_ ht_TAGNAME_SOUND [ss_INTAG]
- 'strike' _non_alpha_ ht_TAGNAME_STRIKE [ss_INTAG]
- 'strong' _non_alpha_ ht_TAGNAME_STRONG [ss_INTAG]
- 'sub' _non_alpha_ ht_TAGNAME_SUB [ss_INTAG]
- 'sup' _non_alpha_ ht_TAGNAME_SUP [ss_INTAG]
- 'rel' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'rev' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'table' _non_alpha_ ht_TAGNAME_TABLE [ss_INTAG]
- 'target' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'td' _non_alpha_ ht_TAGNAME_TD [ss_INTAG]
- 'textarea' _non_alpha_ ht_TAGNAME_TEXTAREA [ss_INTAG]
- 'th' _non_alpha_ ht_TAGNAME_TH [ss_INTAG]
- 'title' _non_alpha_ ht_TAGNAME_TITLE [ss_INTAG]
- 'tr' _non_alpha_ ht_TAGNAME_TR [ss_INTAG]
- 'tt' _non_alpha_ ht_TAGNAME_TT [ss_INTAG]
- 'u' _non_alpha_ ht_TAGNAME_U [ss_INTAG]
- 'ul' _non_alpha_ ht_TAGNAME_UL [ss_INTAG]
- 'urn' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'value' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'var' _non_alpha_ ht_TAGNAME_VAR [ss_INTAG]
- 'vspace' _non_alpha_ ht_FIELDNAME [ss_INTAG]
- 'wbr' _non_alpha_ ht_TAGNAME_WBR [ss_INTAG]
- 'width' _non_alpha_ ht_FIELDNAME [ss_INTAG]
-
- 'http://' _dont_care_ ht_WEBURL [ss_START ss_INTAG ss_STRING]
- 'ftp://' _dont_care_ ht_WEBURL [ss_START ss_INTAG ss_STRING]
- 'mailto:' _dont_care_ ht_MAILURL [ss_START ss_INTAG ss_STRING]
-
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%handler section > hi@
- //
- // The %%handler section gives rules to be applied once an entry in the %%words table has been recognised. Normally
- // no further processing is required but sometimes a token starts with a fixed set of characters but may be followed
- // by a character class rather than a known sequence.
- //
- // %%handler table entries have 4 columns:
- // Column 1 Token value to be processed
- // Column 2 Character specifier that follows recognised word
- // Column 3 Quoted string specifying end sequence
- // Column 4 Whether end sequence is part of lexeme
- //
- // The <character specifier> is defined as:
- // Column 2 A single character specifier or pre-defined system character macro:
- // _PASCAL_CHAR Pascal style character specifier
- // _C_CHAR C style character specifier
- // If the lexeme can optionally have these characters then append '?' to the end
- // of the quoted string.
- // Column 3 Up to 2 characters may be given as a sequence to terminate the lexeme.
- // Characters are specified using a simplified regular expression. If this
- // string is empty then the lexeme will never be matched.
- //
- %%handler
- ht_COMMENT _all_chars_? '->' _use_
- ht_MAILURL __STD_MAIL_URL
- ht_WEBURL _WEB_CHAR _all_chars_ _discard_
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%tokens section
- //
- // Used to specify how to recognise non-fixed lexemes. Non-fixed lexemes are only tried if the table entries in the
- // %%words section have failed. The non-fixed lexeme is defiened by 5 columns as below:
- // Column 1 Token value
- // Column 2 Single start character specifier
- // Column 3 Single contains character specifier
- // Column 4 End sequence specifier
- // Column 5 Whether end sequence is part of lexeme
- // Column 6 Valid states for token
- // Pre-defined token styles are implemented. If used they should be specified in Column 2. The implemented ones
- // are:
- // __STD_PASCALSTRING Pascal string -- starts with ' ands with ' and uses '' to represent
- // ' within a string. Does not extend beywond end of line.
- // __STD_IDENTIFIER Standard identifier. Starts with [_a-zA-Z], contains [_a-zA-Z0-9] and ends with
- // a non-alpha numeric character that is not part of the lexeme
- // __STD_NUMBER_OR_FP Integer or floating point constant of syntax:
- // <Digit String> [ '.' <Digit string> ] [ e|E [+-] <Digit string> ]
- //
- %%tokens
- ht_NUMBER __STD_NUMBER [ss_INTAG]
- ht_STRING __STD_C_STRING [ss_INTAG]
- ht_WHITESPACE '[\x00-\s]' '[\x00-\s]'? '[^\x00-\s]' _discard_ [ss_INTAG ss_START]
- ht_IDENTIFIER __STD_IDENTIFIER [ss_INTAG]
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%effects section
- //
- // Used to specify the default colors and font styles used for each token
- //
- // Column 1 Token value
- // Column 2 Font styles
- // Column 3 Foreground color
- // Column 4 Background color
- // Column 5 Optional column specifying whether map entry is a 'hotspot'
- //
- // Columns 1-4 must be completed for all rows, Column 5 defaults to non-hotspot.
- //
- %%effects
- ht_DEFAULT [] _DEFAULT_FOREGROUND _DEFAULT_BACKGROUND
- ht_TAGNAME [fsBold] clBlue _DEFAULT_BACKGROUND
- ht_COMMENT [] clGreen _DEFAULT_BACKGROUND
- ht_IDENTIFIER [fsBOLD] _DEFAULT_FOREGROUND _DEFAULT_BACKGROUND
- ht_STRING [] clRed _DEFAULT_BACKGROUND
- ht_FIELDNAME [fsBold] _DEFAULT_FOREGROUND _DEFAULT_BACKGROUND
- ht_WEBURL [fsUnderline] clBlue _DEFAULT_BACKGROUND 'hotspot'
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%map section
- //
- // Used to specify which entry in the %%effects table each token value uses. By default all token values map onto
- // __DEFAULT_TOKEN which is defined as zero. Table has 2 columns:
- // Column 1 Recognised token value
- // Column 2 Map table entry (i.e. %%effects table entry)
- // Normally the %%map table consists of identical value entries.
- %%map
- ht_DEFAULT ht_DEFAULT
- ht_TAGNAME ht_TAGNAME
- ht_COMMENT ht_COMMENT
- ht_IDENTIFIER ht_IDENTIFIER
- ht_STRING ht_STRING
- ht_FIELDNAME ht_FIELDNAME
- ht_UNKNOWN ht_DEFAULT
- ht_MISC ht_DEFAULT
- ht_TAGSTART ht_TAGNAME
- ht_TAGEND ht_TAGNAME
- ht_WEBURL ht_WEBURL
- ht_MAILURL ht_WEBURL
-
- ht_TAGNAME_A ht_TAGNAME
- ht_TAGNAME_ADDRESS ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_APPLET ht_TAGNAME
- ht_TAGNAME_B ht_TAGNAME
- ht_TAGNAME_BASEFONT ht_TAGNAME
- ht_TAGNAME_BIG ht_TAGNAME
- ht_TAGNAME_BLINK ht_TAGNAME
- ht_TAGNAME_BLOCKQUOTE ht_TAGNAME
- ht_TAGNAME_BODY ht_TAGNAME
- ht_TAGNAME_BR ht_TAGNAME
- ht_TAGNAME_CAPTION ht_TAGNAME
- ht_TAGNAME_CENTER ht_TAGNAME
- ht_TAGNAME_CITE ht_TAGNAME
- ht_TAGNAME_CODE ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_DD ht_TAGNAME
- ht_TAGNAME_DIR ht_TAGNAME
- ht_TAGNAME_DIV ht_TAGNAME
- ht_TAGNAME_DL ht_TAGNAME
- ht_TAGNAME_DOCTYPE ht_TAGNAME
- ht_TAGNAME_DT ht_TAGNAME
- ht_TAGNAME_EM ht_TAGNAME
- ht_TAGNAME_EMBED ht_TAGNAME
- ht_TAGNAME_FONT ht_TAGNAME
- ht_TAGNAME_FORM ht_TAGNAME
- ht_TAGNAME_FRAME ht_TAGNAME
- ht_TAGNAME_FRAMESET ht_TAGNAME
- ht_TAGNAME_H ht_TAGNAME
- ht_TAGNAME_H1 ht_TAGNAME
- ht_TAGNAME_H2 ht_TAGNAME
- ht_TAGNAME_H3 ht_TAGNAME
- ht_TAGNAME_H4 ht_TAGNAME
- ht_TAGNAME_H5 ht_TAGNAME
- ht_TAGNAME_H6 ht_TAGNAME
- ht_TAGNAME_HEAD ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_HR ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_HTML ht_TAGNAME
- ht_TAGNAME_I ht_TAGNAME
- ht_TAGNAME_IMAGE ht_TAGNAME
- ht_TAGNAME_INPUT ht_TAGNAME
- ht_TAGNAME_ISINDEX ht_TAGNAME
- ht_TAGNAME_KBD ht_TAGNAME
- ht_TAGNAME_LI ht_TAGNAME
- ht_TAGNAME_LINK ht_TAGNAME
- ht_TAGNAME_MARK ht_TAGNAME
- ht_TAGNAME_MARQUEE ht_TAGNAME
- ht_TAGNAME_MENU ht_TAGNAME
- ht_TAGNAME_META ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_NEXTID ht_TAGNAME
- ht_TAGNAME_NOBR ht_TAGNAME
- ht_TAGNAME_NOFRAMES ht_TAGNAME
- ht_TAGNAME_OL ht_TAGNAME
- ht_TAGNAME_OPTION ht_TAGNAME
- ht_TAGNAME_P ht_TAGNAME
- ht_TAGNAME_PRE ht_TAGNAME
- ht_TAGNAME_SAMP ht_TAGNAME
- ht_TAGNAME_SCRIPT ht_TAGNAME
- ht_TAGNAME_SELECT ht_TAGNAME
- ht_TAGNAME_SMALL ht_TAGNAME
- ht_TAGNAME_SOUND ht_TAGNAME
- ht_TAGNAME_STRIKE ht_TAGNAME
- ht_TAGNAME_STRONG ht_TAGNAME
- ht_TAGNAME_SUB ht_TAGNAME
- ht_TAGNAME_SUP ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_TABLE ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_TD ht_TAGNAME
- ht_TAGNAME_TEXTAREA ht_TAGNAME
- ht_TAGNAME_TH ht_TAGNAME
- ht_TAGNAME_TITLE ht_TAGNAME
- ht_TAGNAME_TR ht_TAGNAME
- ht_TAGNAME_TT ht_TAGNAME
- ht_TAGNAME_U ht_TAGNAME
- ht_TAGNAME_UL ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_VAR ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
- ht_TAGNAME_WBR ht_TAGNAME
- ht_FIELDNAME ht_TAGNAME
-
- %%states
- ht_TAGSTART (+[ss_INTAG])
- ht_TAGEND (-[ss_INTAG])
-
- %%containers
- ht_STRING (+[ss_STRING] -[ss_START ss_INTAG])
-
-
- #define bgcolor_effects
-
- #ifdef bgcolor_effects
- /*----------------------------------------------------------------------------*
- Optional addendum to script to illustrate method to allow fields of the
- same name to be highlighted dependent upon the parent tag name.
-
- Remove the #define for bgcolor_effects (above) for this new section to be
- ignored by the script compiler (and revert to previous behaviour).
- */
-
- /*
- * STEP 1: Define new token values for the different 'bgcolor' fields
- */
- #define ht_FIELD_BGCOLOR_BODY 200
- #define ht_FIELD_BGCOLOR_TD 201
-
- /*
- * STEP 2: Define new states to allow the same text 'bgcolor' to be
- * recognised as different dependent upon the current state set
- */
- #define ss_BGCOLOR_BODY 3
- #define ss_BGCOLOR_TD 4
-
- /*
- * STEP 3: Declare new words, making their active states different
- */
- %%words
- 'bgcolor' _non_alpha_ ht_FIELD_BGCOLOR_BODY [ss_BGCOLOR_BODY]
- 'bgcolor' _non_alpha_ ht_FIELD_BGCOLOR_TD [ss_BGCOLOR_TD]
-
- /*
- * STEP 4: Define the highlights used by the new tokens
- */
- %%effects
- ht_FIELD_BGCOLOR_BODY [fsBold] clRed _DEFAULT_BACKGROUND
- ht_FIELD_BGCOLOR_TD [fsBold] clGreen _DEFAULT_BACKGROUND
-
-
- /*
- * STEP 5: Override the default mapping for the new token values
- */
- %%map
- ht_FIELD_BGCOLOR_BODY ht_FIELD_BGCOLOR_BODY
- ht_FIELD_BGCOLOR_TD ht_FIELD_BGCOLOR_TD
-
- /* STEP 6: The bit that makes it operate -- when each of the parent tags
- * is recognised we require to turn on the respective new state.
- *
- * In addition, when we end the tag with '>' we must ensure that
- * the new states are turned off as well as the standard
- * ss_INTAG
- */
- %%states
- ht_TAGEND (-[ss_INTAG ss_BGCOLOR_BODY ss_BGCOLOR_TD])
- ht_TAGNAME_BODY (+[ss_BGCOLOR_BODY])
- ht_TAGNAME_TD (+[ss_BGCOLOR_TD])
- #endif
-
-