You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
476 B
Plaintext
33 lines
476 B
Plaintext
grammar Bristlecode
|
|
rule root
|
|
(tag / text)+ <RootNode>
|
|
end
|
|
|
|
rule text
|
|
(!tag .)+ <TextNode>
|
|
end
|
|
|
|
rule tag
|
|
(bold) <TagNode>
|
|
end
|
|
|
|
##############################
|
|
# bold
|
|
##############################
|
|
|
|
rule bold
|
|
bold_open
|
|
((!bold_close .)+ <TextNode>)
|
|
bold_close
|
|
<BoldNode>
|
|
end
|
|
|
|
rule bold_open
|
|
'[b]' <BoldOpenNode> / '[B]' <BoldOpenNode>
|
|
end
|
|
|
|
rule bold_close
|
|
'[/b]' <BoldCloseNode> / '[/B]' <BoldCloseNode>
|
|
end
|
|
end
|