DLLCC fails to parse recent gcc include files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DLLCC fails to parse recent gcc include files

Nicolas Cellier-3

Hello list,
playing with DLLCC within VW7.3.1 recently gave me hard to track errors

A first little problem with cygwin on windows is that include directive containing / character are incorrectly parsed. (DLLCC would expect a \).

Harder problem identified is long long constants like found in /usr/include/limits
./limits.h:
#define __LONG_LONG_MAX__ 9223372036854775807LL

Only the first L seems to be groked by DLLCC parser.
When the macro is used (machine/_types.h), DLLCC parser logically fails, but error handling is not correct.

To reproduce, just parse stdio.h from a gcc 3.4.4

If this is caused by new standard (C99?), then DLLCC has to adapt, or we can expect a drop in DLLCC usability...

Any hint?
Reply | Threaded
Open this post in threaded view
|

Re: DLLCC fails to parse recent gcc include files

Nicolas Cellier-3
[hidden email] a écrit :

>
> Hello list,
> playing with DLLCC within VW7.3.1 recently gave me hard to track errors
>
> A first little problem with cygwin on windows is that include directive
> containing / character are incorrectly parsed. (DLLCC would expect a \).
>
> Harder problem identified is long long constants like found in
> /usr/include/limits
> ./limits.h:
> #define __LONG_LONG_MAX__ 9223372036854775807LL
>
> Only the first L seems to be groked by DLLCC parser.
> When the macro is used (machine/_types.h), DLLCC parser logically fails,
> but error handling is not correct.
>
> To reproduce, just parse stdio.h from a gcc 3.4.4
>
> If this is caused by new standard (C99?), then DLLCC has to adapt, or we
> can expect a drop in DLLCC usability...
>
> Any hint?

Answering to myself in case any one interested by this thread:
I post a small solution in order to be able to parse long long (64 bits)
constants.

That was not enough to make my include work, it is not yet clear why.
I gave up and crafted all the interface by hand...

Is DLLCC CPreprocessor deprecated?

Nicolas



<?xml version="1.0"?>

<st-source>


<do-it>"This small change enables the C Preprocessor to parse signed and unsigned 64 bits constants"</do-it>

<methods>
<class-id>External.CScanner class</class-id> <category>private</category>

<body package="DLLCC" selector="initNumbers:">initNumbers: newTypeTable
        "numbers - only decimal integers for now"

        | num |
        num := self decode: #(xInteger ($l (xInteger)) ($L (xInteger)) ($u (xInteger ($l (xInteger)))) ($U (xInteger ($L (xInteger)))) ($l (xInteger ($l (xInteger)))) ($L (xInteger ($L (xInteger))))  ($u (xInteger ($l (xInteger ($l (xInteger)))))) ($U (xInteger ($L (xInteger ($L (xInteger))))))).
        self in: num value digits: num.
        newTypeTable atAll: ($0 asInteger to: $9 asInteger) put: num.
        newTypeTable at: $. asInteger put: (self decode: #(xPeriod))</body>
</methods>

<do-it>CScanner computeTables.</do-it>

</st-source>
Reply | Threaded
Open this post in threaded view
|

RE: Re: DLLCC fails to parse recent gcc include files

Steven Kelly
In reply to this post by Nicolas Cellier-3
> [hidden email] a écrit :
> > playing with DLLCC within VW7.3.1 recently gave me hard to track errors
> > #define __LONG_LONG_MAX__ 9223372036854775807LL
> > Only the first L seems to be groked by DLLCC parser.
>
> Answering to myself in case any one interested by this thread:
> I post a small solution in order to be able to parse long long (64 bits)
> constants.
>
> That was not enough to make my include work, it is not yet clear why.
> I gave up and crafted all the interface by hand...
>
> Is DLLCC CPreprocessor deprecated?

< naughty: true >

Not AFAIK by Cincom, but probably yes on occasion by its users, for the non-computer definition of "deprecate":

deprecate (v): express strong disapproval of; deplore

;-)
Steve