Re: Parsing Roman numbers (Henry Spencer)
Sun, 24 May 1992 00:36:46 GMT

          From comp.compilers

Related articles
Hybrid LR and LL parser tools? (Dennis Brueni) (1992-05-20)
Parsing Roman numbers (1992-05-22)
Re: Parsing Roman numbers (1992-05-23)
Re: Parsing Roman numbers (1992-05-24)
Re: Parsing Roman numbers (1992-05-24)
Re: Parsing Roman numbers (Martin Ward) (1992-05-26)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Henry Spencer)
Keywords: parse
Organization: U of Toronto Zoology
References: 92-05-119 92-05-126
Date: Sun, 24 May 1992 00:36:46 GMT (Joe Armstrong) writes:
>Has anybody got a grammar (preferably yacc) for parsing roman numbers?

I don't understand why you need a parser for this. Roman numerals are
described by the regular expression


(using POSIX 1003.2 regular-expression notation) unless you want to write
in a requirement that they be non-null, which would take a slightly more
complex form to deal with the requirement that at least one of the parts
be non-empty. Variations in notation, like allowing VIIII (which was
legitimate Roman practice at one time) are trivial to accommodate.

>Are they LL(k) LR(k) or what?

Since they can be described by a regular expression, they can be parsed
by a regular grammar, which is a still more restricted form. So the
answer is "all of the above".
Henry Spencer @ U of Toronto Zoology, utzoo!henry

Post a followup to this message

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