Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BSON | terminal and non-terminal

Tags:

bson

Reading through the BSON specification I came across the terminal and non-terminal terms in it. For example:

Valid BSON data is represented by the document non-terminal.

<...>

The following basic types are used as terminals in the rest of the grammar.

What do “terminal” and “non-terminal” mean in the context of the BSON specification?

like image 541
Shamaoke Avatar asked Nov 03 '12 05:11

Shamaoke


1 Answers

In formal grammar, a terminal symbol is one that cannot be broken down further, e.g. a literal character or digit (but not necessarily as it depends on the grammar), a non-terminal symbol is a symbol that can be reduced further by the production rules (the rules that define the grammar) until it's reduced to a terminal symbol, for example, in the following grammar integer is a non-terminal symbol, 0-9 are terminal symbols.

<integer> ::= ['-'] <digit> {<digit>}  
<digit> ::= '0' | '1' | '2' | > '3' | '4' | '5' | '6' | '7' | '8' | '9'

http://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols

like image 183
iabdalkader Avatar answered Oct 21 '22 10:10

iabdalkader