All pastes #423494 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-04 06:24 UTC
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)+;