Re: Overcoming AST forward declaration (includes online example)

Larry Evans <[email protected]> Fri, 2 Nov 2018 17:42:18 -0500
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 11/2/18 4:33 PM, Michael Powell wrote:
> On Fri, Nov 2, 2018 at 10:18 AM Michael Powell <[email protected]> wrote:
>>
>> Hello,
>>
>> Please find the example posted here:
>>
>> http://wandbox.org/permlink/NI2Luvrw1HF7lF1E
> 
> I resolved a couple of obvious typos, so what remains I think are the
> forward declaration concerns:
> 
> https://wandbox.org/permlink/tM6vQilplqDOL4v5
> 
Hi Michael,

I briefly looked at the last link above and see you've noted in
the comments on lines 233 and w258 here the forward declaration
problems occur.  Also, there's still the large grammar alternative
expression on line 429:

   type %= (
   // TODO: TBD: attempt at helping reduce the variant exhaustion a...
     lexeme("double")
   | lexeme("float")
   | lexeme("int32")
   .
   .
   .

Are you sure that wouldn't cause problems because the variant attribute
for the rhs has the same type for each alternative?  Why not try just
this as the sole rule in a vastly simplified grammar and see if qi
will compile that.  Also, use the same idea to narrow down why the
forward declarations are causing problems.  IOW, simplify your grammar
to *only* cause the forward declaration problem and then show the result
on another wandbox.org link.

Yes, I know it's a lot more work, but it would *greatly simply the work
needed by the readers of this mailing list in their attempts to help you
and, by simplifying, you might discover the solution yourself!

HTH.

-Larry

by the readers of your posts