[antlr-interest] Generate Language examples from ANTLR Grammar
"Paul Bouché (NSN)"
paul.bouche at nsn.com
Thu Feb 5 05:31:39 PST 2009
Hi,
I am wondering if it is already possible to generate language examples
from a given ANTLR grammar. I.e. in language theory we say that for a
given grammar /G/ the language that it defines is denoted by L(/G/).
An example for the very simple grammar /simpleLetters/
start : '"' LetterSequence '"';
LetterSequence : LETTER*;
LETTER : 'a'|'b'|'c';
the language it defines would be
L(/simpleLetters/) = { "", "a", "b", "c", "ab", "ac", "aa", "aaa",
"aab", "aac", "aba", "abb", "abc", ... }
I of course could try all strings of all combinations of unicode chars
of length /n/, but maybe there is a better way?
Best,
Paul
--
Paul Bouché
Voice: +49 30 590080-1284
Nokia Siemens Networks GmbH & Co. KG, An den Treptowers 1, 12435 Berlin, Germany
Sitz der Gesellschaft: München / Registered office: Munich
Registergericht: München / Commercial registry: Munich, HRA 88537
WEEE-Reg.-Nr.: DE 52984304
Persönlich haftende Gesellschafterin / General Partner: Nokia Siemens Networks Management GmbH
Geschäftsleitung / Board of Directors: Lydia Sommer, Olaf Horsthemke
Vorsitzender des Aufsichtsrats / Chairman of supervisory board: Lauri Kivinen
Sitz der Gesellschaft: München / Registered office: Munich
Registergericht: München / Commercial registry: Munich, HRB 163416
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090205/1b9ded4c/attachment.html
More information about the antlr-interest
mailing list