Skip to content
VUBuddy

CS606 Short Notes Lecture 15

Compiler Construction PDF 13 KBUpdated 23 Oct 2026
Quiz CS606 Short Notes Lecture 15 PDF 13 KB
vubuddy.com
Type
Quiz
Course
CS606 Compiler Construction
Size
PDF 13 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 13 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2 of 2. Download the file for all 2 pages.

Lecture 15

Let’s consider the implementation of the C++ classes for the non-terminals. We start with Expr.

bool Expr::isPresent() · Term* op1 = new Term(s); · Eprime* op2 = new Eprime(s, tree); · bool Eprime::isPresent() · if(op==PLUS || op==MINUS){ s->advance(); · Term* op2=new Term(s); · Eprime* op3 = new Eprime(s, tree); · bool Term::isPresent() · bool Tprime::isPresent() · if(op == MUL || op == DIV){ s->advance(); · bool Factor::isPresent() · if(op == ID || op == NUM)

tree = new TreeNode(op,s->tokenValue()); s->advance();

if( op == LPAREN ){ · s->advance(); · Expr* opr = new Expr(s); if(!opr->isPresent() ) · if(s->nextToken() != RPAREN) · s->advance(); · tree = opr->AST();

All CS606 files →
CS606 Compiler Construction All CS606 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.