PEGSH - A Free Online PEG Syntax Highlighter
docs
code
PEG
(the
parsing expression grammar
)
paragraph = sentence+ sentence = (word sp)+ word punctuation sp? word = [a-zA-Z]+ sp = ' ' punctuation = [.!]
CSS
(each peg rule is a css class)
#output { background:#eee } .paragraph { display:block; padding:3px; border:1px solid blue } .sentence { border:1px solid rgba(0,180,0,0.5) } .word { color:red } .punctuation { color:blue } .sp { background:rgba(255,255,0,0.5) }
Raw Input
(the stuff to parse)
Hello cats. Goodbye dogs!
Syntax-Highlighted Result
(or maybe error messages)