Locks was Re: [antlr-interest] ANTLR 3.0ea1 and ANTLRWorks 1.0ea1 released!

Matthew Ford matthew.ford at forward.com.au
Thu Jun 2 14:31:26 PDT 2005


A basic problem with Java file locks is that you cannot lock a file before
it exists and has been opened.
I gave up on Java locks and wrote my own lock table (hash table on the
cononical filename)
Works well on Windows and Linux provided only multiple threads one java
application are
contending for the locks.
matthew
P.S. code is available if you want it.

----- Original Message ----- 
From: "Jean Bovet" <antlr-list at arizona-software.ch>
To: "Micheal J" <open.zone at virgin.net>
Cc: "ANTLR Interest" <antlr-interest at antlr.org>
Sent: Friday, June 03, 2005 4:04 AM
Subject: Re: [antlr-interest] ANTLR 3.0ea1 and ANTLRWorks 1.0ea1 released!


> >
> > 1. Build & Debug should provide a sensible default for the location of
> > working/generated files.  I suggest a "debug" sub-dir below the
> > location of
> > the grammar file. The tool should indicate if the dir needs to be
> > created.
> >
>
> Yep ;-)
>
> > 2. From the Build & Debug dialog, clicking browse to change the
> > current
> > setting doesn't start browsing from the current setting's location, it
> > always starts at the user's "home directory" (the "My Documents"
> > dir on my
> > Windows box).
> >
>
> Oops, you are right. Will be fixed.
>
> > 3. As per my previous message, I get a lot of entries in the
> > console about
> > it's inability to write to a grammar.stats file. The dir/folder
> > does exist
> > but the file doesn't.
> >
> > <error>
> > [14:41:29] internal error: Exception
> > java.nio.channels.ClosedChannelException at sun.nio.ch.FileLockImpl.relea
> > se(Unk
> > nown Source): can't write stats to C:\Documents and
> > Settings\MichealJ\antlrworks\grammar.stats
> > </error>
> >
>
> Yes, this is apparently a Java problem when using locks on file. It
> works smoothly on Mac OS and the Linux version I have used.
> Will see with Terence what we can do about that (because it is used
> on both ANTLRWorks and ANTLR side).
>
> > 4. Can this support cross-language debugging?. Is there some TCP
> > protocol
> > that needs to be supported by geberated parsers/lexers to support this
> > scenario?.
> >
>
> Yes, you can. When generating a parser from the command line, use the
> "-debug" option. Launch the parser and then use the "Debug Remote"
> item in ANTLRWorks to connect to this running parser. Of course, the
> running parser can be in any language.
>
> Oh, and make sure you have opened the corresponding grammar file in
> ANTLRWorks ;-)
>
> > 5. The syntax diagram is a useful addition. I was expecting to be
> > able to
> > navigate and perhaps refactor visually. Perhaps in time... ;-)
> >
>
> The future will talk ;-)
>
> > 6. Perhaps the tool should keep track of generated status
> > internally and
> > disable the items on the "Generate" menu accordingly. Got tired of
> > being
> > told I couldn't show code until something had being generated.
> >
>
> Will fix that.
>
> Thanks for all your comments!
>
> Jean
>



More information about the antlr-interest mailing list