Hanging else, possible solution #3

87 views
Skip to first unread message

Nino Porcino

unread,
Jul 12, 2013, 7:25:55 AM7/12/13
to gold-pars...@googlegroups.com
on the GOLD documentation, two ways are reported for solving the hanging-else problem, but I think I've found a third one that includes no extra rule creation. For a C-like language it's like this:

<If> ::= 'if' '(' <Expr> ')' <Stm> <ElseBranch>
<ElseBranch> ::= 'else' <Stm> |  

What do you think about it? Does it behave correctly? I'm currently using it in my compiler and it seems to work as expected.

svv1999

unread,
Jul 20, 2013, 12:05:30 AM7/20/13
to gold-pars...@googlegroups.com
 Nino Porcino wrote:
I've found a third one

To which `if' does the `else' bind in `if ... if ... else'?

-manfred

Devin Cook

unread,
Jul 20, 2013, 7:24:20 PM7/20/13
to GOLD Parsing System
I'll have to take a closer look at that solution next week. Thanks for your help! ... and I'm AMAZED that someone actually looked at the documentation!  :-)

- Devin


--
You received this message because you are subscribed to the Google Groups "GOLD Parsing System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gold-parsing-sy...@googlegroups.com.
To post to this group, send email to gold-pars...@googlegroups.com.
Visit this group at http://groups.google.com/group/gold-parsing-system.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages