[antlr-interest] minimalistic grammar approach

Arturo Hernandez arthernan at hotmail.com
Tue Jun 14 13:30:53 PDT 2011


Sergiy and Researcher,
Thanks for your answers.
The twist in this case is that I want to get the grammar first and then the language should be very easy. I have gathered the utility of having semicolons, thanks for that.
I would rather not start from scratch if I don't have to. I think I could potentially find simple expression grammar in ANLTR.
I'll be posting some beginning grammar later today.

Arturo
-- I want to be part of the code generation! --


> Date: Tue, 14 Jun 2011 22:58:16 +0300
> Subject: Re: [antlr-interest] minimalistic grammar approach
> From: sergiy.dubovik at gmail.com
> To: arthernan at hotmail.com
> 
> Hi,
> 
> I usually start with examples of target language I want to develop.
> Write how to declare variables, structures, functions. Then identify
> terminals: strings, integers, floats, operators, identifiers, keywords
> and so on.
> I start from arithmetic expressions, they are quite tricky because of
> precedence. Then define boolean expressions, variable declaration,
> assignments, functions. This process is very iterative you can make it
> as complex as you wish. Use AntlrWorks, it can quickly run your
> grammar on test input, also it can show how AST will look like in
> debugger mode.
> 
> It's much easier to start with a grammar which has ending symbol for
> each statement, in C it's ";". Ruby like grammars are more difficult
> (at least i spent several days figuring out how to make it working)
> because of new line which can be separator and whitespace.
> 
> Can't promise this will work for you.
> 
> br,
> Sergiy
> 
> On Tue, Jun 14, 2011 at 8:23 PM, Arturo Hernandez <arthernan at hotmail.com> wrote:
> >
> > Hello everybody,
> > I am making a spec for code generation that I am intending to use on my own Information Systems development
> > My first step is to create a minimalistic implementation independent (II) grammar with support for record types, nested records, typed arrays, function calls and basic loop and contol logic. Such that expressions in a language that implemented this II grammar would be easy to translate to any language. And also easier to manipulate.
> > Hash arrays would also be supported and the typical collection loops. Would also be supported.
> > Does anyone here have any suggestions. Is there such a thing or close to it already implemented in ANTLR.
> >
> > Any info will be greatly appreciated.
> >
> > Arturo-- Object orientation works by hiding data behind more complex data. --
> >
> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
> > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> >
 		 	   		  


More information about the antlr-interest mailing list