[antlr-interest] antlr 3 stuff

Monty Zukowski monty at codetransform.com
Mon Apr 12 07:45:46 PDT 2004


Well, the jwig language is a good example.  One facet of it is really 
just java with two syntactic extensions "show" and "receive".  "show" 
shows a web page.  "receive" recieves http POSTs and GETs.  Those 
keywords actually generate quite a bit of code to handle the web stuff 
behind the scenes, including exception handling, communication errors, 
state preservation.  To you it just looks like your code "show"s and 
continues on until a "receive", where it waits for a reply.  Behind the 
scenes it may have split your method into multiple methods and added 
exception handling or whatever it needs to do to give you that 
illusion.

Domain specific languages are about creating a clean syntax for a 
specific domain instead of forcing your domain problems into only the 
abstractions your language provides (functions or objects or whatever).

Monty
ANTLR consulting
www.codetransform.com


On Apr 12, 2004, at 2:06 AM, matthew ford wrote:

> Could you give some small concrete example of what you are expecting 
> to be
> able to do?
>
> matthew
> ----- Original Message -----
> From: "Monty Zukowski" <monty at codetransform.com>
> To: <antlr-interest at yahoogroups.com>
> Cc: "Monty Zukowski" <monty at codetransform.com>
> Sent: Monday, April 12, 2004 12:58 PM
> Subject: Re: [antlr-interest] antlr 3 stuff
>
>
>> Actually there are two completely separate reasons.  On the antlr side
>> it could help with code generation or with specialized uses of antlr
>> that couldn't be handled by code generation.  It's hard to explain 
>> what
>> those might be and I haven't come up with an example, but it's a
>> solution that I will consider if we run into something nasty that 
>> can't
>> easily be handled by a specialized code generator.  This is, however, 
>> a
>> big deal for antlr and I'm not sure I'll be able to convince Terence
>> and Loring that it is the appropriate thing to do.  It may be an
>> experimental branch I'll have to make myself.
>>
>> But the main thing I would like to see is this support for antlr
>> grammars.  For instance, people could download my C grammar and extend
>> it syntactically with safe pointers or whatever domain specific
>> extensions they would like to add.  And because they are extending the
>> grammar, antlr will enforce certain rules differently so the 
>> programmer
>> doesn't make a huge blunder because they are unfamiliar with
>> disambiguation.
>>
>> However we do it I think the important idea is that building a grammar
>> and extending a grammar are two different modes of development which
>> antlr could handle in different ways to make each mode of development
>> easier.  And if we go with the metamorphic syntactical macro idea then
>> we would be a natural choice for developers making domain specific
>> languages.
>>
>> Monty
>>
>> On Apr 11, 2004, at 4:22 PM, matthew ford wrote:
>>
>>> Hi Monty,
>>> I started reading this paper today.  I got lost in the syntax.
>>> It looks powerful, perhaps too powerful for the average user (me).
>>>
>>> I could think of two uses for this in Antlr 3
>>> i) use this type of macro expansions to support multiple output
>>> languages.
>>> It should make it easier for the power user to add support for 
>>> another
>>> language
>>> by replacing the macro files without touching the Antlr parser
>>> ii) use the pretty printer idea to improve the error reporting in
>>> Antlr and
>>> to tie the final code to the input grammar.
>>>
>>> Is this what you had in mind.
>>> all the best
>>> matthew
>>>
>>> ----- Original Message -----
>>> From: <mzukowski at yci.com>
>>> To: <antlr-interest at yahoogroups.com>
>>> Sent: Thursday, March 18, 2004 9:58 AM
>>> Subject: [antlr-interest] antlr 3 stuff
>>>
>>>
>>>> I'd like to explore the 'language extension' space for antlr 3.  To 
>>>> me
>>>> developing a grammar and extending a grammar are very distinct 
>>>> phases
>>>> of
>>>> antlr coding.  Plenty of people download grammars and just want to
>>>> tweak
>>>> them with actions or a small bit of new syntax.  In "Growing 
>>>> Languages
>>> with
>>>> Metamorphic Syntax Macros" by Claus Brabrand and Michael I.
>>>> Schwartzbach
>>> at
>>>> http://www.brics.dk/bigwig/publications/#macro they present a system
>>>> that
>>>> makes it safe for people to extend languages by not letting them do
>>>> stupid
>>>> things that have huge side effects.  When the time comes I'll 
>>>> re-read
>>>> the
>>>> paper again and try and convince Ter & Loring.
>>>>
>>>> Monty
>>>> www.codetransform.com
>>>>
>>>>
>>>>
>>>> Yahoo! Groups Links
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list