In: Computer Science
Syntax Diagram (also knows as Railroad Diagrams) are used to represent rules(as syntax means set of rules!) for a particular set of strings that the system is going to encounter or parser is going to read to be able to identify the instructions already defined in the instruction set of the machine for compilation purposes.More widely used alongside BNF(Backus Naur Form) in theory of computation.However, these are also used in databases as an aid to schema definition.
Syntax Diagrams are simple to interpret and hence widely used.Any diagram is read from left to right with the capability to advance from the node by fulfilling the criteria specified by the node.
In this case,our first criteria is to find an uppercase letter(A-Z) followed by 0 or more uppercase letter(A-Z) or digit(0-9).Direction of arrows signify the flow or the movement fro left to right.Simply connected line signifies no criteria to be fulfilled and horizontally parallel lines singnify choice (i,e. either route can be taken).
Required Syntax Diagram goes as:
(Note that in cases
where it becomes complicated to depict the rules in one
diagram,the diagram is split up into several parts with their
label,also for characters A-Z, shorthand notation can be used as
'...' instead of showing all 26 alphabets)