Devicetree
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
Cc: devicetree-discuss
	<devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>
Subject: Re: DTS language enhancements
Date: Fri, 3 Oct 2008 15:29:42 +1000	[thread overview]
Message-ID: <20081003052942.GJ3002@yookeroo.seuss> (raw)
In-Reply-To: <FB6717CF-EF47-40E1-B972-1E642066D5C6-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>

On Fri, Oct 03, 2008 at 12:08:54AM -0500, Kumar Gala wrote:
>
> 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>;
>> 		somesubnode@whatever <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/({ }, "subnode@17", {reg = <17>;}) ==
>> 	{ subnode@17 { reg = <17>; }; }
>> 	- merge
>
> should we have /delnode/

Ah, yeah, I guess so, if we've got the rest.  Possibly they should be
called /graft/ and /prune/ instead of /addnode/ and /delnode/ to
emphasise the fact that they may be handling whole subtrees.

>> 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.

Yeah, well, this is kind of my point.  I'm pretty sure we'll need this
stuff regardless of whether we use preprocessing or post-evaluation;
and once we have these sorts of operators, I'm not sure that
post-evaluation will actually buy us much.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  parent reply	other threads:[~2008-10-03  5:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-03  4:37 DTS language enhancements David Gibson
     [not found] ` <20081003043710.GH3002-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2008-10-03  5:08   ` Kumar Gala
     [not found]     ` <FB6717CF-EF47-40E1-B972-1E642066D5C6-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2008-10-03  5:29       ` David Gibson [this message]
2008-10-03 14:07       ` Jon Loeliger
     [not found]         ` <48E62739.8090109-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2008-10-04  4:18           ` David Gibson
2008-10-06 17:06   ` Scott Wood
     [not found]     ` <20081006170601.GA31967-VKaLA/mbEU932VTgPCOETVjVikpgYyvb5NbjCUgZEJk@public.gmane.org>
2008-10-07  1:41       ` David Gibson
     [not found]         ` <20081007014103.GA23135-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2008-10-07  4:17           ` David Gibson
     [not found]             ` <20081007041725.GD19037-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2008-10-07 16:46               ` Scott Wood
2008-10-07 16:50           ` Scott Wood
     [not found]             ` <20081007165038.GA17126-VKaLA/mbEU932VTgPCOETVjVikpgYyvb5NbjCUgZEJk@public.gmane.org>
2008-10-09  2:27               ` David Gibson
     [not found]                 ` <20081009022722.GC7997-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2008-10-09 15:08                   ` Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081003052942.GJ3002@yookeroo.seuss \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox