Syntax diagram confusion

57 Views Asked by At

Have a look at the syntax diagram for the escape language:

I read the second set of transitions as follows:

The state transitioned to by the \ symbol can transition to the accepting state if the next symbol is not in the newline or hex digit languages (or in other words, is in any language but the newline or hex digit languages).

The state transitioned to by the \ symbol can transition to a different state if the next symbol is in hex digit language.

Isn't this contradictory?

1

There are 1 best solutions below

0
On

First off, there is no contradiction in the fact that different symbols lead to distinct states in an automaton. That is the very nature of these devices. So your two assertions do not bear any contradiction.

However, they do not really capture the referenced diagram.

  1. There is no "accepting state" here. The escape graph is only a part of the big graph. If the next symbol after the \ state is not a hex digit or a newline, then the next state is "not newline or hex digit," not an accepting one; railroad/syntax diagrams like this one do not have accepting states at all.
    After this, the next symbol will take you out of this part of the diagram to whatever part is entered at the exit point on the right hand side.
  2. The "different state" transitioned to with a hex digit is the state "hex digit."

While this diagram is similar to a finite automaton, it is really something a little different.