Determining Multi or Single Dobj

Hey, I am scouring the docs. I hope I’m not being dense again.

First of all: What class is Action.verbRule? I can’t seem to find it anywhere in the library reference.

Second: Is there a what to check if gAction needs a singleDobj, or can accept a multiDobj?

Basically, I need a way of knowing if an action would ask for disambiguation, or if it would allow for multiple direct objects.

Thank you for your time!

For starters VerbRule is a macro for a grammar statement…

1 Like

Right, I’m slowly realizing that, but Examine.verbRule.verbPhrase evaluates to something, and I’m not sure how…

My bad, I didn’t realize Lite used verbRule as a property…

1 Like

If you can get to the dobjMatch property of the verbRule for the action, it should contain either singleNoun or nounList…

1 Like

Lemme try that; will report back momentarily.

As for the class I believe it should be a type of GrammarProd?

These are the properties showing up in the reference.

Hm… My dev environment is refusing to compile, saying that singleNoun is “not a property” so it “cannot be used after a period”.

ventilationNode: Room {
    roomBeforeAction() {
        local a_singleNoun = gAction.verbRule.singleNoun;
        if (a_singleNoun == nil) a_singleNoun = 'nil';
        local a_nounList = gAction.verbRule.nounList;
        if (a_nounList == nil) a_nounList = 'nil';
        extraReport('\bsingleNoun: <<a_singleNoun>>\n');
        extraReport('nounList: <<a_nounList>>\b');
        inherited();
    }
}

EDIT: It says the same thing for nounList… Hm…

Poking at object.getPropList() to see if it provides any answers…

EDIT: Nope. Can’t seem to print anything useful to output.

The property is dobjMatch…

Action.verbRule.dobjMatch?

I just can’t remember if it belongs to Prod objects or grammar match tree objects…

The grammar for singleDobj has singleNoun being put into the dobjMatch property…

Do you have a debugPrint function that uses reflectionServices.valToSymbol?

Another check, dobjMatch does belong to the VerbProd so you should be able to access it

I don’t understand how these are connected in a way that can be accessed.

I don’t know how to do this. I tried using valToSymbol earlier, and the environment was like “lolwut”

EDIT: Saw your other reply. Checking VerbProd next.

Have you included reflectionServices? (Re valToSymbol)

I assume so; I’ve seen Action code using it earlier…

Code:

local verbProd = gCommand.verbProd;
"has verbProd: <<(verbProd == nil) ? 'nil' : 'true'>>\n";
local dm = verbProd.dobjMatch;
"has dobjMatch: <<(dm == nil) ? 'nil' : 'true'>>\n";
"dobjMatch: <<dm>>\n";

Output:

has verbProd: true
has dobjMatch: true
dobjMatch: (nounList(nonTerminal))

So if dobjMatch == nounList, then the Action allows for multiDobj? Am I understanding this correctly…?

EDIT: Also, sorry, I have no clue how valToSymbol works, exactly. I remember seeing it used elsewhere, but I’m not familiar with it enough to know how to use it quickly here.

1 Like