execute/parse IF ELSE ENDIF

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

execute/parse IF ELSE ENDIF

Jens Kallup
Hello,

is it possible to parse the construct: IF stmts *ELSE stmts ENDIF
in the form, that the dangling else problem is solved, and the parse code
can be execute on the fly by condition's?

Thanks for helping
Jens


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: execute/parse IF ELSE ENDIF

cppljevans
On 02/05/2017 03:17 PM, Jens Kallup wrote:
> Hello,
>
> is it possible to parse the construct: IF stmts *ELSE stmts ENDIF

Don't you mean, using "somewhat" spirit syntax:

  stmt = if_stmt | ... ;
  stmts = *stmt ;
  if_stmt = IF >> stmts >> *(ELSE stmts) >> ENDIF ;

?

> in the form, that the dangling else problem is solved, and the parse code
> can be execute on the fly by condition's?
>
> Thanks for helping
> Jens
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: execute/parse IF ELSE ENDIF

cppljevans
On 02/05/2017 10:47 PM, Larry Evans wrote:

> On 02/05/2017 03:17 PM, Jens Kallup wrote:
>> Hello,
>>
>> is it possible to parse the construct: IF stmts *ELSE stmts ENDIF
>
> Don't you mean, using "somewhat" spirit syntax:
>
>   stmt = if_stmt | ... ;
>   stmts = *stmt ;
>   if_stmt = IF >> stmts >> *(ELSE stmts) >> ENDIF ;
OOPS!  The above is missing a >> after ELSE.




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: execute/parse IF ELSE ENDIF

Jens Kallup
Hello Larry,

thank you for your reply.
With IF, I mean spirit qi phoenix if_
so that I can write an interpreter, that handle
IF ENDIF  or  IF ELSE ENDIF
on the fly.
because the dangling else...


Am 06.02.2017 um 06:04 schrieb Larry Evans:

> On 02/05/2017 10:47 PM, Larry Evans wrote:
>> On 02/05/2017 03:17 PM, Jens Kallup wrote:
>>> Hello,
>>>
>>> is it possible to parse the construct: IF stmts *ELSE stmts ENDIF
>> Don't you mean, using "somewhat" spirit syntax:
>>
>>    stmt = if_stmt | ... ;
>>    stmts = *stmt ;
>>    if_stmt = IF >> stmts >> *(ELSE stmts) >> ENDIF ;
> OOPS!  The above is missing a >> after ELSE.
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Spirit-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Loading...