On Dec 26, 2012, at 9:21 , Terence Parr <
pa...@cs.usfca.edu> wrote:
>
> On Dec 25, 2012, at 3:29 PM, Rick Mann wrote:
>
>>
>> On Dec 25, 2012, at 9:10 , Terence Parr <
pa...@cs.usfca.edu> wrote:
>>
>>> isn't that what ParseTreeProperty is? It's a decoration to avoid a HashMap in each node just to store one or two values.
>>
>> No, I mean literally a map on the node, so I don't have to pass it around externally.
>
> that's what i meant :) "avoids a HashMap in each node just to store one or two values." note the trick:
haha, yes, I got that the first time.
> rule[int x] : … ;
>
> puts "int x" in rule's node.
Oh, that might be useful.
> yeah, we didn't like lack of types and cost per node. imagine just an extra null ptr in a 1 million node tree. 8M more for people that don't want decorations.
Fair enough. What about something on Parser like:
setNodeProperty(ParseTree inNode, String inName, T inValue);
T getNodeProperty(ParseTree inNode, String inName, Class inValueClass)
I'm not sure of the exact syntax to genericize those.
>> It's okay, it's working as is now, and I'm getting closer and closer to pulling the trigger on using LLVM as my bytecode interpreter (If I can just get the Java LLVM binding to build, or…a C++ parser back end ;-) ).
>
> cool
LLVM is *really* cool. If I could get Xcode to link its libs into my JNI lib without bitching about STL link errors, it would be.
--
Rick