# This grammar is for the 'viewBox' attribute.

:default			::= action => [values]

# G1 stuff.

:start 				::= coordinate_pairs

coordinate_pairs    ::= coordinate_pair coordinate_pair

coordinate_pair		::= coordinate coordinate

coordinate			::= float							action => float
						| integer						action => integer

# G0 stuff.

digit				~ [0-9]
digit_any			~ digit*
digit_many			~ digit+

E					~ [Ee] sign_maybe digit_many
E_maybe				~ E
E_maybe				~

:lexeme				~ integer
integer				~ sign_maybe non_zero digit_any
						| zero

:lexeme				~ float
float				~ sign_maybe digit_many E
						| sign_maybe digit_any '.' digit_many E_maybe
						| sign_maybe digit_many '.' E_maybe
						| sign_maybe non_zero digit_any

non_zero			~ [1-9]

sign_maybe			~ [+-]
sign_maybe			~

zero				~ '0'

# Boilerplate.
# \x{09} => \t. \x{0A} => \n. \x{0D} => \r. \x{20} => \s.

:discard			~ comma
comma				~ ','

:discard			~ whitespace
whitespace			~ [\s]+
