Scanner

From Bluefish Wiki
Jump to navigation Jump to search

To enable the scanner, use

./configure --enable-scanner

you might want to add

--enable-unstable-install

to avoid the change of any settings of your stable bluefish install

Here you can find Bluefish langugage specification format.


<bflang name<code>\"Testlang\" description</code>\"Test language file\">
    '''''name''''' - ''name of the language''
    '''''description''''' - ''language description''

<options>    ''global options''
    <option name=\"case-sensitive\">false</option>
                       ''is this language case sensitive ?''
    <option name=\"scan-markup-tags\">true</option>
                       ''if TRUE markup tags will be scanned and proper signals sent''
    <option name=\"scan-blocks\">true</option>
                       ''if TRUE blocks will be scanned and proper signals sent''
    <option name=\"auto-scan-triggers\">{}
<></option>
                       ''these are characters which will switch scanning procedure when autoscan is on''
    <option name=\"restricted-tags-only\">true</option>
                       ''if TRUE it means that signals should be emitted only for tags and attributes''
                       ''defined in <restricted-tags> section''

</options>


<block-group id=\"grp1\">
      ''block group definition - block groups does not have any special meaning but they can be used by you''
    <block id<code>\"one\" begin</code>\"<====--\" end<code>\"-->\" scanned</code>\"true\" foldable=\"true\"====
           case<code>\"false\" markup</code>\"true\" regexp=\"false\" />
      '''''id'''''       - ''block identifier''
      '''''begin'''''    - ''string which begins block''
      '''''end'''''      - ''string which ends the block''
      '''''scanned'''''  - ''should this block be scanned inside''
      '''''foldable''''' - ''can we fold this block''
      '''''case'''''     - ''should we recognize case sensitive inside block''
      '''''markup'''''   - ''should we recognize markup inside block''
      '''''regexp'''''   - ''if TRUE, block begin-end strings are recognized as regular expressions - see token regexp''

    <block id<code>\"brackets\" begin</code>\"{\" end<code>\"}\" scanned</code>\"true\" foldable<code>\"true\" case</code>\"true\" markup=\"false\"/>

</block-group>

'''the scanner does not implement the complete regular expression specification==='''===

<token-group id=\"red\">
       ''token group''
    <token>void</token>
       ''this is simple token definition''

    <token-list separator=\",\">gint,gchar,glong</token-list>
       ''this is list of tokens for faster specification''

</token-group>

<token-group id=\"blue\">

    <token context=\"brackets\">~[[Bf Text View]]</token>
      ''another token specification''
      '' '''context''' attribute is block id. This token is recognized ONLY if found inside specified block''

    <token name<code>\"number\" regexp</code>\"true\">~[[0-9]]+.?~[[0-9]]*</token>
      ''yet another, but this time we specify token as regular expression''
      '''''name'''''   - ''optional name for token''
      '''''regexp''''' - ''if TRUE it means token text should be recognized as regular expression''

'''the scanner does not implement the complete regular expression specification==='''===

                   ''You can use:''
                     ''~[[]] - for set of characters f.e. ~[[a-z34$]] means characters from a to z and 3, 4 and $''
                     ''''' - for zero or more times f.e. a''' means character a zero or more times''
                     ''+ - for one or more times''
                     ''? - for zero or one times (optional)''
                     ''~[[^]] - means negation of the set so ~[[^a-z]] is everything but a-z chars''
</token-group>


<restricted-tags>
 ''This section defines specific tags to be recognized''
 <tag name<code>\"html\" attributes</code>\"xml:lang,id\" />
   '''''name''''' - ''tag name''
   '''''attributes''''' - ''list of allowed attributes separated by comma''
</restricted-tags>

</bflang>