Download presentation
Presentation is loading. Please wait.
1
Compiler Construction
Sohail Aslam Lecture 16 compiler: intro
2
Example: 2+4*6 >> Expr::isPresent() >> Term::isPresent()
>> Factor::isPresent() token: 2 (257) << Factor::isPresent() return true >> Tprime::isPresent() token: + (267) << Tprime::isPresent() return false << Term::isPresent() return true end of lec 15 compiler: intro
3
Example: 2+4*6 >> Eprime::isPresent() token: + (267)
>> Term::isPresent() >> Factor::isPresent() token: 4 (257) << Factor::isPresent() return true >> Tprime::isPresent() token: * (269) token: 6 (257)
4
Example: 2+4*6 >> Tprime::isPresent() token: (0)
<< Tprime::isPresent() return false << Tprime::isPresent() return true << Term::isPresent() return true >> Eprime::isPresent() << Eprime::isPresent() return false << Eprime::isPresent() return true << Expr::isPresent() return true
5
Example: 2+4*6 ** AST ** (2+(4*6)) + 2 * 4 6
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.