Here's the output from the console,
Debug print..
exprNode(
assign(
var(name(name("alpha")))[
@at=|file:///Users/apil/Dropbox/Scripts/Class_Based_Analysis/SimpleClass_CopyObject.php|(56,6,<9,0>,<9,0>),
@scope="scope"("","","",""),
@decl=|php+variable:///alpha|,
@phpdoc="",
@lab=lab(3)
],
new(
name(name("MyClass")[
@at=|file:///Users/apil/Dropbox/Scripts/Class_Based_Analysis/SimpleClass_CopyObject.php|(67,7,<9,0>,<9,0>),
@scope="scope"("","","",""),
@phpdoc=""
]),
[])[
@at=|file:///Users/apil/Dropbox/Scripts/Class_Based_Analysis/SimpleClass_CopyObject.php|(63,13,<9,0>,<9,0>),
@scope="scope"("","","",""),
@phpdoc="",
@lab=lab(4)
])[
@at=|file:///Users/apil/Dropbox/Scripts/Class_Based_Analysis/SimpleClass_CopyObject.php|(56,20,<9,0>,<9,0>),
@scope="scope"("","","",""),
@phpdoc="",
@lab=lab(5)
],
lab(5))[
@lab=lab(5)
]
var(name(name("alpha")))[
@at=|file:///Users/apil/Dropbox/Scripts/Class_Based_Analysis/SimpleClass_CopyObject.php|(56,6,<9,0>,<9,0>),
@scope="scope"("","","",""),
@decl=|php+variable:///alpha|,
@phpdoc="",
@lab=lab(3)
]
|rascal://soft::typing::php::elements::Identifier|(1678,6,<54,10>,<54,16>): get-annotation not supported on value at |rascal://soft::typing::php::elements::Identifier|(1678,6,<54,10>,<54,16>)
☞ Advice
and here's the script responsible for generating the content:
LabelToIdentifierMap mapp=( );
println("Debug print..");
iprintln(cfgNode);
result=[e | /assign(e,_):=cfgNode];
if(isEmpty(result))
return mapp;
result=getElementFromSingletonList(result);
iprintln(result);
if(var(name(name(str x))):=result)
mapp +=(result@lab:var(x));
else if(propertyFetch(var(name(name(str x))),name(name(str y))):=result)
mapp +=(result@lab:propertySet(var(x),var(y)));
else
throw "Unsupported expression encountered at left hand side of an assignment node.\n"+
"Got: <result>. Error loc: 510142847";
return mapp;
My concern is that the output of variable "result": var(name(name("alpha")))[ @at=... ] shows that there is an annotation @lab in the attached with the variable. Why am I unable to retrieve it? Also, how may I retrieve it if that's possible at all!