module xml-external

exports
  context-free syntax
    "SYSTEM" SystemLit           -> ExternalID {cons("SystemExternalID")}
    "PUBLIC" PublicLit SystemLit -> ExternalID {cons("PublicExternalID")}
    "PUBLIC" PublicLit           -> PublicID   {cons("PublicID")  }

  lexical syntax

    "\"" ~[\"]* "\""     -> SystemLit
    "'"  ~[\']* "'"     -> SystemLit
    "\"" PubIDChar* "\"" -> PublicLit
    "'"  PubIDChar* "'" -> PublicLit

    [a-zA-Z0-9] -> PubIDChar
    [\ \n\13\-\'\(\)\+\,\.\/\:\=\?\;\!\*\#\@\$\_\%] -> PubIDChar
