On Oct 2, 2008, at 11:37 PM, David Gibson wrote:
Node-content expressions
------------------------
Literals are node definitions in the current format:
{
prop = <bytestring expression>;
[EMAIL PROTECTED] <node content expression>;
}
?: would also be supported here (again, first argument integer, second
and third are node-content).
I'm less sure what other operators we'll need here - probably need to
build these based on actual usage examples. Likely candidates,
however are:
- set property
e.g. /setprop/({ }, "reg", < 17 >) == { reg = < 17 >; }
- remove property
e.g. /delprop({ reg = <17>; }, "reg") == { }
- add subnode
e.g. /addnode/({ }, "[EMAIL PROTECTED]", {reg = <17>;}) ==
{ [EMAIL PROTECTED] { reg = <17>; }; }
- merge
should we have /delnode/
e.g. /merge/({foo = "abc";}, {bar = <17>;}) == {foo = "abc";
bar=<17>;}
(this would recurse down subnodes with identical names)
- get subnode
e.g. /getnode/({ subnode { foo = "bar"; }; }, "subnode") ==
{ foo = "bar"; }
- get property (result of this is a bytestring, not a
node-content expression)
e.g. /getprop/({ foo = "bar"; }, "foo") = "bar"
This is very interesting and seems to address some functionality I've
talked to Jon about us needing to modify and update nodes.
- k
_______________________________________________
devicetree-discuss mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/devicetree-discuss