This wiki has undergone a migration to Confluence found Here
Difference between revisions of "Datatypes R2 Issue 30"
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
== Discussion == | == 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. [[User:Gschadow|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 == | == Links == | ||
Back to [[Data Types R2 issues]] | Back to [[Data Types R2 issues]] |
Latest revision as of 23:04, 7 June 2007
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