git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Commented] (DAFFODIL-1065) parser: API needs to enable repeated calls to parser - not treat unconsumed data as 'left over'


    [ https://issues.apache.org/jira/browse/DAFFODIL-1065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466046#comment-16466046 ] 

Michael Beckerle commented on DAFFODIL-1065:
--------------------------------------------

I think this is probably a duplicate of the Message-by-message API work.
SL doing this work, so reassigning to him. 

> parser: API needs to enable repeated calls to parser - not treat unconsumed data as 'left over'
> -----------------------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-1065
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1065
>             Project: Daffodil
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: s14
>            Reporter: Michael Beckerle
>            Assignee: Steve Lawrence
>            Priority: Major
>             Fix For: deferred
>
>
> From an Email thread with James Garriss:
> While I got the workaround working, I definitely think this is an improvement opportunity for your API.  It should have simple methods that:
> ��       Detect a ���leftover data��� condition.
> ��       Return some sort of pointer to the location of the leftover data.
> ��       Return the entirety of the leftover data.
> This would be super helpful for anyone trying to use Daffodil in a filter.
> -----Original Message-----
> From: Steve Lawrence [mailto:slawrence@xxxxxxxxxx]
> Sent: Wednesday, October 08, 2014 10:05 AM
> ...
> Subject: Re: Daffodil 0.14 - warning about extra, unprocessed data
> Yep, it looks like our CLI has two ways we determine if there is left
> over data.
> The first is the isAtEnd method. The problem with this is that I think
> it only works if you provide the size of your data to the parse()
> method. Otherwise, it will always return false. This is a bug. However,
> the workaround is to get the size of your input data, and pass it to the
> parse function, e.g.:
>   ParseResult pr = processorFactory.parse(input, lengthOfInput)
> The second way is to read the internal state to determine the length of
> the data and compare that with the resulting data location. This is what
> the Scala CLI does when the length isn't known. The problem with this
> method is that it is internal information that is not available via the
> Java API, so while it works for our CLI written in Scala, it can't be
> used in your GUI. I'm not sure this information should be available via
> the API, I think we just need to fix the first bug.
> So the short of it, pass in the length of your data and I think isAtEnd
> will work.
> - Steve



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)