BNF, EBNF, ABNFBNF, EBNF, ABNF

Posted at 2011. 3. 15. 10:39 | Posted in Etc

http://www.ietf.org/rfc/rfc5234.txt
http://opensourceforge.tistory.com/190
http://en.wikipedia.org/wiki/Augmented_Backus-Naur_Form

BNF(Backus Naur Form) 간단 정리
기본 형식
<symbol> ::= __expression__

EBNF(Extended Backus Naur Form) 간단 정리
기본 형식
symbol = __expression__

ABNF(Augmented Backus Naur Form) 간단 정리

기본 형식
rule = definition; comment CR LF

rule 은 case-insensitive한 nonterminal이다.
definition은 rule의 연속으로 구성되며 CR LF 로 끝난다.
주석은 ";" 로 시작한다. 

rule 이름에 BNF의 Angle brackets (“<”, “>”)은 필요 없다.

Terminals are specified by one or more numeric characters.
Numeric characters는 %로  기술된다. (b = binary, d = decimal, and x = hexadecimal)
연속으로 오는 경우는 "."으로 연결한다. 
CR => %d13 %x0D
CR LF => %d13.10

Literal text는  case-insensitive한 (US-)ASCII 문자들로 구성된 문자열이며 (")로 감싸진다.
대소문자를 구분하기 위해서는 Numeric character 표현을 사용하라. 
“aBc” => %d97 %d66 %d99.

Use *element for zero or more elements, 1*element for one or more elements, and 2*3element for two or three elements.
*element : 0회 이상 반복
1*element: 1회 이상 반복
2*3element: 2회 또는 3회 반복 

Use 2DIGIT to get two numeric digits and 3DIGIT to get three numeric digits. (DIGIT is defined below under 'Core rules'.)
2DIGIT: "00" "12" "23" ...
//