[antlr-interest] Antlr and Visual Studio

Harald Mueller harald_m_mueller at gmx.de
Fri Dec 21 02:09:42 PST 2007


Hi -

Actually, I ran into the same problem (IS THIS A BUG??).
The only solution I found was to use ANTLRFileStream, which is very fast.

(When looking into ANTLR's sources, I see that all code is based on ANTLRStringStream: Doesn't that mean that

(a) the problem with ANTRLInputStream is local to that class? - and the code seems simple enough to find any potential problem ...

(b) ANTLR now always will want to read a file completely before working with it? What does that mean for reading e.g. GB-sized files?? or having parsers in pipelines with the expectation that they will emit something when "enough input" (for a rule?) has been read - is all this "not-intended usage"?

Regards
Harald

-------- Original-Nachricht --------
> Datum: Thu, 20 Dec 2007 12:58:10 -0500
> Von: "Dykes, Gene" <GDykes at acsisinc.com>
> An: antlr-interest at antlr.org
> Betreff: [antlr-interest] Antlr and Visual Studio

> We have this application in production that uses Antlr 2.7.  (Antlr was
> a major factor in the creation of this successful product.)  While
> upgrading the application, I also tried upgrading to Antrl 3.0.1, only
> to find that the CSharp runtime seems to be broken.  Is this true?  Does
> nobody use Antlr 3.0.1 with C# on Visual Studio?  The symptom is that
> the ANTRLInputStream constructor hangs.  I found while googling that a
> couple others had reported the same problem, but there appeared to be no
> response offering a solution.
> 
>  
> 
> Interestingly, one of my google hits was some source code written by
> Kunle Odutola that contains this test case (note the name of the
> method):
> 
>  
> 
> [Test]
> 
>                 public void TestANTLRInputStreamConstructorDoesNotHang()
> 
>                 {
> 
>                                 Encoding encoding = Encoding.Unicode;
> 
>                                 byte[] grammarStrBuffer =
> encoding.GetBytes(grammarStr);
> 
>                                 MemoryStream grammarStream = new
> MemoryStream(grammarStrBuffer);
> 
>  
> 
>                                 ANTLRInputStream input = new
> ANTLRInputStream(grammarStream, encoding);
> 
>                 }
> 
>  
> 
> Using that same sequence of statements hangs when I try it.
> 
>  
> 
> If somebody knows the status of this problem or could point out what
> bone-headed thing I might be doing wrong, I would appreciate it.
> 
>  
> 
>  -- gene
> 
> 
> __________________
> Any e-mail communication originating from Acsis Inc (or Acsis GmbH), is
> intended for business purposes only and its use is explicitly intended for
> the addressed recipient only.  This e-mail communication may also contain
> information that may be considered confidential or protected by law.  If you
> received this e-mail and are not the intended recipient, you are hereby
> formally notified that any use (including the copying or distributing) of this
> communication, in part, or in whole, is strictly prohibited by law.  If the
> case, you are formally requested to then notify the originator at Acsis
> Inc. (or Acsis GmbH), by return e-mail and to delete this e-mail from your
> mail system.  Additionally, unless explicitly designated this e-mail does not
> constitute to represent a formal binding contract under law.  Finally, the
> receipt of this e-mail communication does not constitute a consent to the
> use of the originators contact information for any direct marketing
> purposes or for transfers of data to third parties.

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the antlr-interest mailing list