>724399 Terminalsymbole
Railroad Diagrams Terminals
Railroad Diagrams describe the structure of a program without also indicating its meaning.
They make it possible to judge whether a text is a program and to break a program down into individual parts.
Productions
Structure diagrams consist of productions.
A production (also called a production rule ) consists of symbols connected by arrows.
- A production
.-.
|-|--->( A )--->|-|
'-'
Interpretation of a Production
First an (imaginary or real) blank sheet of paper is prepared.
You enter the production at the top left at the entrance »|-|« and must leave the production through the exit »|-|« at the top right.
You are not allowed to move against the direction of an arrow »--->« or to leave the production via the entrance.
If you move over a rounded box with a character (a terminal , also called a terminal symbol ), then you write this character on the sheet of paper (behind the last character written so far or at the top left of the sheet if no character has been written yet). For example, you write an »A« on the sheet when you move over the »( A )« symbol.
What is on the sheet after leaving the production via the exit »|-|« is what we call a result of the production.
- The text set of the above production (the character "A")
A
Practice Questions
? Practice Question
- Production
.-.
|-|--->( A )--->|-|
'-'
What is the result of the above production?
? Practice Question
- Production
.-.
|-|--->( B )--->|-|
'-'
What is the result of the above production?
? Practice Question
- Production
.-. .-.
|-|--->( B )--->( C )--->|-|
'-' '-'
What is the result of the above production?
For Linguists *
Railroad Diagrams depict context-free phrase structure grammars.