Encapsulavon cse341 programming cse341 programming

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lecture 1 Lecture 1 –  Will oPen access and manipulate subtrees directly Course Mechanics Course Mechanics •  Visitor object can also include local data (state) ML Variable Bindings shared bMthe visitor methods y L Variable Bindings Dan Grossman Dan Grossman public class TypeCheckVisitor extends NodeVisitor { Fall 2011 Fall 2011 public void visit(WhileNode s) { … } public void visit(IfNode s) { … } … private <local state>; // all methods can read/write this } Winter 2013 UW CSE 401 (Michael Ringenburg) 6 A Brief Word About EncapsulaVon CSE341: Programming CSE341: Programming Languages Languages •  A visitor object oPen needs to be able to access state iLecture ST nLecture 1 n the A1 odes Course Course Mechanics Mechanics –  Thus, ML Variable Bindings ore node state than may need to expose m Bindings ML Variable we might do to otherwise Dan Grossman Dan tradeoff –  Overall a good Grossman – bFall 2011 odularity eHer m Fall 2011 •  (plus, the nodes are relaVvely simple data objects anyway – not hiding much of anything) Winter 2013 UW CSE 401 (Michael Ringenburg) 7 References CSE341: Programming CSE341: Programming Languages Languages •  For Visitor paHern (and many others) Lecture 1 Lectur...
View Full Document

Ask a homework question - tutors are online