From: Marcus Harnisch <marcus.harnisch@gm...> - 2004-05-18 04:45:03
Recently I went ahead implementing tags for members of enumerated
types. Some things still go wrong though.
The following code is to be parsed:
type enum1: [A=0,B=1,D=4];
My parser looks like this:
(TAG $1 'enum-member :value (if (not (null $2))
;; do other stuff
| EQUAL NUMBER_LITERAL
Somehow the value `0' gets lost though. The tag for "A" (or any other
member that gets a value of `0') doesn't ever get the :value
attribute. `semantic-specman-parse-number-literal' does return the
integer value `0' correctly.
Is there anything special about `0'?
From: Marcus Harnisch <marcus.harnisch@gm...> - 2004-06-06 18:21:33
Marcus Harnisch writes:
> Somehow the value `0' gets lost though. The tag for "A" (or any other
> member that gets a value of `0') doesn't ever get the :value
> Is there anything special about `0'?
Could the function `semantic-tag-make-plist' be the culprit? From the
,----[ semantic-tag-make-plist ]
| Create a property list with ARGS.
| Args is a property list of the form (KEY1 VALUE1 ... KEYN VALUEN).
| Where KEY is a symbol, and VALUE is the value for that symbol.
| The return value will be a new property list, with these KEY/VALUE
| pairs eliminated:
| - KEY associated to nil VALUE.
| - KEY associated to an empty string VALUE.
| - KEY associated to a zero VALUE.
Why these restrictions?
I found this comment right above the function definition:
;; Is this function still necessary?