Hello,

how does an Interpreter work ? I read up on it and it seems you just parse each line and then (somehow) execute the lines.
I suppose the code needs instructions on how to execute each line ?

Whether you can parse each line individually depends on the language. I'd say in most languages, you'd need to parse the program as a whole. But yes, a simple (as in: non-JITing) interpreter generally consists of two phases: parsing and execution.

I suppose the code needs instructions on how to execute each line ?

For each type of instruction that exists in your language, the interpreter needs to contain code that can execute that kind of instruction. If that's what you mean, then yes, absolutely.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.