home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!ukma!cs.widener.edu!eff!world!iecc!compilers-sender
- From: Michael Dyck <dyck@cs.sfu.ca>
- Subject: parser-generators for RRPGs
- Reply-To: Michael Dyck <dyck@cs.sfu.ca>
- Organization: Compilers Central
- Date: Thu, 28 Jan 1993 02:02:26 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <93-01-206@comp.compilers>
- Keywords: parse, tools, question, comment
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 28
-
- Regular right-part grammars (RRPGs) are a kind of phrase structure grammar
- akin to context-free grammars (CFGs). In each production of an RRPG, the
- LHS is a single non-terminal (as in a CFG), but the RHS is a regular
- expression (or finite automaton) over the symbol set (rather than simply a
- sequence of symbols, as in a CFG).
-
- There are various notations for writing RRPGs (or slight restrictions
- thereof), many called "extended BNF".
-
- For example (from Modula-2):
-
- if-statement = "IF" condition "THEN" statements
- { "ELSIF" condition "THEN" statements }
- [ "ELSE" statements ]
- "END"
-
- It seems like most grammars presented for human consumption are RRPGs, but
- most grammars presented for machine consumption are CFGs. What
- parser-generators are available that accept some form of RRPG?
-
- -Michael Dyck, dyck@cs.sfu.ca
- [I've seen occasional references to something called eyacc, which appeared
- to be an EBNF version of yacc. Is it not the case that RRPGs can be
- mechanically translated to CFGs, in which case a preprocessor for a normal
- parser generator might make sense? -John]
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-