Simple Math Interpreter in Python (2/4) - Parser

preview_player
Показать описание
In the second part of this short series, we create the parser, which transforms the tokens we generated in the last episode into a program tree. Our parser analyzes the sequence of tokens and takes into account the order of operations of different operators. For example, multiplication and division have a higher precedence to addition and subtraction.
Рекомендации по теме
Комментарии
Автор

Hey guys, I want to tell you smth, well, for start, CodePulse videos are super great, they had taught me a lot, and, also, and the why of this commentary, I learned how to understand a code, a way that I hope can help others. This CodePulse serie and also the "Making a programming language in python" serie is very complete, but I must say it's quite advances, at least for, or at least it was. I was in that serie, looking into the parsing part, and I didn't understand a thing, why does it work, why does multiplying and dividing get first, I don't see it, then I came to this video and much others. And I learned that by writing the code, the functions you don't understand, in a paper, you can read it as if you were a computer, but you write every step. "So now I gotta go to x function, and the result is this, so again in the other... " bla bla, it helped to me understand this.

Again, great videos and thank you very much ;)

benmoreaucohen
Автор

I like Your previous lecture on the language, but this one is even better and more pythonic.

toequantumspace
Автор

Great video and explanation. You deserve more subscribers!

JackMCGamerAnimations
Автор

I want to create my own programming language for a school project and this tutorial and the programming language tutorial are setting my mindset for this project,

thank you!

ps your explanation and how you do thinks are amazing

danielepaschetta
Автор

Yes his subscribers will come. I just subscribed. Great content

shawneiharris
Автор

Amazing. Thank you. I just implemented a truth table inference engine by following your example and I can understand the code! :)

cheongkoo
Автор

Good work, I'm loving the videos

quinndtxd
Автор

THANK YOU SO MUCH <3 you saved my life. subbed

pandadunks
Автор

4 Years old video, but still helpful! Please make some new videos

JapaDuh
Автор

Are you going to make an os coding tutorial?

Andre-czur
Автор

bros type speed is insane how you do that

Stormtrooper
Автор

8:30 you didn't need to check the condition second time.

patryk_
Автор

the problem is that you can't do something like 2 + 2 + 2, it gives you only (2+2)

tcholly
Автор

Hello, can I know what type of parser u used in this video?

Mx-gvnm
Автор

is it possible to do this without class jiberish? (sorry just gets confusing)

BILLPC
Автор

Hi, Can we turn this project in to a math formula solver? For exsample, in "20=10-2x" find x's value?

YsKCreations
Автор

another way to do this: print(eval(input())) :)

ianyourgod