Updated to removed unresolvable choice possibility:


Productions


Document = Element


Element = SimpleElement | ComplexElement

SimpleElement =  LeftSimpleFraming SimpleContent RightFraming

ComplexElement = LeftComplexFraming ComplexContent RightFraming

LeftSimpleFraming = Prefix LeftPadding

LeftComplexFraming = Prefix

RightFraming = RightPadOrFill  Suffix



ComplexContent = Sequence | Choice


Sequence = Prefix SequenceContent Suffix

SequenceContent =

[ PrefixSeparator SequenceItem [ Separator SequenceItem ]* PostfixSeparator ]

SequenceItem = Element | Array | ComplexContent



Choice = Prefix ChoiceContent Suffix

ChoiceContent = Element | Array | ComplexContent


Array = [ Element [ Separator Element ]* [ Separator StopValue] ]

StopValue = SimpleElement


Prefix = LeadingAlignment Initiator

Suffix = Terminator TrailingAlignment


LeadingAlignment = LeadingSkipBytes AlignmentFill

TrailingAlignment = TrailingSkipBytes





On Wed, Jun 17, 2009 at 6:37 AM, Alan Powell <alan_powell@uk.ibm.com> wrote:

Mike

I think you have prefix/postfix separator in the wrong place

You definition has  LeadingAlignment Initiator Prefixseparator and it should be Prefixseparator  LeadingAlignment Initiator so

LeftSequenceFraming = Prefix PrefixSeparator should be LeftSequenceFraming = PrefixSeparator Prefix

Similarly for postfix.


Also I don't think ChoiceUnresolvableItem = OpaqueTypeContent is correct.
Unresolveable choice content is the same as resolvable choice content as you need to be able to work out the length of the choices (which must be the same).  


I have change AlignmentPad to AlignmentFill as the pad character is not used during alignment

Small stylistic comment: Should LeftPadding be just Padding and RightPadorFill be just PadorFill?


Alan Powell

MP 211, IBM UK Labs, Hursley,  Winchester, SO21 2JN, England
Notes Id: Alan Powell/UK/IBM     email: alan_powell@uk.ibm.com  
Tel: +44 (0)1962 815073                  Fax: +44 (0)1962 816898



From: Mike Beckerle <mbeckerle.dfdl@gmail.com>
To: Steve Hanson/UK/IBM@IBMGB, Alan Powell/UK/IBM@IBMGB
Date: 11/06/2009 03:23
Subject: please review revised DFDL grammar





I'll take this to the broader group once you guys have had a look at this.

Please review this revised grammar table. I've tried to include the necessary pieces to handle padding on left and padding or fill on right, and in a manner consistent with our most recent policies where dfdl:length for complex types can only be on the element itself, not any model group.

I am uncertain if this grammar has enough features to capture everything about say, CalendarTypeContent. E.g., are there no properties about framing that are special to calendars? This grammar suggests that padding/fill is all handled outside the content for calendars, as for all simple types.

I also added prefix/postfix separators back in. (We excised them a while back, but I'm pretty sure decided to put them back in.)

The issue about proper interpretation of leading and trailing skip bytes is outstanding still.

There are no changes to the simple content grammar. I'm including it here for making this message self-contained.

I believe that the blowout pictures in the grammar section are to some degree outliving their usefulness. They are in essence equivalent to this grammar. By arranging the grammar to use the terms left framing, right framing, and content, I believe the information about what start of content is, vs. start of item can be defined without most of the pictures. I think the one which defines item start, content start, content end, and item end is useful. The others not so useful.

-------------------------

First we present the simple content types.

Production
See Section(s)
SimpleContent = NumberTypeContent | StringTypeContent |

CalendarTypeContent | BooleanTypeContent | OpaqueTypeContent

 
NumberTypeContent = TextNumber | BinaryIntegerNumber | BinaryFloatNumber TBD
StringTypeContent = TextString TBD
CalendarTypeContent = TextCalendar | BinaryIntegerCalendar TBD
BooleanTypeContent = TextBoolean | BinaryIntegerBoolean TBD
OpaqueTypeContent =  BinaryOpaque TBD

 

There are additional NumberTypeContent terminals specified in the DFDL specification supplements (for bcd, zoned and packed decimal).

These simple types are the basic data content pieces found in DFDL-described data sources.

The rest of this grammar describes how these basic pieces are composed into arrays and more complex types.

 

Productions
 
Document = Element  
Element = SimpleElement | ComplexElement

SimpleElement =  LeftSimpleFraming SimpleContent RightFraming

ComplexElement = LeftComplexFraming ComplexContent RightFraming

LeftSimpleFraming = Prefix LeftPadding

LeftComplexFraming = Prefix

RightFraming = RightPadOrFill  Suffix

 

 
ComplexContent = Sequence | Choice  
Sequence = LeftSequenceFraming SequenceContent RightSequenceFraming

SequenceContent = [ SequenceItem [ Separator SequenceItem ]* ]  

SequenceItem = Element | Array | ComplexContent

LeftSequenceFraming = Prefix PrefixSeparator

RightSequenceFraming = PostfixSeparator Suffix

 
Choice = LeftChoiceFraming ChoiceContent RightChoiceFraming

ChoiceContent = ChoiceResolvableItem | ChoiceUnresolvableItem[MJB1] 

ChoiceResolvableItem = Element | Array | ComplexContent

ChoiceUnresolvableItem = OpaqueTypeContent[MJB2] 

LeftChoiceFraming = Prefix

RightChoiceFraming = Suffix

 
Array = [ Element [ Separator Element ]*  [ Separator StopValue] ]

StopValue = SimpleElement

 
Prefix = LeadingAlignment Initiator

Suffix = Terminator TrailingAlignment

 
LeadingAlignment = LeadingSkipBytes AlignmentPad

TrailingAlignment = TrailingSkipBytes

 

 


 








Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU