![]() |
|
Navigation |
Synopsis Retrieve the annotations of a node value as a map.
Function
map[str,value] getAnnotations(node x)
Usage
import Node;
Examples
rascal>import Node;
ok
Declare two string-valued annotation on nodes, named color, respectively, size:
rascal>anno str node @ color; ok rascal>anno str node @ size; okCreate a node with two annotations: rascal>F = setAnnotations("f"(10, "abc"), ("color" : "red", "size" : "large"));
node: "f"(10,"abc")[
@size="large",
@color="red"
]
and retrieve those annotations:
rascal>getAnnotations(F); map[str, value]: ("size":"large","color":"red") rascal>F@color; str: "red" ![]() |