Devicetree
 help / color / mirror / Atom feed
From: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
Cc: devicetree-discuss
	<devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>
Subject: Re: DTS language enhancements
Date: Tue, 7 Oct 2008 11:50:38 -0500	[thread overview]
Message-ID: <20081007165038.GA17126@ld0162-tx32.am.freescale.net> (raw)
In-Reply-To: <20081007014103.GA23135-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>

On Tue, Oct 07, 2008 at 12:41:03PM +1100, David Gibson wrote:
> > Instead of /addnode/, how about an alternate version of (or option to)
> > /merge/ that merges the second tree with the contents of the first,
> 
> Um.. I don't entirely see how this variant of /merge/ would differ
> from /addnode/.

/addnode/ can only add one node at a time, and has an different syntax
than normal for representing the node to be added (name is split from
body).  /mergeunder/ could add any number of nodes and/or properties,
and would use more normal syntax.

> > rather than treating the trees as sharing a root?  This could also
> > supersede /setprop/, if conflicts are defined to be resolved in favor of
> > the second tree.
> 
> True, and I was assuming /merge/ would resolve conflicts in favour of
> one of the trees.  As I said, these suggestions are only an outline -
> I'm not entirely sure what we need by way of node expressions.

Understood -- I was just trying to help refine the suggestion.  I think
the ideal way forward involves elements of both your proposal and Jon's.

> > > It's possible to do this just with the /setprop/, /addnode/ operators
> > > described above, but that's awkward and verbose, so allowing
> > > expressions in the same place the property/node names go now seems
> > > better.  jdl's patch series allows this, but I'm not sure what makes
> > > the grammatical distinction between the parser expecting a bare node
> > > name and an expression, which worries me.
> > 
> > I think it's the leading backslash before identifiers that distinguishes
> > it.
> 
> Uh.. this doesn't make sense, an expression doesn't have to contain
> identifiers (constant expressions).

It's not nonsensical, just incomplete -- I was assuming that it was
obvious that quote-marks differentiate string constants.  Integer
constants would need parentheses in that context, though.

> Actually I suspect it's the presence of quotes which does the trick,
> at least in the examples Jon's given.
> 
> > > What I would suggest here is that expressions for node/property names
> > > must be parenthesized.  ( and ) aren't used in node/property names
> > > either in theory or practice AFAIK and this is consistent with integer
> > > expressions having to be parenthesized within cell lists to avoid
> > > ambiguity.
> > 
> > I'd rather have an identifier prefix than to require parentheses in
> > otherwise unambiguous contexts (which would basically amount to needing
> > both a prefix and a suffix).  This applies to cell context as well.
> 
> As above, this doesn't work.  It doubly doesn't work for cell context,
> because we need to disambiguate <3 (-2)> (2 cells) from <(3-2)> (1 cell).

It was a bare identifier (or function call) that I had in mind as a
non-ambiguous context, though I can see how allowing that might
complicate the implementation a little -- and allowing things like 3*2
to be unparenthesized would be even more complex.

We probably should have added comma-delimiting when we switched to
decimal-by-default.

> Ah, yes, this is something I had a plan for, way back.  I wanted to
> keep the [...] construct as a being a very compact representation of
> bytestrings - bytestring literals effectively.  That means bare hex
> and no expressions (because expressions and bare hex are a highly
> confusing mix as we've discovered).  But, I was intending to extend
> the celllist construct to allow the "cells" to be of different sizes -
> this would be useful for dealing with 64-bit quantities too.  Not sure
> how to do the syntax, though  Possibly:
> 	<.1 0xab 0xcd > 		(1 byte entries)
> 	<.8 0xdeadbeef00000000 >	(8 byte entries)
> Defaulting to .4, of course.  I'm not over fond of that though.
> Better suggestions welcome.

Seems reasonable.

-Scott

  parent reply	other threads:[~2008-10-07 16:50 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
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 [this message]
     [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=20081007165038.GA17126@ld0162-tx32.am.freescale.net \
    --to=scottwood-kzfg59tc24xl57midrcfdg@public.gmane.org \
    --cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
    --cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@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