[antlr-interest] Value types - can't be set to null in C#

Harald Mueller harald_m_mueller at gmx.de
Mon Jan 7 14:06:04 PST 2008


Hi -

My "idea" is that there is a small bug in the initialization ... Johannes - HELP!!!???
What might work - but it's more a hack - is to switch on output=AST - then the generated return class could work ...
Or, for the moment, you declare your return value as DateTime?, which can be set to null.
However, both these weird ideas are straws ... the init of a strcut value should be correct(ed).

Regards
Harald


-------- Original-Nachricht --------
> Datum: Mon, 7 Jan 2008 12:28:33 -0800 (PST)
> Von: Shawn Poulson <spoulson3 at yahoo.com>
> An: Harald Mueller <harald_m_mueller at gmx.de>, antlr-interest at antlr.org
> Betreff: Re: [antlr-interest] Value types - can\'t be set to null in C#

> 
> --- Harald Mueller <harald_m_mueller at gmx.de> wrote:
> > datetime returns [DateTime value = DateTime.Now]
> 
> Thanks for the quick reply.  This had actually eliminated one of the
> two errors.  However, it still generates one error from the the C# code
> I quoted for the "prog" rule.
> 
> It seems I still need to initialize the "dt" value in the prog rule:
> 
> ----- 8< ----- 8< -----
> prog: dt=datetime {Debug.WriteLine("datetime=" +
> $dt.value.ToString());};
> ----- 8< ----- 8< -----
> 
> Any ideas?
> 
> ---
> Shawn Poulson
> spoulson at explodingcoder.com

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger?did=10


More information about the antlr-interest mailing list