home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / gtksourceview-1.0 / language-specs / language.dtd < prev    next >
Encoding:
Extensible Markup Language  |  2007-03-11  |  5.7 KB  |  210 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!--
  4.     This file describes the XML format used for syntax highlight
  5.     descriptions for the GtkSourceView 1.x library.
  6.  
  7.     .lang files are XML files which describe how to highlight syntax;
  8.     this DTD is used for validation purposes.
  9.  
  10.     .lang files should include:
  11.  
  12.     <!DOCTYPE language SYSTEM "language.dtd">
  13.  
  14.     and be located in $PREFIX/gtksourceview-1.0/language-specs/, or in
  15.     ~./gnome2/gtksourceview-1.0/language-specs/
  16.  
  17.     To check if a .lang file is valid, run
  18.  
  19.     $ xmllint FILENAME - -dtdvalid language.dtd
  20.  
  21.     If you create a new .lang file or modify an existing one, please note
  22.     that it will be (re)loaded by the application only after it is
  23.     restarted.
  24. -->
  25.  
  26. <!--
  27.     Boolean type
  28.  
  29.       Attributes that are of type boolean allow the following values:
  30.       
  31.       - 'true', 'TRUE' and '1'     all meaning true
  32.       - 'false', FALSE' and '0'     all meaning false
  33.  
  34.     It is encouraged to use 'TRUE' and 'FALSE' instead of the alternatives.
  35. -->
  36.  
  37. <!ENTITY % boolean
  38.     "(true|false|TRUE|FALSE|0|1)">
  39.  
  40. <!--
  41.     Attributes required by all element representing a syntax or pattern tag.
  42.  
  43.     - name        the name of the tag (it can appear in the UI)
  44.  
  45.     - style        the style used to highlight the tag. Recognized values
  46.             are (from gtksourcestylescheme.h):
  47.  
  48.             - Base-N Integer    used for values with a base
  49.                         other than 10
  50.             - Character        used for single characters
  51.             - Comment        used for comments
  52.             - Data Type        used for data types
  53.             - Function        used for function names
  54.             - Decimal        used for decimal values
  55.             - Floating Point    used for floating point values
  56.             - Keyword        used for keywords
  57.             - Preprocessor        used for preprocessor instructions
  58.             - String        used for strings
  59.             - Specials        used for 'special' things
  60.             - Others (DEPRECATED, replaced by "Data Type")
  61.             - Others 2        used for 'other' things
  62.             - Others 3        used for 'other' things
  63.  
  64.     The "name" attribute can be prefixed with "_" to be marked for
  65.     translation.
  66. -->
  67.  
  68. <!ENTITY % tagattrs
  69.     "name        CDATA    #IMPLIED
  70.      _name         CDATA    #IMPLIED
  71.      style         CDATA    #REQUIRED">
  72.  
  73. <!--
  74.     The root of the definition file is the element "language".
  75.  
  76.     Required attributes:
  77.  
  78.     - name        the name of the language (it can appear in menus and
  79.             dialog boxes)
  80.  
  81.     - section    the category the language belongs to (e.g. "Sources",
  82.             "Scripts", etc.)
  83.  
  84.     - version    version of the .lang file format (1.0)
  85.  
  86.     - mimetypes    a list of mime-types that identifies the types of file
  87.             that must be highlighted using the .lang file
  88.  
  89.     Optional attributes:
  90.  
  91.     - translation-domain
  92.             the translation domain used by the file
  93.  
  94.     The "name" and "section" attributes can be prefixed with
  95.     "_" to be marked for translation.
  96. -->
  97.  
  98. <!ELEMENT language (escape-char?,(line-comment|block-comment|string|syntax-item|pattern-item|keyword-list)+)>
  99. <!ATTLIST language
  100.     _name            CDATA    #IMPLIED
  101.     name              CDATA    #IMPLIED
  102.     _section          CDATA    #IMPLIED
  103.     section          CDATA    #IMPLIED
  104.     version            CDATA    #REQUIRED
  105.     mimetypes        CDATA    #REQUIRED
  106.       translation-domain      CDATA    #IMPLIED>
  107.  
  108. <!--
  109.     Which character is used in escape sequences.
  110. -->
  111. <!ELEMENT escape-char (#PCDATA)>
  112.  
  113. <!--
  114.     The line-comment" element represents single line comments.
  115.     The "start-regex" subelement defines the regex matching the start of
  116.     the comment.
  117. -->
  118. <!ELEMENT line-comment (start-regex)>
  119. <!ATTLIST line-comment
  120.     %tagattrs;>
  121.  
  122. <!--
  123.     The "block-comment" element represents multiple lines comments.
  124.     The "start-regex" subelement defines the regex matching the beginning of
  125.     the comment.
  126.     The "end-regex" subelement defines the regex matching the end of
  127.     the comment.
  128. -->
  129. <!ELEMENT block-comment (start-regex,end-regex)>
  130. <!ATTLIST block-comment
  131.      %tagattrs;>
  132.  
  133. <!--
  134.     The "string" element represents string.
  135.     The "start-regex" subelement defines the regex matching the beginning of
  136.     the string.
  137.     The "end-regex" subelement defines the regex matching the end of
  138.     the string.
  139.  
  140.     Optional attributes:
  141.  
  142.     - end-at-line-end    whether the string end at the end of line
  143. -->
  144. <!ELEMENT string (start-regex,end-regex)>
  145. <!ATTLIST string
  146.      %tagattrs;
  147.      end-at-line-end        %boolean; "TRUE">
  148.  
  149. <!--
  150.     The "syntax-item" element represents a generic region of the document.
  151.     The "start-regex" subelement defines the regex matching the beginning of
  152.     the region.
  153.     The "end-regex" subelement defines the regex matching the end of
  154.     the region.
  155. -->
  156. <!ELEMENT syntax-item (start-regex,end-regex)>
  157. <!ATTLIST syntax-item
  158.      %tagattrs;>
  159.  
  160. <!--
  161.     The "pattern-item" element represents a generic token.
  162.     The "regex" subelement defines the regex matching the token.
  163. -->
  164. <!ELEMENT pattern-item (regex)>
  165. <!ATTLIST pattern-item
  166.     %tagattrs;>
  167.  
  168. <!--
  169.     The "keyword-list" element represents a list of keywords, it can have
  170.     one or more "keyword" subelements each one representing a keyword.
  171.     A "keyword" subelement defines the regex matching a keyword of the
  172.     language.
  173.  
  174.     Optional attributes:
  175.  
  176.     - case-sensitive    whether the keywords are case sensitive
  177.     
  178.     - match-empty-string-at-beginning:
  179.                 whether the empty string (\b) should be matched
  180.                 at the beginning of the keywords
  181.                 
  182.     - match-empty-string-at-end
  183.                 whether the empty string (\b) should be matched
  184.                 at the end of the keywords
  185.                 
  186.     - beginning-regex    if all keywords start with a regex, you can
  187.                 specify    it here to avoid doing it for
  188.                 every single keyword
  189.                 
  190.     - end-regex        if all keywords end with a regex, you can
  191.                 specify    it here to avoid doing it for
  192.                 every single keyword
  193. -->
  194.  
  195. <!ELEMENT keyword-list (keyword)+>
  196. <!ATTLIST keyword-list
  197.     %tagattrs;
  198.     case-sensitive            %boolean;    "TRUE"
  199.       match-empty-string-at-beginning    %boolean;    "FALSE"
  200.     match-empty-string-at-end    %boolean;    "FALSE"
  201.     beginning-regex            CDATA        #IMPLIED
  202.     end-regex            CDATA        #IMPLIED>
  203.  
  204. <!-- Elements used inside other elements -->
  205. <!ELEMENT keyword (#PCDATA)>
  206. <!ELEMENT regex (#PCDATA)>
  207. <!ELEMENT start-regex (#PCDATA)>
  208. <!ELEMENT end-regex (#PCDATA)>
  209.  
  210.