Re: [Gogo] Grammar and commands

2009-08-24 Thread Guillaume Nodet
On Tue, Aug 25, 2009 at 00:45, David Savage wrote: > That's great :) I've uploaded a minor update to the issue which allows > closures and array declarations to contain line returns i.e. > > foo = { > echo $it > } > > However my antlr breaks down at this time of night trying to get it to > suppo

Re: [Gogo] Grammar and commands

2009-08-24 Thread David Savage
That's great :) I've uploaded a minor update to the issue which allows closures and array declarations to contain line returns i.e. foo = { echo $it } However my antlr breaks down at this time of night trying to get it to support foo = { echo $it echo $it again } Possibly all will become

Re: [Gogo] Grammar and commands

2009-08-24 Thread Guillaume Nodet
As a starting point for the discussion, I've started writing an ANTLR grammar and I attached it to FELIX-1521: https://issues.apache.org/jira/secure/attachment/12417521/gogo.g On Mon, Aug 24, 2009 at 15:55, David Savage wrote: > Hi Peter, > > I absolutely agree with you about parser size, but

Re: [Gogo] Grammar and commands

2009-08-24 Thread David Savage
Hi Peter, I absolutely agree with you about parser size, but I wonder if this might be an optimization? The concern is that in the urge to optimize early we miss some subtle parts of the language specification. In theory, the existence of the language - verified via a grammar tool such as ANTLR,

Re: [Gogo] Grammar and commands

2009-08-24 Thread Peter Kriens
One of the key reasons for the grammar is that the parser could be trivial. You basically only need a token and string parser and recursively parse blocks enclosed by [<({[], etc. A trivial grammar that is very similar to TCL. Though it is a nice exercise to turn it into an ANTLR grammar, t

Re: [Gogo] Grammar and commands

2009-08-21 Thread David Savage
On Fri, Aug 21, 2009 at 4:50 PM, Guillaume Nodet wrote: > Right, I think it makes sense to define the grammar. > But the grammar just defines ... well, the syntax, not the semantics. > I think most of the discussion is about what semantic to apply on the > grammar. Hmmm but having agreed on a synt

[Gogo] Grammar and commands

2009-08-21 Thread Guillaume Nodet
Right, I think it makes sense to define the grammar. But the grammar just defines ... well, the syntax, not the semantics. I think most of the discussion is about what semantic to apply on the grammar. For commands, imnsho, I think we should discuss and encourage the use of what I committed in ht