[TxMt] language grammar question

Sylvain Benilan s.benilan at claire-language.com
Wed Nov 23 13:26:22 UTC 2005


Hi all,

Have downloaded the demo (1.1b17 (769)) and currently evaluate  
TextMate (vs bbedit/textwrangler) against my needs. It looks like the  
editor I was missing :)

Indeed I work on the support of the CLAIRE language which have  
special construct that are often impossible to describe with other  
editor's syntax facilities. The way TM handles languages/scopes and  
other language inclusion is the best I've ever seen. I could create a  
CLAIRE bundle that, for the first time, handles correctly the syntax  
of CLAIRE (and, trust me, I'm not a regex guru...)!

My question is about a language description design. I tried (but  
failed) to design the grammar such anything that is a valid CLAIRE  
construct is described by a specific pattern and anything else falls  
into the scope of 'invalid.illegal.something'. For instance, in  
CLAIRE, a variable scope is introduced with a 'let' construct :

	let x := 1, y := 2 in (x + y) // valid
	let x := 1, y := 2 *BAD* in (x + y) // invalid : *BAD* illegal

The rule that describe the 'let' construct would look like :

	let <#var-def-list> in <#any>

Which can't be described with a begin/end pattern, unless I can  
reference a repository rule from whitin the begin/end pattern. Can we  
do that ?

Is there a way to acheive this ?

Sylvain



More information about the textmate mailing list