[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Tweaking the libxlu bison grammar to include nested lists



On Wed, 2014-07-23 at 02:12 -0400, Elena Ufimtseva wrote:
> On Tue, Jul 22, 2014 at 10:34 AM, Sunder <u89012@xxxxxxxxx> wrote:
> > Hello everyone,
> >
> > I'm new to the Xen community and this is my first attempt towards a patch.
> > I've been given to understand that the config parser's grammar needs to be
> > modified to accept nested lists. I've been trying to tweak the code and
> > would need a bit of help in understanding the actions that are being invoked
> > (*store/*set/*mk, especially *mk which seems to be called with different 2nd
> > args based on where/what's found, which is quite confusing to me). I also
> > think the grammar could be further reduced as below. I'd love to hear the
> > expert opinions -- have I covered all cases? Are the right actions being
> > invoked?
> >
> > Thanks!
> > Sunder
> >
> > * filename: <xen>/tools/libxl/libxlu_cfg_y.y
> >
> > /*reduced grammar (mainly for understanding and local testing):*/
> >
> > stmts: | stmts stmt
> > stmt: ID '=' expr nl { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
> > expr:
> > atom { $$= xlu__cfg_set_mk(ctx,1,$1); }
> > | list
> > | expr ',' atom { xlu__cfg_set_add(ctx,$1,$3); $$= $1; }
> > | expr ',' list
> >
> > list: '[' expr ']' { $$= xlu__cfg_set_mk(ctx,0,0); }
> > atom: NUM|STR
> > nl: NL | nl NL
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@xxxxxxxxxxxxx
> > http://lists.xen.org/xen-devel
> >
> 
> CC ing Ian.

You want Ian J for questions about the parser. CCd.

> Ian, this comes from conversation about configuration of vNUMA
> distances we had some time ago.
> In that conversation we wanted to see vNUMA distance array look
> something like this in the config file:
> 
> vdistance = [[10,20,25],[20,10,20],[25, 20. 10]]
> or a shorter version, but I would start with fully defined at first.

An alternative which would be less work right now would be:
vdistance = [ "10,20,25", "20,10,20" ,... ]

Not ideal, sure.

> Will be that what Sunder asks a acceptable solution.

I'm not sure what Sunder is asking TBH, it looks like queries about how
things work rather than a proposal for a change to me, but perhaps
that's just because I'm not familiar with the existing grammar.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.