rendered paste body%header%
GRAMMARTYPE = "LL"
DESCRIPTION = "Grammar for DiamondBindings templating language"
AUTHOR = "mrdunn@gmail.com"
VERSION = "1.0"
DATE = "10 June 2003"
LICENSE = "No distribution"
COPYRIGHT = "Copyright (c) Matthew Dunn All rights reserved."
%tokens%
allChars = <<[\s\S]>>
startTextBlock = "<!"
endTextBlock = "!>"
startCodeBlock = "<%"
endCodeBlock = "%>"
dollarSign = "$"
openBrace = "{"
closeBrace = "}"
%productions%
Template = (TextBlock|CodeBlock)+;
TextBlock = startTextBlock TextBlockText endTextBlock;
CodeBlock = startCodeBlock CodeBlockText endCodeBlock;
TextBlockText = (allChars|InterpolationBlock|dollarSign|openBrace|closeBrace|startCodeBlock|endCodeBlock)+;
InterpolationBlock = dollarSign openBrace InterpolationBlockText closeBrace;
InterpolationBlockText = (allChars|startTextBlock|endTextBlock|dollarSign|openBrace|startCodeBlock|endCodeBlock)+;
CodeBlockText = (allChars|startTextBlock|endTextBlock|dollarSign|openBrace|closeBrace)+;