1 / 2

Composite Pattern: Expressions

Assign. BinaryExp. Add. Expression. Constant. Variable. 2. Composite Pattern: Expressions. Leaf and non-Leaf (part/whole) have same interface Treat whole like part How are parts added to a whole? Simple interface, control propagates through system

hollie
Download Presentation

Composite Pattern: Expressions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Assign BinaryExp Add Expression Constant Variable 2 Composite Pattern: Expressions • Leaf and non-Leaf (part/whole) have same interface • Treat whole like part • How are parts added to a whole? • Simple interface, control propagates through system • Expression and BinaryExp are abstract base classes • What makes a class abstract? • Why are abstract classes designed? • How is a BinaryExp class evaluated? • What about a Constant? Variable?

  2. Production GrammarElement Terminal Nonterminal Definition RSG Composite • What’s in a Production? • What’s in a Definition? • What’s in a Nonterminal? * *

More Related