Browsable PNML Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: automata/petri/pnml/standard/core/extracted
Source used for this grammar: Michael Weber, Ekkart Kindler, Christian Stehno, Lom Hillah, Petri Net Markup Language (PNML) schema, RELAX NG implementation of PNML Core Model, pnmlcoremodel.rng, July 2008 [Download]

Summary

Syntax

pnml.element ::=
	[pnml]::pnml.content+
pnml.content ::=
	net.element
net.element ::=
	[net]::(identifier.content nettype.uri (Name? net.labels page.content+ toolspecific.element*))
identifier.content ::=
	[id]::string
nettype.uri ::=
	[type]::"http://www.pnml.org/version-2009/grammar/pnmlcoremodel"
net.labels ::=
	ε
basicobject.content ::=
	Name? toolspecific.element*
page.content ::=
	[page]::(identifier.content (basicobject.content page.labels netobject.content* [graphics]::pagegraphics.content?))
netobject.content ::=
	page.content
	place.content
	transition.content
	refplace.content
	reftrans.content
	arc.content
page.labels ::=
	ε
place.content ::=
	[place]::(identifier.content (basicobject.content place.labels node.content))
place.labels ::=
	ε
transition.content ::=
	[transition]::(identifier.content (basicobject.content transition.labels node.content))
transition.labels ::=
	ε
node.content ::=
	[graphics]::nodegraphics.content?
reference ::=
	[ref]::string
refplace.content ::=
	[referencePlace]::refnode.content
reftrans.content ::=
	[referenceTransition]::refnode.content
refnode.content ::=
	identifier.content reference basicobject.content node.content
arc.content ::=
	[arc]::(identifier.content [source]::string [target]::string (Name? arc.labels [graphics]::edgegraphics.content? toolspecific.element*))
arc.labels ::=
	ε
pagegraphics.content ::=
	nodegraphics.content
nodegraphics.content ::=
	position.element dimension.element? fill.element? line.element?
edgegraphics.content ::=
	position.element* line.element?
simpletext.content ::=
	[text]::string?
annotationstandard.content ::=
	[graphics]::annotationgraphics.content? toolspecific.element*
simpletextlabel.content ::=
	simpletext.content annotationstandard.content
Name ::=
	[name]::simpletextlabel.content
annotationgraphics.content ::=
	offset.element (fill.element? line.element? font.element?)
position.element ::=
	[position]::coordinate.attributes
offset.element ::=
	[offset]::coordinate.attributes
coordinate.attributes ::=
	[x]::integer [y]::integer
dimension.element ::=
	[dimension]::([x]::positiveDecimal.content [y]::positiveDecimal.content)
positiveDecimal.content ::=
	integer
fill.element ::=
	[fill]::([color]::color.type? [gradient-color]::color.type? [gradient-rotation]::("vertical" | "horizontal" | "diagonal")? [image]::string?)
line.element ::=
	[line]::([shape]::("line" | "curve")? [color]::color.type? [width]::positiveDecimal.content? [style]::("solid" | "dash" | "dot")?)
color.type ::=
	string
font.element ::=
	[font]::([family]::string? [style]::string? [weight]::string? [size]::string? [decoration]::("underline" | "overline" | "line-through")? [align]::("left" | "center" | "right")? [rotation]::integer?)
toolspecific.element ::=
	[toolspecific]::([tool]::string [version]::string anyElement*)
anyElement ::=
	(α | string | anyElement)*

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []