>724400 Nichtterminalsymbole
Railroad Diagrams Non-Terminals
- Railroad diagram
plus sign
.-.
|-|--->( + )--->|-|
'-'double plus
.-----------. .-----------.
|-|--->| plus sign |--->| plus sign |--->|-|
'-----------' '-----------'
A square box can contain the name of a category, which means that a text of the named category must be inserted in place of the box. In other words, the named production can be used in place of the square box.
- After inserting the production for »plus sign«
double plus
.-------------------. .-------------------.
| .-. | | .-. |
|-|--->||-|--->( + )--->|-||--->||-|--->( + )--->|-||--->|-|
| '-' | | '-' |
'-------------------' '-------------------'- After inserting the production for »plus sign« and simplification
double plus
.-. .-.
|-|--->( + )--->( + )--->|-|
'-' '-'
Such a square box is also called a non-terminal (or non-terminal symbol ).
The category double plus thus includes the text »++«.
- A double plus
++
- A terminal
.-.
( + )
'-'- A non-terminal
.-----------.
| plus sign |
'-----------'
Practice Questions
? Practice question
- Railroad diagram
a
.-.
|-|--->( 1 )--->|-|
'-'first
.---. .-.
|-|--->| a |--->( . )--->|-|
'---' '-'
Which text belongs to the category first described above?