EBNFによる文法です。基本的に、大文字で始まるシンボルがXMLの要素に対応します。
SYMBOL ::= <$マーク、数字、英字、アンダースコアが1個以上続いたもの> FLOATING_POINT ::= <Javaの浮動点リテラル> Bulletml ::= ( "type" "=" ( SYMBOL | "vertical" | "horizontal" ) ";" )? ( Bullet | Action | Fire )* Bullet ::= "bullet" SYMBOL? Direction? Speed? ( action | ";" ) action ::= Action | ActionRef Action ::= "action" SYMBOL? ( "{" actionBodyItem* "}" | actionBodyItem | ";" ) actionBodyItem ::= ChangeDirection | Accel | Vanish | ChangeSpeed | Repeat | Wait | Fire | FireRef | Action | ActionRef Fire ::= "fire" SYMBOL? Direction? Speed? ( Bullet | BulletRef ) ChangeDirection ::= "changeDirection" Direction_Omittable Term ";" ChangeSpeed ::= "changeSpeed" Speed_Omittable Term ";" Accel ::= "accel" Horizontal? Vertical? Term ";" Wait ::= "wait" Expression ";" Vanish ::= "vanish" ";" Repeat ::= "repeat" Times action Direction ::= "direction" ( "aim" | "absolute" | "relative" | "sequence" )? Expression Direction_Omittable ::= "direction"? ( "aim" | "absolute" | "relative" | "sequence" )? Expression Speed ::= "speed" ( "absolute" | "relative" | "sequence" )? Expression Speed_Omittable ::= "speed"? ( "absolute" | "relative" | "sequence" )? Expression Horizontal ::= "horizontal" ( "absolute" | "relative" | "sequence" )? Expression Vertical ::= "vertical" ( "absolute" | "relative" | "sequence" )? Expression Term ::= "term" Expression Times ::= Expression BulletRef ::= "bulletRef" SYMBOL params? ";" ActionRef ::= "actionRef" SYMBOL params? ";" FireRef ::= "fireRef" SYMBOL params? ";" params ::= "(" ( Param ( "," Param )* )? ")" Param ::= Expression Expression ::= expression expression ::= expression "+" term | expression "-" term | term term ::= term "*" factor | term "/" factor | term "%" factor | factor factor ::= "(" expression ")" | SYMBOL | FLOATING_POINT | "-" factor
Java形式のコメントも使えます。