@
@	XML language definition
@	-----------------------
@	by Bjoern Lemke
@
@	(C)opyright 2005 by Bjoern Lemke
@
@	This language defintion can be used with Dragon(c) 
@	for parser code generation

HEADER
IGNORE STRINGVAL
IGNORE CONTENT
SEPIGNORE '\t'
SEPIGNORE '\n'
SEPIGNORE '\r'
SEPIGNORE ' '
SEPSIGN '='
SEPSIGN '/'
SEPSIGN '<'
SEPSIGN '>'
SEPSIGN '?'
SEPSIGN '!'
END

TOKENSET
'='			:	EQU
'<'			:	LT
'>'			:	MT
'/'			:	SLASH
'?'			:	QMARK
'!'			:	EMARK
xml			:	XMLTOKEN
DOCTYPE			:	DOCTYPE
(0|[1-9]*[0-9])		:	INTVAL
[a-zA-Z]*[a-zA-Z0-9_'-']	:	IDENTIFIER
END

PRODUCTIONSET
Start			: 	XMLPreamble XMLDoctype XMLBody
XMLPreamble		:	LT QMARK XMLTOKEN AttrList QMARK MT ; putPreamble
XMLDoctype		:	LT EMARK DOCTYPE IDENTIFIER MT ; putDocType
AttrList		:	AttrList Attr
AttrList		:
Attr			:	IDENTIFIER EQU STRINGVAL ; putAttribute
XMLBody			:	Elem ; putBody
Elem			:	ElementPre ElementContent ElementPost
ElementPre		:	LT IDENTIFIER AttrList ; preElement 
ElementContent		:	MT CONTENT ; conElement
ElementPost		:	ElementList LT SLASH IDENTIFIER MT ; postElement
Elem			:	LT IDENTIFIER AttrList SLASH MT ; putElement
ElementList		: 	ElementList Elem
ElementList		:
END






