diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-08-07 22:50:15 -0600 |
---|---|---|
committer | Jon Loeliger <jdl@jdl.com> | 2012-09-06 07:51:43 -0500 |
commit | 45013d86197fea96810a7ae1b920d22b4c887688 (patch) | |
tree | 0048099d9141732edb7ab13d84720ef938fec24e /dtc-lexer.l | |
parent | 8716901d2215a314504b7df6282aedfcf89da1ea (diff) | |
download | device-tree-compiler-45013d86197fea96810a7ae1b920d22b4c887688.tar.gz |
dtc: Add ability to delete nodes and properties
dtc currently allows the contents of properties to be changed, and the
contents of nodes to be added to. There are situations where removing
properties or nodes may be useful. This change implements the following
syntax to do that:
/ {
/delete-property/ propname;
/delete-node/ nodename;
};
or:
/delete-node/ &noderef;
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc-lexer.l')
-rw-r--r-- | dtc-lexer.l | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/dtc-lexer.l b/dtc-lexer.l index 4715f31..91c4930 100644 --- a/dtc-lexer.l +++ b/dtc-lexer.l @@ -103,6 +103,20 @@ static int pop_input_file(void); return DT_BITS; } +<*>"/delete-property/" { + DPRINT("Keyword: /delete-property/\n"); + DPRINT("<PROPNODENAME>\n"); + BEGIN(PROPNODENAME); + return DT_DEL_PROP; + } + +<*>"/delete-node/" { + DPRINT("Keyword: /delete-node/\n"); + DPRINT("<PROPNODENAME>\n"); + BEGIN(PROPNODENAME); + return DT_DEL_NODE; + } + <*>{LABEL}: { DPRINT("Label: %s\n", yytext); yylval.labelref = xstrdup(yytext); |