[antlr-interest] antlr-interest Digest, Vol 42, Issue 37

Jeff Saremi jeffsaremi at yahoo.com
Mon May 19 18:05:57 PDT 2008


you just poured cold water over me man. If only i knew earlier.
Lemme know where you are.
THis is what I have done:
- Bitset, Lexer, Parser, base recognizer, all streams, dfa, exceptions, and tokens
- the stg is done but i need to rework it in the light of the corrections to the above
- unit test is done for most with the exception of rewritestream which is giving me griefs
- have not touched the tree yet
- i obviously don't have an end to end yet but once i get through the unittests, that should be no problem.

i have tried to stick with the original java logic to the degree i could. therefore the code is probably not efficient to run ina browser. 

I haven't had the time to test anything against IE either. But i don't really have any browser-dependent code.
Since i've been checking Mozilla for refernce there could be some calls I could adjust for IE.

I have not used any libraries either. Its all pure handcoded JS with the exception of a "Class" constructor for simple inheritence.
THat's taken from John Resig's blog.

I have no problem at all dropping this right now. I'm sure preparing examples and documentation is something i could help you with.
Or i might as well just keep going to get some sense of closure for myself.

pls use my email to let me know
thanks
jeff


----- Original Message ----
From: Joey Hurst <jhurstus at gmail.com>
To: antlr-interest at antlr.org; jeffsaremi at yahoo.com; pink at odahoda.de
Sent: Monday, May 19, 2008 8:37:54 PM
Subject: Re: antlr-interest Digest, Vol 42, Issue 37

Hi Jeff,
Ben is probably correct here.  All ES3 numbers are actually floating point, which means that the interpreter has to cast the number to a 32 bit int and then back to a floating point to do any bitwise arithmetic.

Also, I'm nearly done with a JavaScript target for ANTLR 3.  I would be interested in syncing our code at some point to minimize duplicated effort.  Is your code ready to be shared?

Thanks,
Joey

Message: 2
Date: Mon, 19 May 2008 20:55:32 +0200
From: "Benjamin Niemann" <pink at odahoda.de>
Subject: Re: [antlr-interest] BitSets and 64bit Longs
To: "Jeff Saremi" <jeffsaremi at yahoo.com>
Cc: antlr-interest at antlr.org
Message-ID:
        <543531490805191155y1f235499q48b485ab3855a2fe at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi Jeff,

the BitSet class is just an internal implementation detail of the Java
runtime - probably because Java has poor or slow support for real
sets.
For Python I use the set() class to store token types. Use whatever is
most appropriate in JS to manage sets and supports the basic set
operations required by ANTLR. My guess is (but that's a pure guess)
that in such a high level language as JS the overhead of fiddling with
bits is bigger than the use of a less memory efficient, but more
native implementation.

-Ben




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080519/0ad2517a/attachment-0001.html 


More information about the antlr-interest mailing list