[Info-vax] Any Way to Pass Arrays of Strings from C to Basic?
Arne Vajhøj
arne at vajhoej.dk
Fri Nov 8 12:46:39 EST 2019
On 11/8/2019 8:16 AM, Simon Clubley wrote:
> On 2019-11-07, Dave Froble <davef at tsoft-inc.com> wrote:
>> On 11/7/2019 11:40 AM, seasoned_geek wrote:
>>> The only portion which
>>> needed to be in C was the piece which originally called Xerces XML
>>> parser which was, at the time heavily supported by IBM. There was a
>>> correct decision all XML parsing should be done by an industry
>>> standard library.
>>
>> A while back we looked at several XML parsers. When done looking, we
>> looked at each other and basically said WTF? The products would test
>> some XML for matching tag pairs, but nothing else we could see. One
>> thing they didn't do was parse out the actual data that we needed.
>> That, we still had to custom program. Have to wonder just what these
>> bloatware products are good for? Nothing we could see or justify.
>>
>> Note, perhaps there may be products that actually extract your data, but
>> we never saw one.
>
> Are you sure you are not confusing a XML validator with a XML parser ?
Typical validation is done by parsing.
> There are two basic types of XML parser I am aware of.
>
> The first one, the SAX style parser, calls back into a handler you
> declare when an event (such as tag start seen, text seen, etc) occurs
> during parsing.
>
> The second one, the DOM style parser, parses the entire XML document
> at once and places it in a DOM style tree which you can then pull
> bits out of as required.
There are more. I would count at least 4 or 5 (depending on whether
one consider different DOM models for 1 or 2):
1) W3C DOM
2) various alternative DOM
3) streaming push = SAX
4) streaming pull
5) binding
> BTW, I don't know DEC Basic. Can you _directly_ call into a DEC BASIC
> function from a C language routine and if so, are there limits on
> what can be passed from the C routine into the DEC BASIC routine ?
Yes.
The original topic of this thread is actually about a case of that.
If one is willing to jump through enough hoops on the C side
then Basic can be called.
> If there are not, then I don't see why you can't just use one of
> the various C language SAX parsers and register your BASIC function
> as the callback handler if you didn't want to bother with one of
> the DOM style parsers.
Some glue code will be needed either on the C side or the Basic
side to convert between "SAX API" and "natural Basic API".
And as the topic of this thread and the previous one show then
that may not be trivial.
But it is possible.
Arne
More information about the Info-vax
mailing list