From 45013d86197fea96810a7ae1b920d22b4c887688 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 7 Aug 2012 22:50:15 -0600 Subject: 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 Acked-by: David Gibson --- dtc-lexer.l | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'dtc-lexer.l') 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("\n"); + BEGIN(PROPNODENAME); + return DT_DEL_PROP; + } + +<*>"/delete-node/" { + DPRINT("Keyword: /delete-node/\n"); + DPRINT("\n"); + BEGIN(PROPNODENAME); + return DT_DEL_NODE; + } + <*>{LABEL}: { DPRINT("Label: %s\n", yytext); yylval.labelref = xstrdup(yytext); -- cgit v1.2.1