Grammar to automation translation at runtime (NOT at compile time)?

sarkar_soumen@yahoo.com (Soumen Sarkar)
14 May 2003 00:49:00 -0400

          From comp.compilers

Related articles
Grammar to automation translation at runtime (NOT at compile time)? sarkar_soumen@yahoo.com (2003-05-14)
RE: Grammar to automation translation at runtime (NOT at compile time) qjackson@shaw.ca (Quinn Tyler Jackson) (2003-05-16)
Re: Grammar to automation translation at runtime (NOT at compile time) sreeni@viswanadha.net (Sreenivas Viswanadha) (2003-05-18)
Re: Grammar to automation translation at runtime (NOT at compile time) vmakarov@redhat.com (Vladimir Makarov) (2003-05-18)
Re: Grammar to automation translation at runtime (NOT at compile t vbdis@aol.com (2003-05-18)
Re: Grammar to automation translation at runtime (NOT at compile t codeworker@free.fr (2003-05-18)
Re: Grammar to automation translation at runtime (NOT at compile t oliver@zeigermann.de (Oliver Zeigermann) (2003-05-18)
| List of all articles for this month |

From: sarkar_soumen@yahoo.com (Soumen Sarkar)
Newsgroups: comp.compilers
Date: 14 May 2003 00:49:00 -0400
Organization: http://groups.google.com/
Keywords: history, parse
Posted-Date: 14 May 2003 00:49:00 EDT

All,


Currently the parser generator technology allows grammar to automation
translation in compile time only. For example if I have to validate a
text stream that I am receiving, I can not load a grammar file
dynamically and validate the text stream. Please note that this has
been already accomplished in the world of XML. I can load a XML schema
(can be compared to grammar) and validate a XML document
dynamically. I understand this is possible in XML because of the
standardization of syntax (since XML is a meta language) and parser
reuse at meta language/language level for XML based languages. This
important syntactic standradization makes dynamic XML validation (in
the sense of a language conforming to a grammar) possible. I could be
wrong if XML schemas are refused to be considered as a grammar but
then there are many XML validation technologies are available.


Java/C# offer reflection features which allows some programs to be
authored /specified both at compile time or runtime.


Therefore, my question is if there is any thought/effort to make the
grammar to automation (a computational service) make available at run
time? I am interested in CFG based generators (current impls are
JavaCC, ANTLR).


If this would be possible, I just have to supply a grammar file at run
time to validate an ASCII stream -- I do not have to make a commitment
at compile time. Only commitment I make that I will supply a valid
grammar file to which the ASCII stream is validated (no nore grammar
to Java/C# codegen/compile/write code on top of generated code).


I took a look at Recursive Adaptive Grammar (which blurs the
distinction between grammar vs automation) and it may hold certian
potential towards dynamic grammar based validation.


Thanks,
Soumen Sarkar.
[Thirty years ago languages like IMP72 and EL/1 let you change the
syntax on the fly by including BNF-like stuff in the input. They
worked OK, but they didn't turn out to be useful, and they all
disappeared. The main effect was to make programs unreadable, since
no two programs used the same syntax. More generally, the set of
problems that require parsing a language where you can't specify the
grammar in advance seems to be vanishingly small other than contrived
examples. -John]



Post a followup to this message

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