On 07.01.2017 6:06, LRN wrote:
> On 06.01.2017 18:46, Jacek Caban wrote:
>> On 1/6/17 4:34 PM, LRN wrote:
>>> On 06.01.2017 13:12, LRN wrote:
>>>> Managed to compile and use cecil, wrote a C# program that churns the data
>>>> produced given by cecil and outputs IDL files. Worked on it until the IDL
>>>> files
>>>> it produced started to look legit.
>>>>
>>>> Then i fed an IDL file to a fresh (from mingw-w64-tools git) widl, and
>>>> discovered that widl won't accept it. Fed an IDL file from
>>>> mingw-w64-headers
>>>> git to the same widl, and discovered that widl does not accept that one
>>>> either.
>>>>
>>>> What am i doing wrong?
>>>> The error (for mingw-w64-headers/windows.foundation.idl) is:
>>>>
>>>> Windows.Foundation.idl:14: error: syntax error, unexpected aIDENTIFIER,
>>>> expecting $end
>>>>
>>> Poked widl a bit. It seems to be that the parser is broken, as it always
>>> bails
>>> on any mention of "namespace {...}". Yacc source files do contain mentions
>>> of
>>> namespaces, so obviously the parser used to support them somehow.
>>>
>>
>> It may be worth trying plain Wine version of widl. I implemented some of
>> winrt features there, including partial support for namespaces. Sadly,
>> I'm sure that any complex IDL will hit its limitations. It's at least
>> good enough to properly handle simple IDLs like [1].
>>
>> mingw-w64 versions have some changes that were never upstreamed to Wine,
>> so merging that work may be tricky. We may worry about that once Wine
>> implementation is more useful.
>>
>
> Another alternative exists: don't use widl at all, just generate c/c++ headers
> directly from metadata. I'm not entirely sure how difficult/easy that would
> be.
>
Spent 30 minutes merging all upstream widl commits into my mingw-w64-tools
version of widl.
Then spent two hours fighting with automake + flex + bison, because wine widl
wasn't written with automake in mind.
Finally compiled it (found a few minor merge errors where patches applied, but
provided duplicate code).
Doesn't work (bails at typedef enum Blah { ... } Blah;)
Debugging suggests a parser error (the last "Blah;" is misclassified somehow),
but i could be wrong.
Next stop is to try to just use 100% upstream widl instead.
If that doesn't work, i'll look at just generating headers directly from
metaidlgen. AFAIU, actual header generation is just 1.7k LOC in header.c, the
real gnarly code is in IDL parsing, which metaidlgen doesn't need to do, as it
already has access to the full type hierarchy.
--
O< ascii ribbon - stop html email! - www.asciiribbon.org
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
