[Libvirt-cim] [PATCH] Make MOF parser ignore NULL properties

Dan Smith danms at us.ibm.com
Wed Oct 8 17:32:24 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1223487138 25200
# Node ID 5fbf96fedcf7df32fccc3f989aa4520af8c9a264
# Parent  36c97d5c8c9f0eea12a87eae4e01bb80c9840ece
Make MOF parser ignore NULL properties

This just adds enough to the parser to allow something like:

  Foo = NULL;

in the MOF object.  It's just ignored, as would be expected.

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r 36c97d5c8c9f -r 5fbf96fedcf7 eo_util_lexer.l
--- a/eo_util_lexer.l	Wed Sep 03 11:35:13 2008 -0700
+++ b/eo_util_lexer.l	Wed Oct 08 10:32:18 2008 -0700
@@ -72,6 +72,12 @@
 	return(BOOLEAN);
 	}
 
+null |
+Null |
+NULL	{
+	return(CIMNULL);
+	}
+
 {INTEGER} {
 	eo_parse_lval.sint64 = atoll(eo_parse_text);
 	return(INTEGER);
diff -r 36c97d5c8c9f -r 5fbf96fedcf7 eo_util_parser.y
--- a/eo_util_parser.y	Wed Sep 03 11:35:13 2008 -0700
+++ b/eo_util_parser.y	Wed Oct 08 10:32:18 2008 -0700
@@ -60,6 +60,7 @@
 %token <string> STRING
 %token <boolean> BOOLEAN
 %token <sint64> INTEGER
+%token CIMNULL
 
 %%
 
@@ -126,6 +127,13 @@
 			CMSetProperty(*_INSTANCE, $1, &($3), CMPI_boolean);
 			free($1);
 			}
+
+	|	PROPERTYNAME '=' CIMNULL ';'
+			{
+			EOTRACE("propertyname = %s\n"
+				"\ttype = NULL\n", $1);
+			free($1);
+			}
 	;
 
 /* END OF RULES SECTION */




More information about the Libvirt-cim mailing list