Thu, 18 Oct 90 01:39:40 -0500

Related articles |
---|

Precise definition of "syntax diagram" hankd@ecn.purdue.edu (1990-10-18) |

Newsgroups: | comp.compilers |

From: | hankd@ecn.purdue.edu (Hank Dietz) |

Keywords: | parse, LL(1) |

Organization: | Purdue University Engineering Computer Network |

References: | <9010091533.AA02386@apple.com> <9010101445.AA06181@dynamo.ecn.purdue.edu> <1990Oct16.015524.25858@comp.vuw.ac.nz> |

Date: | Thu, 18 Oct 90 01:39:40 -0500 |

In article <1990Oct16.015524.25858@comp.vuw.ac.nz> lindsay@comp.vuw.ac.nz (Lindsay Groves) writes:

*>In article <9010101445.AA06181@dynamo.ecn.purdue.edu>,*

*>hankd@dynamo.ecn.purdue.edu (Hank Dietz) writes:*

*>|> Pascal is generally defined using a set of syntax diagrams which, by*

*>|> definition, means the language can be recognized using LL(1).*

*>*

*>You must be using a strange definition a syntax diagrams if they can*

*>only describe languages that have LL(1) grammars.*

The rule I have heard is that a syntax diagram is literally a flowchart

for an LL(1) parser where the branching decisions are obvious, hence

the branch decision nodes are omitted. This was certainly true of all

syntax diagrams I saw earlier, but I have more recently seen "syntax

diagrams" which are no more constrained than arbitrary CFGs + looping,

and differ from them only in having arrows between symbols.

E.g., is the following a legal syntax diagram for S -> S a, S -> b?

S --+-->[S]---->(a)--+-->

| |

+-->(b)--------->+

I believe it isn't. Right or wrong? References, anyone?

-hankd@ecn.purdue.edu

PS: The unconstrained form looks more like a RTN to me....

--

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.