Implementing Brainfuck loops in an interpreter

前端 未结 5 2306
隐瞒了意图╮
隐瞒了意图╮ 2021-02-20 07:53

I want to build a Brainfuck (Damn that name) interpreter in my freshly created programming language to prove it\'s turing-completeness.

Now, everything is clear so far (

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-20 08:40

    How do I implement the BF loops in my interpreter?

    That’s the point – it entirely depends on your language. For the case of a stack-based programming language (or any language which can use a stack), @rjh has given a good solution. Other languages would use different solutions, such as recursion (i.e. implicit use of a stack).

提交回复
热议问题