SLIDE 7 7
✉
① ② ② ③ ④ ⑤✰⑥ ③ ⑦ ⑧ ② ⑨ ⑤ ⑦ ⑩ ❶ ❷✌❸ ❹ ❺ ❸✮✈ ✉ ✈ ❻ ⑩ ⑩ ❼ ❽ ❾ ❾ ❿ ❿ ❿ ➀ ➁ ⑤ ➀ ➂ ① ② ② ③ ⑤ ① ➀ ➁ ➃ ❾ ➄ ➁ ⑦ ⑤ ➁ ✈ ✉ ✈
Interpreting Java Programs
✁✄✂ ❏✰❄✰❏ ◆❇❂ ❃❅❊✡❂ ❏❇P ❘ ❏❇❂ ❍ ❂ ❍❇◆❅❂ ❍ ❘ ❍✓❉✆☎ ❍✮❈▼❏ ❘ ❏ ❘ ❍✝☎✎❃❅▲✟✞✮■ ❏ ❘ ❘ ▲ ❆ ■ ❍ ❘ ✠☛✡✌☞ ❞✻❝ ❭✰❡ ❞❤❢ s ❝ ❴❬❥ ☞ q✌❴ q✌❴✌❫ ❥ ❪ ❡ ❢✌❡ ❞✎✍ ☞ ❩ ❴✰❪ ❭✻❝ ❡ ☞ ❞✌❫ ☞ ❞❬❝ ❦✻❴ ❧ ❭✎✏ ❭ ♠❇❡ ❪ ❝ ✐✻❭✰❣✰❳ ❭✻❥ ❦✰❡ ❞✻❴ ✁✄✑ ❋✰❍ ❘ ❍ ◆❅❂ ❃❅❊✡❂ ❏❇P ❘ ❏❇❂ ❍ ❍✰❯✰❍✝✞✰❑✆☎ ❍✮❈▼❏ ❘ ❆ ▲✒☎ ❋✰❍✝✓✕✔❬❍✓❂ ❍ ❖✰❍✓❆ ❉✰❊●❂ ❑❇❉ ❃✓❉ ❏❛❉✰❏✝☎ ❆ ❄✰❍ P✩❏✝✞✰❋❇❆ ❉✰❍ ✁ ❀✮❂ ❃❅❊✡❂ ❏❇P ❘ ☎ ❏✝☎ ❍❛❆ ❘ ❏✝✞✎☎ ❑✰❏✓■ ■ ✓ ✖ ✗✙✘✌✖ ✗✌✚ ✗✜✛✆✢ ✗✝✣✥✤ ✛✕✦ ✧✩★
Program state Java class files Java Virtual Machine (JVM) JVM State inputs
selected instruction selected data program code
✪ ✫ ✬ ✭ ✮ ✮ ✯ ✰ ✱✆✲ ✯ ✳ ✴ ✮ ✵ ✱ ✳ ✶ ✷ ✸✺✹ ✻ ✼ ✹✝✽ ✪ ✽ ✾ ✶ ✶ ✿ ❀ ❁ ❁ ❂ ❂ ❂ ❃ ❄ ✱ ❃ ❅ ✭ ✮ ✮ ✯ ✱ ✭ ❃ ❄ ❆ ❁ ❇ ❄ ✳ ✱ ❄ ✽ ✪ ✽
Example: Processing XML
❈✄❉ ★❋❊❍● ✗ ❉ ✢ ✗✙✛✝✚✺✤ ■✙❏ ✗✥★▲❑✙✖ ▼✆◆✌✘❖❊ ❑✙✛✝P✜◆✆❑✝P✌✗✌◗❘✤ ✚❘❑❚❙❘❑✝❯❚❱✌❲✟✗✙✛✆❳✎❱✌✣❨✤ ✛✝P ✚ ✢ ✖ ◆✆❳✎✢ ◆✙✖ ✗✝✣❩✣✌❑✌✢ ❑❚❲ ❱❨✖ ❬☛❭✜❪ ❫ ❴✆❵ ❛✺❵ ❜✎❝ ❬❡❞ ❜✎❢ ❣✆❪ ❫ ❴✎❤✆❜✎❝✝❵ ❜✎❝✕✐✎❣✎❢ ❥❦❣✎❣✆❜❋❤✝❧✺❧✺♠ ❵ ❫ ❤✺❢ ❵ ♥✝❜✺♦ ❬❡♣✺❣✆❜✎q✝❵ ❜✎❝❋♥✺❛✎❣✆❪✙❢ ❴✎❣❍❞ ❜✎❢ ❣✆❪ ❜✎❣✎❢ r❖s t✺✉ ✈✆✉ t ✇ ① ② ③❦③✒t✎④ ① t⑥⑤ ⑦ ⑧ ⑨ ⑩ t ⑧ ⑧ ✇ ❶ ② ✇ ⑤ ⑦ ⑧ ⑨ ⑩ t ⑧ ⑧❨❷✎❸ ❸ ❹ ⑨ ① ❷ ❶ ⑨ ②✎⑩ ⑧ ❺ ❈✄❉ ★❋❊❍✘✙✖ ❱✌❳✎✗✌✚ ✚✺✤ ✛✆P✥✤ ✚❻✤ ❼❚✘✙❏ ✗✙❼❻✗✜✛✆✢ ✗✝✣❩❽✙✤ ❑❚✢ ❾✆✗❖✤ ✛✝✢ ✗✙✖ ✘✌✖ ✗✝✢ ✗✜✖✟❑✙✖ ❳✝❾✙✤ ✢ ✗✝❳✎✢ ◆✌✖ ✗ ✚ ✢ ❯✙❏ ✗
See e.g. http://www.xml101.com:8081/xml/
XML
❿➁➀❍➂➄➃✥➅❦➆✒➇❨➈❦➉➋➊❦➌✟➍ ➎✥➇✙➆✩➌✒➎✜➏ ➎✝➍❻➆✟➐❋➍ ➑✒➒❦➒❦➊✒➅➓➍ ➊✟➔✜➍ →✄➣❘➑✒➒❦➎↔➏ ➌✒➅▲➏ ➇✌➑✟➍ ➊➓➎✝➊✩➉➋➑❦➌❨➍✎➏ ➇✙➎❖➆✒➐❍➅❦➑❨➍ ➑ →✄➣❘➑✒➒❦➎↔➉↔➑✟↕➛➙✟➊➓➑✩➜ ➙❦➏ ➍✎➜ ➑✩➜ ↕ ➝➟➞✎➠❨➡ ➡ ➠✌➢➥➤ ➠✜➦ ➧❻➨✝➩✒➠✌➤
<tagname attr1=value1,…,attrn=valuen>
contents
</tagname>
<books> <book isbn=”0201199300"> <title>Software Architecture in Practice</title> <author>Len Bass</author> <author>Paul Clements</author> <author>Rick Kazman</author> </book> </books>
➫ ➭ ➯ ➲ ➳ ➳ ➵ ➸ ➺✆➻ ➵ ➼ ➽ ➳ ➾ ➺ ➼ ➚ ➪ ➶✺➹ ➘ ➴ ➹✝➷ ➫ ➷ ➬ ➚ ➚ ➮ ➱ ✃ ✃ ❐ ❐ ❐ ❒ ❮ ➺ ❒ ❰ ➲ ➳ ➳ ➵ ➺ ➲ ❒ ❮ Ï ✃ Ð ❮ ➼ ➺ ❮ ➷ ➫ ➷
XML DTD’s
Ñ➁Ò❩Ó✌Ô✜Ó❩Õ Ó✙Ö✺× Ø✆Ù⑥Ú✆Û✎Ü✌Ô✌Ý✆Þ✎Ú❻Ó✙Ú✎ß à Û✆à Ü à Ö✝Û✺á❨â✺Ú✺ã × ä à å Ú✺ã▲æ Ú✎ç✆è✝æ✺Ø✺ã Ú❘Ö✺ß✙Ü è✺ç✆ã▲à Û❘è Þ è✆ä Ü à × Ø✆æ è✆ä❨é à Û✎â❋Ö✺ß✜ê✙ë✩ì⑥â✺Ö✺× Ø✆Ù⑥Ú✆Û✎Ü
<!DOCTYPE listOfBooks [
<!ELEMENT books (book*)> <!ELEMENT book (title,author+)> <!ATTLIST book isbn CDATA “0”> <!ELEMENT title (#CDATA)> <!ELEMENT author (#CDATA)>
]> <listOfBooks>
<books> <book isbn=”0201199300"> <title>Software Architecture in Practice</title> <author>Len Bass</author> <author>Paul Clements</author> <author>Rick Kazman</author> </book> </books> Example document following this DTD