SSI.cgi: A standalone Server Side Includes parser

SSI Dialect

Below is a (semi-formal) grammar for directives. Internally isspace() and isalnum() are used for character classification.

directive := "<!--#" funcname space+ params space? "-->"
params    := param (space+ param)*
param     := key '=' quote value quote

quote     := ['"`]
funcname  := [a-z] | [A-Z] | [0123456789]
key       := [a-z] | [A-Z] | [0123456789]
value     := [a-z] | [A-Z] | [0123456789]
space     := [\t\n\v\f\r ]

An example directive is:

<!--#function param="value" param2="value" -->

See Supported Directives for information on functions and their parameters.