a:documentation [ "RELAX NG flat schema for Bluefish Language Files (bflang) containing syntax highlighting and autocompletion information for the bluefish " xhtml:a[href = "http://bluefish.openoffice.nl""Bluefish"] " editor." ]
start = ## The root tag of a Bluefish language file (bflang2) file. It defines the human readable name, the bflang format version and some values for the compiler, indicating how much memory should be allocated.
elementbflang { ## Human readable name of the language defined; must be unique regarding other language files
attributename { xsd:normalizedString }, ## Version of the bflang2 format the file complies to
attributeversion { xsd:decimal }, ( ## Size of the context table. This value is an indication for the compiler how much memory should be allocated. It optimises the loading speed. As illustration: contexts="100" (4.69 Kbytes)
attributecontexts { xsd:positiveInteger }, ## Size of the matches table. This value is an indication for the compiler how much memory should be allocated. It optimises the loading speed. As illustration: matches="1752" (123.19 Kbytes)
attributematches { xsd:positiveInteger }, ## Size of the DFA table, compiled patterns for each contex. This value is an indication for the compiler how much memory should be allocated. It optimises the loading speed. As illustration: table="7906" (1976.50 Kbytes)
attributetable { xsd:positiveInteger } )?, ## Region of the language file that is always loaded, regardless if the language is used or not.
elementheader { ## Every language file should have at least one unique mime type (compared to the other language files) in order to be available to the user. There can be multiple mime tags.
elementmime { ## "Content Type" or "Internet Media Type" (refer to RFC 2045-2049 and the IANA)
attributetype { xsd:token }, empty }+, ( ## Options are links to the class/notclass attribute of <group> elements. Enabling/disabling an option turns on/off (complete) groups.
elementoption { ## Option name (ID)
attributename { xsd:ID }, ## Enable (1) or disable (0) the feature/group
attributedefault { xsd:boolean }, ## Optional human readable description of the option (not yet used)
attributedescription { xsd:string }?, empty } | ## Links contexts, elements, groups and tags, that can be highlighted and that are used by multiple languages, with styles. Default styles are hardcoded.
elementproperties { ( ## Specify which line and block comments are possible for the smart comment function.
elementcomment { ## Type of comment
attributetype { ## Block comment
xsd:token"block" | ## Line comment
xsd:token"line" }, ## Start-pattern of a comment
attributestart { xsd:string }, ## End-pattern of a block comment
attributeend { xsd:string }?, empty } | ## Specify which characters (followed by a return) should increase the indenting.
elementsmartindent { ## List of characters
attributecharacters { xsd:string }, empty } | ## Define if regions that are not highlighted will be checked by the spell checker. This is typically enabled for HTML/XML like languages, and disabled (or ignored) for all programming languages.
elementdefault_spellcheck { ## Enable (1) or disable (0) the feature
attributeenabled { xsd:boolean }, empty } )+, empty }?, ## The region of the language file that actually defines the language. This region is only loaded when a file of this type is opened in the editor. A language definition always starts with a <context> tag.
bf.element.context = ## The most important attribute of a context are the symbols, a string of characters that are all 'symbol' characters for this context. A 'symbol' character is a character that may start or end the next match. Usually all spacing is a symbol, and in programming languages all operators are symbols. Contexts can be reused later by using an ID during definition and referencing this ID later.
elementcontext { ( ( ## List of characters
attributesymbols { xsd:string }, bf.attribute.highlight, ## Context ID to reuse it later
attributeid { xsd:ID { pattern = "c\.[a-zA-Z0-9_.]+" } }?, ( bf.element.element | bf.element.group | bf.element.tag )+ ) | ## ID of context to reuse (no other attributes or elements are allowed)
bf.element.element = ## Language element that is syntax highlighted, autocompleted or has reference information. The most important attribute is 'pattern': a keyword (e.g. a function name) or a regular expression (if attribute 'is_regex' is set to '1'). It might contain other elements, contexts, groups and references. To reuse an element it must have only the 'idref' attribute.
attributemayfold { [a:defaultValue = "0"]xsd:boolean }?, ## Special attribute to enable automatic closure of the generic tags only used for generic XML highlighting, and only for the element that starts the generic xml tag pattern
bf.element.group = ## Group multiple tags or elements that share the same attribute values for a subset of attributes: 'attrib_autocomplete_append', 'attribhighlight', 'autocomplete', 'autocomplete_append', 'case_insens', 'class', 'highlight', 'is_regex' and/or 'notclass'. These attributes are then only set for the group tag, and not for the elements or tags immediately within this group tag.
bf.element.tag = ## Convenience element for SGML/XML based languages. Everything within tag is possible with a combination of multiple element and context tags.
elementtag { ( ( ## ID of element to reuse (no other attributes or elements are allowed)
attributeattributes { xsd:string { pattern = "[a-zA-Z0-9][a-zA-Z0-9:,-_]+" } }, bf.attribute.attribhighlight )?, ## ID to reuse tag
attributeid { xsd:ID { pattern = "t\.[a-zA-Z0-9_.]+" } }?, ## Do not automatically close the tag ('1')
attributeno_close { xsd:boolean }?, ## The tag does not need to be closed, like SGML Shorttags ('1'). This is currently only used in HTML for tags like <br>.
attributesgml_shorttag { xsd:boolean }?, ( bf.element.context | bf.element.reference )* ) | attributeidref { ## ID of tag to reuse (no other attributes or elements are allowed)
bf.element.reference = ## The reference contains a description of elements or tags and must only contain valid PANGO markup and text according to http://library.gnome.org/devel/pango/stable/PangoMarkupFormat.html. For the moment PANGO markup is not checked for validity!
elementreference { ( text | element* { text } )*, empty }