John B. Matthews, M.D.

Return home.


Ada 2012 Language Module for BBEdit 9.x and TextWrangler 2.x

Download a gzip'd tar file containing the module.

Here is an Ada 2012 Language Module for BBEdit 9.x (professional) and TextWrangler 2.x (free), programming editors from Bare Bones Software. The module adds several Ada specific features including syntax coloring, procedure/function navigation and comment handling. The module now ignores block comments correctly.

To install the module, just unzip/untar the file and put it in your Language Modules folder. You may have to create the directory if it doesn't already exist, or substitute TextWrangler for BBEdit:
tar -zxvf AdaLM.tgz
mkdir ~/Library/Application\ Support/BBEdit/Language\ Modules
mv Ada2012.plist ~/Library/Application\ Support/BBEdit/Language\ Modules/.
You'll need to restart BBEdit for the new features to become available. Although the comment settings could be inferred from the module, any change would revert each time you restarted BBEdit. You need to configure the feature manually. Go to Preferences -> Languages -> Installed languages. You should see the Ada module listed; it was put there when the Ada Language Module was loaded. Click on Options, and put '--' in the Comment Start field; leave the Comment End field empty. Select any number of lines, and choose Un/Comment Selection from the Text menu. Select the command again (or ⌘-Z) to reverse the effect.

While you're int the Options dialog, add a Reference URL template such as http://www.google.com/search?hl=en&q=__SYMBOLNAME__ for searching from the context menu.

While you're in Preferences -> Languages, select ".ads" in Suffix-mappings and note that it is an include file. This causes the green "Counterpart" button to toggle between the spec or body of the frontmost document.

Here's what the Ada 2012 module looks like. The meaning of the various elements, formerly documented in Appendix D of the BBEdit manual, is now here:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--Ada language module for BBEdit 8.x-->
<!--John B. Matthews; http://home.roadrunner.com/~jbmatthews/-->
<!--Copyright 2005, 2007, 2013; distribution per GPL; no warranty-->
<dict>
    <key>BBEditDocumentType</key>
    <string>CodelessLanguageModule</string>
    <key>BBLMColorsSyntax</key> <true/>
    <key>BBLMIsCaseSensitive</key> <false/>
    <key>BBLMKeywordList</key>
    <array>
        <string>abort</string>
        <string>abs</string>
        <string>abstract</string>
        <string>accept</string>
        <string>access</string>
        <string>aliased</string>
        <string>all</string>
        <string>and</string>
        <string>array</string>
        <string>at</string>
        <string>begin</string>
        <string>body</string>
        <string>case</string>
        <string>constant</string>
        <string>declare</string>
        <string>delay</string>
        <string>delta</string>
        <string>digits</string>
        <string>do</string>
        <string>else</string>
        <string>elsif</string>
        <string>end</string>
        <string>entry</string>
        <string>exception</string>
        <string>exit</string>
        <string>for</string>
        <string>function</string>
        <string>generic</string>
        <string>goto</string>
        <string>if</string>
        <string>in</string>
        <string>interface</string>
        <string>is</string>
        <string>limited</string>
        <string>loop</string>
        <string>mod</string>
        <string>new</string>
        <string>not</string>
        <string>null</string>
        <string>of</string>
        <string>or</string>
        <string>others</string>
        <string>out</string>
        <string>overriding</string>
        <string>package</string>
        <string>pragma</string>
        <string>private</string>
        <string>procedure</string>
        <string>protected</string>
        <string>raise</string>
        <string>range</string>
        <string>record</string>
        <string>rem</string>
        <string>renames</string>
        <string>requeue</string>
        <string>return</string>
        <string>reverse</string>
        <string>select</string>
        <string>separate</string>
        <string>some</string>
        <string>subtype</string>
        <string>synchronized</string>
        <string>tagged</string>
        <string>task</string>
        <string>terminate</string>
        <string>then</string>
        <string>type</string>
        <string>until</string>
        <string>use</string>
        <string>when</string>
        <string>while</string>
        <string>with</string>
        <string>xor</string>
    </array>
    <key>BBLMLanguageCode</key>
    <string>Ada5</string>
    <key>BBLMLanguageDisplayName</key>
    <string>Ada 2012</string>
    <key>BBLMScansFunctions</key> <true/>
    <key>BBLMSuffixMap</key>
    <array>
        <dict>
            <key>BBLMLanguageSuffix</key>
            <string>.ads</string>
            <key>BBLMIsHeaderKind</key> <true/>
        </dict>
        <dict>
            <key>BBLMLanguageSuffix</key>
            <string>.adb</string>
            <key>BBLMIsSourceKind</key> <true/>
        </dict>
    </array>
    <key>Language Features</key>
    <dict>
        <key>Close Block Comments</key>
        <string></string>
        <key>Close Parameter Lists</key>
        <string>)</string>
        <key>Close Statement Blocks</key>
        <string>end</string>
        <key>Close Strings 1</key>
        <string>"</string>
        <key>Close Strings 2</key>
        <string></string>
        <key>End-of-line Ends Strings 1</key> <true/>
        <key>End-of-line Ends Strings 2</key> <true/>
        <key>Escape Char in Strings 1</key>
        <string></string>
        <key>Escape Char in Strings 2</key>
        <string></string>
        <key>Identifier and Keyword Characters</key>
        <string>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz</string>
        <key>Open Block Comments</key>
        <string></string>
        <key>Open Line Comments</key>
        <string>--</string>
        <key>Open Parameter Lists</key>
        <string>(</string>
        <key>Open Statement Blocks</key>
        <string>begin</string>
        <key>Open Strings 1</key>
        <string>"</string>
        <key>Open Strings 2</key>
        <string></string>
        <key>Prefix for Functions</key>
        <string>function</string>
        <key>Prefix for Procedures</key>
        <string>procedure</string>
        <key>Terminator for Prototypes 1</key>
        <string>;</string>
        <key>Terminator for Prototypes 2</key>
        <string></string>
    </dict>
</dict>
</plist>
Copyright 2005, 2007, 2009, 2013 John B. Matthews
Distributed without warranty under the terms of the GNU Public License.
Last updated 17-Nov-2013
Return home.