Language wiki ; Wikipedia text

Regular Grammar

let Byte        = "\00" .. "\ff"
let Control     = "\00" .. "\1f"
let Printable   = Byte - Control
let Special     = '|[]'
let White       = '\n\r\t'

tok Text        = (Printable - Special | White)+
tok Oper        = Special | "[[" | "]]"

Context Free Grammar

start src
:ign0: Term

let Term0
:nul :

let Term
:link: "[[" Term1 "]]" Term
:term: WikiText1 Term
:ign0: Term0

let WikiText0
:txt : Text
:par1: "["
:par2: "]"

let WikiText1
:par3: "]]"
:ign0: WikiText

let WikiText
:opt : "|"
:ign0: WikiText0

let Term1
:txt : WikiText0 Term1
:link: "[[" Term1 "]]" Term1
:opt : "|" Term1
:ign0: Term0

