39 付録: Augmented BNFのための形式上の構文

この付録が標準を定義する.

ここに使用される記法は、XML1.0仕様によって定義されたEBNF記法に従う。

ABNFにおける語彙の文法

	SelfIdentHeader  ::= '#ABNF' #x20 VersionNumber (#x20 CharEncoding)? ';'
	
	VersionNumber    ::= Nmtoken                           
	     
	CharEncoding     ::= Nmtoken
	
	LanguageCode     ::= Nmtoken
	
	RuleName         ::= '$' ConstrainedName
	
	TagFormat        ::= (NameChar | '/')+
	
	GrammarURI ::= '$' '(' URIC+ ')' /* in the DTD: CDATA */
	
	MimeType         ::= '(' MimeTypeChar+ ')'
	
	LexiconURI ::= '(' URIC+ ')' /* in the DTD: CDATA */
	
	AliasName        ::= '$$' ConstrainedName              
	
	QuotedCharacters ::= '"' CharData '"'
	     
	
	Weight           ::= '/' [0-9]+ '/' | '/' [0-9]* '.' [0-9]+ '/'
	
	RepeatOperator ::= '+' | '*' | '<' [0-9]+ ('-' [0-9]*)? (' ' Probability)? \
    '>'
	
	Probability      ::= '1' | '0' | '1' '.' '0'+ | '0'? '.' [0-9]+
	
	URIRuleRef       ::= '$' '(' URIC+ '#' Name ')'
	
	URIRootRef       ::= '$' '(' URIC+ ')'
	
	AliasRuleRef     ::= AliasName '#' ConstrainedName
	
	AliasRootRef     ::= AliasName
	
	Token            ::= Nmtoken | QuotedCharacters
	
	
	URIC is defined by the uric production of RFC2396.
	It is the set of all characters, which are allowed within a URI.
	
	Name is defined by the XML Name production.
	
	ConstrainedName is a Name, which does not contain a dot, colon or hyphen.
	
	Nmtoken is defined by the XML Nmtoken production.
	
	NameChar is defined by the XML NameChar production. It defines the set of
	characters, which are allowed in an NMTOKEN.
	
	CharData is defined by the XML CharData production.

ABNFにおける構文的な文法

	grammar         ::= header  declarations ruleDefinition*
	
	header ::= SelfIdentHeader localeDecl? modeDecl? rootDecl? tagFormatDecl?
	
	localeDecl      ::= 'language' LanguageCode ';'
	
	modeDecl        ::= 'mode' 'voice' ';' | 'mode' 'dtmf' ';'
	
	rootDecl        ::= 'root' RuleName ';'
	
	tagFormatDecl   ::= 'tag-format' TagFormat ';'
	
	
	declarations    ::= aliasDecl* lexiconDecl* metaDecl*
	
	aliasDecl       ::= 'alias' GrammarURI ('~' MimeType)?  AliasName ';'
	
	lexiconDecl     ::= 'lexicon' LexiconURI ';'
	
	metaDecl        ::= 'meta' QuotedCharacters 'is' QuotedCharacters ';'
	 | 'http-equiv' QuotedCharacters 'is' QuotedCharacters ';'
	
	ruleDefinition ::= scope? RuleName '=' ruleExpansion ';' [VC: unique rule \
    name]
	
	scope           ::= 'private' | 'public'
	
	ruleExpansion   ::= ruleAlternative ( '|' ruleAlternative )*
	
	ruleAlternative ::= Weight? sequenceElement+
	
	sequenceElement ::= subexpansion | subexpansion RepeatOperator
	
	subexpansion    ::= Token
	                    | ruleRef
	                    | tag
	                    | '(' ')'
	                    | '(' ruleExpansion ')'
	                    | '[' ruleExpansion ']'
	                    | Token '!' LanguageCode+
	                    | '(' ruleExpansion ')' '!' LanguageCode
	                    | '[' ruleExpansion ']' '!' LanguageCode
	
	ruleRef         ::= localRuleRef | externalRuleRef | specialRuleRef
	
	localRuleRef    ::= RuleName
	
	externalRuleRef ::= URIRuleRef | URIRootRef | AliasRuleRef | AliasRootRef
	
	specialRuleRef  ::= '$NULL' | '$VOID' | '$GARBAGE'
	
	tag             ::= '{' tagContent '}' | '{!{' tagContent '}!}'
	
	
	tagContent will be defined by the Semantic Interpretation 
	for Speech Recognition specification.