Determining Multi or Single Dobj

No problem! Grammar’s not my forte…

1 Like

Okay, I’m still just getting {obj:nounList(nonTerminal)}, but I can’t put that anywhere to compare it.

1 Like

It is a string… that’s what you can compare against, I believe: a string with those exact characters

1 Like

Oh, hold up… are you saying I use reflection services to make this a string, and then compare strings? Does that work in a production compile? Also, I feel like there should be something in the language that handles this…

If VTS(dobjMatch)==‘{obj:etc}’

1 Like

I include the symbol table in my release build…

There may definitely be a better way but like I said I’m iffy with how to handle Prod stuff

Okay, so…I get it, if it works, but that also feels suuuuuper cursed, lmao.
Absolutely no problems keeping reflection services in a release build? Just feels weird that it’s not included by default, if that’s the case…

EDIT: Okay, but I’m not crazy, right? This is strange! There are values in this library that—somehow—cannot be referred to in code, to make a comparison without reflection.

Like…that’s weird, right?

Not everybody needs the symbol table, but aside from a slightly larger image file I don’t see any drawback to the user…

1 Like

I haven’t read GrammarProd section of the System Manual in a long time, there may be light in there

I couldn’t see a single Prod class that grouped the different nounLists etc, for purposes of testing with ofKind…

1 Like

I mean, I can easily whip up a function somewhere that checks against all sorts of them, and reduce them down to “single or multi”. It’s comparison that is apparently being weird…

Perhaps you can use something from the Command class; there’s a nounPhrase list in there

All I’m seeing is Command.npList, but that’s based on player input. I’d still need something to compare it against.

I’m using reflection at the moment, but it feels really weird. I’ve never had to interact this closely with the grammar stuff before. I can’t make heads or tails on if these are classes, objects, methods, macros, or what…

1 Like

As is evident, I don’t have a thorough understanding either. But it should be an object of class Production. It’s just difficult to isolate its exact class…

1 Like

I wonder if the np_ property could help anything

Will post my hilarious reflection-based solution in a moment, once I have it tested. Will also love any other insights, lol.

What class is np_ from?

It’s a property of the Prod object stored in dobjMatch

Could vts it to see

1 Like

Ugh, okay, so I feel like I just ran around in a circle…

Hold on, I need to do some more poking. I have a few thoughts to articulate…