Modular grammars and parsing? (Charles Lakos)
Sat, 4 Jan 1992 02:19:16 GMT

          From comp.compilers

Related articles
Modular grammars and parsing? (1992-01-04)
Re: Modular grammars and parsing? (1992-01-07)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Charles Lakos)
Keywords: parse, question
Organization: University of Tasmania, Australia.
Date: Sat, 4 Jan 1992 02:19:16 GMT

I wish to write a parser to handle an imperative language in a modularised
way. It should reflect three distinct sub-grammars - the statements, the
declarations and the expressions. The "statements" part should "call" the
"declarations" and the "expressions" parts.

The reason for this desire is to be able to cater for different variants
of the language with, say, different forms of expressions. Also, I wish
to use the expressions grammar with a simplified intermediate form of the

I can obviously do the above with a top-down recursive parser, but I was
hoping to be able to do it by modifying an existing yacc + lex (flex)
grammar. Can anyone suggest how it might be done?
Charles Lakos.
Computer Science Department,
University of Tasmania, Phone: +61 02 20 2959
Australia. Fax: +61 02 20 2913

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.