rendered paste body%header%
GRAMMARTYPE = "LL"
DESCRIPTION = "A grammar for a simple arithmetic language."
AUTHOR = "Per Cederberg, <per at percederberg dot net>"
VERSION = "1.0"
DATE = "10 June 2003"
LICENSE = "Permission is granted to copy this document verbatim in any
medium, provided that this copyright notice is left intact."
COPYRIGHT = "Copyright (c) 2003 Per Cederberg. All rights reserved."
%tokens%
CHARS = <<[^{}(?=<%)(?=%>)]*>>
STARTCODEBLOCK = "<%"
ENDCODEBLOCK = "%>"
BOOSTARTINDENT = "{"
BOOENDINDENT = "}"
WHITESPACE = <<[ \t\n\r]+>> %ignore%
%productions%
SCRIPT = TEMPLATE+;
TEMPLATE = TEMPLATEBLOCK|BOOCODEBLOCK;
TEMPLATEBLOCK = CHARS|BOOSTARTINDENT|BOOENDINDENT;
BOOCODEBLOCK = STARTCODEBLOCK BOOCODE+ ENDCODEBLOCK;
BOOCODE = BOOSTARTINDENT|CODE|BOOENDINDENT;
CODE = CHARS;