Regular LALR grammars

simonh@swidev.demon.co.uk (Simon Huntington)
Tue, 25 May 1993 14:16:57 GMT

          From comp.compilers

Related articles
Regular LALR grammars simonh@swidev.demon.co.uk (1993-05-25)
Re: Regular LALR grammars markh@csd4.csd.uwm.edu (1993-05-26)
| List of all articles for this month |
Newsgroups: comp.compilers
From: simonh@swidev.demon.co.uk (Simon Huntington)
Keywords: LALR, parse, question
Organization: SoftWare Interrupt Developments
Date: Tue, 25 May 1993 14:16:57 GMT

How are regular parser grammars handled by the parser generator? I know
how a grammar using regular expressions (ie. EBNF) can be converted to
BNF, but does a regular-grammar parser use the regular expressions during
closure? ie.


x -> a*


what would the Closure of: x -> . a*
be:


x -> . a
-> a . ?




If this is correct, I assume + and optional [] are handled similarly:




for x -> .a+


closure of: x -> .a+
is: x -> .a


closure of: x -> a+.
is: x -> a.
-> .a




for x -> [a]
closure of: x -> .[a]
is: x -> .a
-> a.






Is this correct or will it have the same effect as transforming the grammar
to BNF-form only?
--
Simon Huntington
Software Interrupt Developments. Leeds, UK.
--


Post a followup to this message

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