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

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

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?


* 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); }
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



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