TruerWords Logo

Search TruerWords

This is one of my journal's many "channels."
This chanel only shows items related to "Regular Expressions."

Sign Up  Log On
Monday, June 23, 2008

Building a Codeless Language Module for BBEdit or TextWrangler (Updated)

I've updated the guide that explains how to create a Codeless Language Module (CLM) for BBEdit with regular expressions (or "irregular expressions" as I explain in the guide).

The how-to walks you through creating a CLM for the newLISP language. Some bugs were found recently in both the final CLM and the guide itself, and have all been fixed. Also, the new version of the downloadable CLM (at the bottom of the guide) includes the most recently added keywords and built-in language functions.

Saturday, September 23, 2006

Codeless Language Modules and Regex Madness

I've posted a tutorial for creating your own Codeless Language Module for use with BBEdit 8.5. Along the way it also looks at a fairly advanced topic related to regular expressions.

Some of my work with Bare Bones and BBEdit 8.5 involved a lot of regular expressions. Version 8.5 now supports "Codeless Language Modules" with regular expressions for identifying significant parts of a file (strings, functions, comments). I helped a few people produce these modules for their own use. For example, there was one for a home-grown language that is intended to be used with "Getting Things Done" task lists, and another was for use with newLISP files.

The challenge with the newLISP language was to write a regular expression that could identify functions, the function's name, comments, and strings. Anybody who's ever seen any lisp code knows this means (among other things) looking at a lot of parentheses.

In fact, this is a task that true regular expressions aren't up to. Regular expressions don't do matched, balanced sets of characters like open and close parentheses, where the contents of the matched set is allowed to contain arbitrarily nested pairs of the same.

(There's even a sidebar with a link to a little essay/article by Brian Andresen which he posted here on [tw] (but which we agreed shouldn't go out in email) on the subject of regular expressions and context-free grammars.))

The tutorial walks you through most of the steps involved in creating your own language module for the newLISP scripting language. At the end there is a link for downloading the finished product, and another for a template file to make it easier to create your own language module.

Since it's a BBEdit-related tutorial, the new standard disclaimer applies.

December, 2017
Sun Mon Tue Wed Thu Fri Sat
  1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Jun  Jan


Channel RSS: RSS Feed for channel

is Seth Dillingham's
personal web site.
From now on, ending a sentence with a preposition is something up with which I will not put. - WC