This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

Datatypes R2 Issue 30

From HL7Wiki
Jump to navigation Jump to search

Data Types Issue 30: Add Bag.literal

Introduction

Why doesn't BAG have a ".literal" property?

Proposal: I guess a simple literal would just be the one for list. Another literal form could allow for numbers too. Something like:

"[" { <int> <T_literal> } "]"


Discussion

I like the form with the number. But perhaps the number wants to be optional and distinguishable in a BAG<INT>? Attempt at defining the exact attribute grammar. Gschadow 18:04, 7 June 2007 (CDT)

 BAG<T>   : "[" sequence "]"  { $.equal($2) };
 sequence : sequence BXIT<T>  { $.contains($1).and($.congtains($2)) }
          | BXIT<T>           { $.contains($1) }
          ;
 BXIT<T>  : T "(" INT ")"     { $.equal(((T)$1)).and($.qty.equal($3)) }
          | T                 { $.equal(((T)$1)) }
          ;

Links

Back to Data Types R2 issues