faqts : Computers : Programming : Languages : Tse : Color : Syntax highlighting

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 3 people (100%) answered Yes
Recently 3 of 3 people (100%) answered Yes

Entry

TSE: Syntax: Highlight: Create: How to create a .syn file for TSE v2.8, v3.0 or v4.x?

Aug 26th, 2005 08:53
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 30 June 2003 - 00:51 am -----------------------

TSE: Syntax: Highlight: Create: How to create a .syn file for TSE 
v2.8, v3.0 or v4.x?

---

Steps: Overview:

 1. -run the macro

      c:\wordproc\tse32_v4\mac\syncfg.mac

     or choose from the TSE menu:
      'Other'->
       'Full Configuration'->
        'Display/Color Options'->
         'Configure Syntaxhighlighting sets'

 2. -this will show you a menu:

      +-------------------------------------+
      |                                     |
      |Configure SyntaxHiLight Mapping Sets: |
      |                                     |
      |-------------------------------------+
      |-------------------------------------+
      |                                     |
      | Current                             |
      |                                     |
      |-------------------------------------+
      |                                     |
      | Other...                            |
      |                                     |
      |-------------------------------------+
      |                                     |
      | Create New...                       |
      |                                     |
      |-------------------------------------+
      |-------------------------------------+
      |                                     |
      | Configure Associations...           |
      |                                     |
      +-------------------------------------+

      2.1 menu option 'Current':

       (this will show you the settings for the current file extension)

        E.g.

         load a

          .s

         file to see an example.

         This gives you a menu with the following options:

          [ <name of your currently loaded SYNtax highlite file> ]

          Delimiter Tokens

            Multi-Line [ <the multi line REM statements
                          for this language> ]

            Multi-Line 1 [ /* */ ] (fore example if TSE or C++)

            Multi-Line 1 [ { } ]  (for example if Pascal)

            Multi-Line 2 [ ]

            Multi-Line 3 [ ]

            Hilite "#If 0" Style Comments [On]
            (e.g. when using compiler directives like
               #IFDEF Win32 ...?)

            Single-Line 1 [ <your single line delimiter pair #1.
                             REM statement for this language> ]

            Single-Line 1 [ // ] (for example if C++)

            Single-Line 2 [ ]

            Single-Line 3 [ ]

            To-EOL 1 [             // ] (REM statement for TSE, runs
                                         until EOL (=end of current
                                         line))

            Starting Column 1 [ 0] (REM statement for TSE starts from
                                    column. If 1 then it must also
                                    be found on the first column
                                    of the line in order to be
                                    recognized as such a REM)

            To-EOL 2 [ ]
            Starting Column 2 [  ]

            To-EOL 3 [ ]
            Starting Column 3 [  ]

            Quote 1 [ " ] // string quotes possibility 1 for this
                             language (e.g. "hello world")
            Escape 1 [ [ ] // escape character for this language)

            Quote 2 [ ' ] // string quotes possibility 2 for this
                             language (e.g. 'hello world')
            Escape 2 [ [ ] // escape character for this language)

            Quote 3 [  ] // string quotes possibility 3 for this
                            language
            Escape 3 [  ] // escape character for this language)

          Directive Tokens

            Directive 1 [ # ] // directive token, e.g. used in #IFDEF
                                 or #INCLUDE. But you are free to
                                 use this for your own purposes


            Directive 2 [ ]

            Directive 3 [ ]

          Number Tokens

            None

            Integers

            C Style

            Pascal Style

            Sal Style

            Real Numbers

            Comma Numbers

            Customized Set (enable the options you want to have applied
                            for your language, by pressing <ENTER>
                            to toggle this option)

             Integers (enable in .s files)

             0xf Hex (enable in .s files)

             0fh Hex (enable in .s files)

             &Hf Hex

             %01 Binary

             123.45

             Sci. Notation

             Sci. DP Notation

             Trailing u/l (C)

             123,456.00 Comma

          Keyword Tokens

           The groups allow you to choose certain tokens as to
           have a special (different) color. Which tokens
           (or thus 'words') you choose being part of a group
           is basically up to you. But you might choose to
           put some 'logic' in it, e.g. the basic keywords
           a different color, e.g. the internal variables a special
           color, ... as is done below:

           Keyword group 1: this are the main keywords for this
                            language
                            (e.g and, for, while, ...)

           Keyword group 2: this are the operators (single characters)
                            for this language
                            (e.g. & ( ) * + , - / < = > [ ] | ~

           Keyword group 3: this are the inbuilt function and procedure
                            names (e.g. EditFile(), GotoLine(), IsAlpha
                            (), ...)

           Keyword group 4: this are the inbuilt variables (e.g. used
                             in 'Set()')
                            (e.g. beep, break, ...)

           Keyword group 5: this are the inbuilt underscore surrounded
                            variables, like _backward_,
                            _beyond_eol_, ...)

           Keyword group 6: this are the menu variables
                            (e.g. history, title, noescape, ...)

           Keyword group 7:

           Keyword group 8:

           Keyword group 9:

          Keyword WordSet (indicate which characters are part of the
                           wordset, e.g. for variable names, to
                           determine what are 'words' or not)

                           (e.g. 0-9A-Z_a-z for .s files)

          Highlight Incomplete Quotes [On] (=Colorize unmathed quote
                    token)

          Ignore Case [On] (=Ignore case of all tokens)
           (this is 'on' for TSE, because there case is not important)

          Use Transparent Highlighting [Off]
           (Ignore SyntaxHilite background color (=use normal editing
            text background color)

          CursorLine Precedence [Transparent CursorLine]

           Choose from:

            -Cursor line Colors Override

            -Syntax Hilite Colors Override

            -Transparent on CursorLine
             (=Information extracted from .syn file)

          Cancel Above Changes

          Associated File Extensions (=file extension to be associated
           with the currently loaded syntax .syn file)

           (e.g. if 'sal.syn' this is associated with 's ui si inc')

          Write Settings to Mapping Text File...

            This is very useful for analyzing the situation for the
            currently loaded file extension. By checking a few
            examples, thus the induction process, you can start to
            create your own syntax highlight files for your own
            language file extensions.

          Overlay Settings from Mapping Text File...

            This feature is designed to read in a text file from disk.
            The current settings will be replaced by the new settings.
            This feature is primarily for upgrading between versions
            of the editor.

            But if you can edit the text file yourself, you can so
            quickly create via copy and paste some syntax
            highlighting files
            for your own or new languages (e.g. php, or SQL) and or
            extensions (e.g. .doc files)

      2.2 menu option 'Other...':

       (this will allow you to load another .syn file, e.g. one you
        made yourself for this language or file extension)

      2.3 menu option 'Create New...'

       (this will allow you to create a new .syn file, e.g. for your
        own personal file extensions)

         1. Select the directory where you will store this new .syn
            file

             -Current

             -Synhi directory (this is where by default all .syn files
                               are stored)

              (choose e.g. this option)

             -Load (save to this new directory)

         2. Type the new filename (without the path)

              e.g. choose 'doc' to create a syntax highlite file for
                   the .doc extension:

               doc

      2.4 menu option 'Configure associations'

       (this will allow you to edit the file extensions active for
        this .syn file)

---
---

Internet: see also:

---

TSE: Color: Syntax highlighting: Link: Overview: Can you give an 
overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/37599/fid/929

----------------------------------------------------------------------