interpreter: how is it possible to interpret nested IF ELSE ENDIF ????

Jens Kallup <jkallup@web.de>
Wed, 15 May 2013 07:42:19 +0200

          From comp.compilers

Related articles
interpreter: how is it possible to interpret nested IF ELSE ENDIF ???? jkallup@web.de (Jens Kallup) (2013-05-15)
Re: interpreter: how is it possible to interpret nested IF ELSE ENDIF ademakov@gmail.com (Aleksey Demakov) (2013-05-31)
Re: interpreter: how is it possible to interpret nested IF ELSE ENDIF mertesthomas@gmail.com (2013-06-19)
| List of all articles for this month |
From: Jens Kallup <jkallup@web.de>
Newsgroups: comp.compilers
Date: Wed, 15 May 2013 07:42:19 +0200
Organization: 1&1 Internet AG
Keywords: interpreter, question
Posted-Date: 17 May 2013 18:45:58 EDT

Hello,


like the topic says:


a give construct should be interpret through a single pass???:


IF 2 == 3
      print "not print"


      IF 2 == 3
          print "not"
      ELSE
          print "wrong1"
      ENDIF


      print "3"


ELSE


      print "this"


ENDIF




Thanks for helping
Jens
[My usual advice is to translate the source to something easy to
interpret like an AST, then run your interpreter on that. Trying
to jump around in the source code and remember when to parse what
and to avoid side effects when parsing through code you're supposed
to skip is miserable. -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.