Branches (Branches), lesson, page 724620
https://www.purl.org/stefan_ram/pub/branches_programming (permalink) is the canonical URI of this page.
Stefan Ram
Python Course

>724401 Verzweigungen

Railroad Diagrams Branchings

Production
              .-.
|-|--->.---->( X )--->.--->|-|
| '-' ^
| .-. |
'---->( Y )----'
'-'

When passing a branching, any  branch can be chosen (as long as there is no movement against an arrow direction).

We show two possible results of the above production.

Result
X
Result
Y
The text set described by the diagram
X, Y

Each time a non-terminal is passed, a different text  can be chosen.

Production

B

.-.
|-|--->.---->( X )--->.--->|-|
| '-' ^
| .-. |
'---->( Y )----'
'-'

C

.---. .---.
|-|--->| B |--->| B |--->|-|
'---' '---'

A possible result of the production C
XY
The text set described by production C
XX, XY, YX, YY

Railroad diagrams are used to describe text sets  in a structured manner. (A text set is a collection of different texts.)

Practice Questions

?   Practice Question

Production
             .-.
|-|--->.--->( A )--->.--->|-|
| '-' ^
| .-. |
'--->( B )----'
| '-' ^
| .-. |
'--->( C )----'
'-'

Give exactly one  possible result of the above production rule.

?   Practice Question 1

Production
             .-.
|-|--->.--->( A )--->.--->|-|
^ '-' |
| .-. |
'----( B )<---'
'-'

Give exactly one  possible result of the above production rule that includes at least two characters.

NB: There now is an arrow pointing to the left !

?   Practice Question 2

Production
            .-----------.
|-|--->.--->| character |--->.--->|-|
^ '-----------' |
| |
'---------------------'

Give exactly one  possible result of the above production rule that includes at least two characters.

?   Practice Question 3

Production
        .-.                                .-. 
|-|--->( " )--->.------------------->.--->( " )--->|-|
'-' ^ | '-'
| .-----------. |
'---| character |<---'
'-----------'

Give exactly one  possible result of the above production rule that contains as few characters as possible.

?   Practice Question 4

Give exactly one  possible result of the above production rule (from practice question 3) that comprises four characters.

 

About this page, Impressum  |   Form for messages to the publisher regarding this page  |   "ram@zedat.fu-berlin.de" (without the quotation marks) is the email address of Stefan Ram.   |   A link to the start page of Stefan Ram appears at the top of this page behind the text "Stefan Ram".)  |   Copyright 1998-2020 Stefan Ram, Berlin. All rights reserved. This page is a publication by Stefan Ram. relevant keywords describing this page: Stefan Ram Berlin slrprd slrprd stefanramberlin spellched stefanram724620 stefan_ram:724620 Branches Stefan Ram, Berlin, and, or, near, uni, online, slrprd, slrprdqxx, slrprddoc, slrprd724620, slrprddef724620, PbclevtugFgrsnaEnz Explanation, description, info, information, note,

Copyright 1998-2020 Stefan Ram, Berlin. All rights reserved. This page is a publication by Stefan Ram.
https://www.purl.org/stefan_ram/pub/branches_programming