Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 19, 2004 1 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Programming Languages (ICE 1341) Lecture #8 Programming Languages (ICE 1341)

Similar presentations


Presentation on theme: "March 19, 2004 1 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Programming Languages (ICE 1341) Lecture #8 Programming Languages (ICE 1341)"— Presentation transcript:

1 March 19, 2004 1 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Programming Languages (ICE 1341) Lecture #8 Programming Languages (ICE 1341) Lecture #8 March 19, 2004 In-Young Ko iko.AT. icu.ac.kr Information and Communications University (ICU) iko.AT. icu.ac.kr

2 March 19, 2004 2 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Review of the Previous Lecture Program Blocks Program Blocks Scoping Rules Scoping Rules Static Scoping Static Scoping Dynamic Scoping Dynamic Scoping Scoping Issues Scoping Issues Scope Lifetime Scope Lifetime Reference Environments Reference Environments Named Constants Named Constants Variable Initialization Variable Initialization

3 March 19, 2004 3 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko The World Wide Web (WWW) “Information Management: A Proposal”, Tim Berners- Lee, CERN, March 1989 “Information Management: A Proposal”, Tim Berners- Lee, CERN, March 1989CERN A proposal to build a global hypertext system for CERN A proposal to build a global hypertext system for CERN www.w3.org/History/1989/ proposal.html www.w3.org/History/1989/ proposal.html www.w3.org/History/1989/ proposal.html www.w3.org/History/1989/ proposal.html The original proposal of the WWW

4 March 19, 2004 4 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko WWW Concepts Hypertext Universal Readership Searching Client-Server Model FormatNegotiation Image formatsImage formats Text fontsText fonts FramesFrames www.w3.org/Talks/General/Concepts.html

5 March 19, 2004 5 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Languages for WWW HTML (Hypertext Markup Language) HTML (Hypertext Markup Language) Scripting Languages (e.g., Perl, JavaScript) Scripting Languages (e.g., Perl, JavaScript) XML (Extended Markup Language) XML (Extended Markup Language) RDF (Resource Description Framework) RDF (Resource Description Framework) DAML (DARPA Agent Markup Language) DAML (DARPA Agent Markup Language) SOAP (Simple Object Access Protocol) SOAP (Simple Object Access Protocol) WSDL (Web Services Description Language) WSDL (Web Services Description Language) WSFL (Web Services Flow Language) WSFL (Web Services Flow Language) …

6 March 19, 2004 6 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Extended Markup Language (XML) A flexible text format that is originally designed for large-scale electronic publishing of documents A flexible text format that is originally designed for large-scale electronic publishing of documents Derived from SGML (Standard Generalized Markup Language, ISO 8879) Derived from SGML (Standard Generalized Markup Language, ISO 8879)ISO 8879ISO 8879 An XML document is a hierarchical organization of one or more named elements An XML document is a hierarchical organization of one or more named elements An element is composed of an opening-tag, data (string or another element), and a closing-tag An element is composed of an opening-tag, data (string or another element), and a closing-tag An opening-tag is an element name surrounded by ‘ ’ An opening-tag is an element name surrounded by ‘ ’ A closing-tag is an element name surrounded by ‘ ’ A closing-tag is an element name surrounded by ‘ ’ An element may have zero or more attributes An element may have zero or more attributes An attribute is a name-value pair that specifies a property of the element An attribute is a name-value pair that specifies a property of the element

7 March 19, 2004 7 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko An XML Document Example <class> Prog. Lang. Prog. Lang. ICE1341 ICE1341 <students> Y.K. Ko Y.K. Ko 820304 820304 </student> D.W. Kim D.W. Kim 830512 830512 </student></students></class> An opening-tag A closing-tag An element An attribute The root element A value

8 March 19, 2004 8 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko The XML Grammar document ::= prolog element Misc* document ::= prolog element Misc* element ::= EmptyElemTag | STag content ETag element ::= EmptyElemTag | STag content ETag EmptyElemTag ::= ' ' EmptyElemTag ::= ' ' STag ::= ' ' STag ::= ' ' content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)* content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)* ETag ::= ' ' ETag ::= ' ' S ::= (#x20 | #x9 | #xD | #xA)+ S ::= (#x20 | #x9 | #xD | #xA)+ Attribute ::= Name Eq AttValue Attribute ::= Name Eq AttValue Name ::= (Letter | '_' | ':') (NameChar)* Name ::= (Letter | '_' | ':') (NameChar)* Comment ::= ' ' Comment ::= ' ' XML Spec: http://www.w3.org/TR/2004/REC-xml-20040204/ http://www.w3.org/TR/2004/REC-xml-20040204/

9 March 19, 2004 9 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko An XML Document Grammar <class> Prog. Lang. Prog. Lang. ICE1341 ICE1341 <students> Y.K. Ko Y.K. Ko 820304 820304 </student> D.W. Kim D.W. Kim 830512 830512 </student></students></class> class  “ ” node “ class  “ ” node “ node  name code students name  “ ” string “ ” code  “ ” string “ ” students  “ ” student* “ ” student  “ ” name birthday “ ” birthday  “ ” num “ ”

10 March 19, 2004 10 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko XML Document Process <class> Prog. Lang. Prog. Lang. ICE1341 ICE1341 <students> Y.K. Ko Y.K. Ko 820304 820304 </student> D.W. Kim D.W. Kim 830512 830512 </student></students></class> Document Element (tagName=“class”) Element (tagName=“class”) -- childNode(0) -- childNode(0) Element (tagName=“name”, Element (tagName=“name”, nodeValue=“Prog. Lang.”) nodeValue=“Prog. Lang.”) -- childNode(1) … -- childNode(1) … -- childNode(2) -- childNode(2) Element (tagName=“students”) Element (tagName=“students”) -- childNode(0) Element (tagName=“student”, Element (tagName=“student”, attribute(0)=“id”:“20…”) attribute(0)=“id”:“20…”) -- childNode(0) -- childNode(0) Element (tagName=“name”, Element (tagName=“name”, nodeValue=“Y.K…”) nodeValue=“Y.K…”) -- childNode(1) -- childNode(1) Element (tagName=“bday”, … Element (tagName=“bday”, … DOM (Document Object Model)

11 March 19, 2004 11 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko XML Processors XML Parsers: read XML documents and provide access to their content and structure via DOM (e.g., Xerces, Sun’s Java XML Parser) XML Parsers: read XML documents and provide access to their content and structure via DOM (e.g., Xerces, Sun’s Java XML Parser) Document Filtering (Validation) Document Filtering (Validation) Document Type Declaration (DTD): a grammar for a class of XML documents Document Type Declaration (DTD): a grammar for a class of XML documents XML Schema (XSD): a successor of DTD. Describes the structure of an XML document XML Schema (XSD): a successor of DTD. Describes the structure of an XML document XML Presentation XML Presentation eXtensible Stylesheet Language (XSL): a language to define the transformation and presentation of an XML document eXtensible Stylesheet Language (XSL): a language to define the transformation and presentation of an XML document

12 March 19, 2004 12 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko XML Processing Steps XML Document Databases XML Parser DTD/ XMLSchema XSL Description XSL Processor XML Grammar (Structure) Validation class namecodestudents Prog. Lang ICE1341 studentstudent namebday namebday Y.K. Ko 820304 D.W. Kim 830512 DOM Objects HTML Presentation

13 March 19, 2004 13 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Related Materials W3C’s XML Web Site: http://www.w3.org/XML/ W3C’s XML Web Site: http://www.w3.org/XML/http://www.w3.org/XML/ XML Specification: http://www.w3.org/TR/2004/REC- xml-20040204/ XML Specification: http://www.w3.org/TR/2004/REC- xml-20040204/http://www.w3.org/TR/2004/REC- xml-20040204/http://www.w3.org/TR/2004/REC- xml-20040204/ XML Concepts: http://www.w3.org/Talks/General/Concepts.html XML Concepts: http://www.w3.org/Talks/General/Concepts.html http://www.w3.org/Talks/General/Concepts.html DTD Tutorial: http://www.w3schools.com/dtd/ DTD Tutorial: http://www.w3schools.com/dtd/http://www.w3schools.com/dtd/ XML Schema Tutorial: http://www.w3schools.com/schema/default.asp XML Schema Tutorial: http://www.w3schools.com/schema/default.asp http://www.w3schools.com/schema/default.asp W3C’s XSL Site: http://www.w3.org/Style/XSL/ W3C’s XSL Site: http://www.w3.org/Style/XSL/http://www.w3.org/Style/XSL/ Other XML-related Notes: http://www.w3.org/XML/notes.html Other XML-related Notes: http://www.w3.org/XML/notes.html http://www.w3.org/XML/notes.html

14 March 19, 2004 14 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Term Project #1 Design a structured programming language that includes the following language components Design a structured programming language that includes the following language components Type declaration statements for int, float, char, array Type declaration statements for int, float, char, array Operations: +, -, *, /, and, or, not Operations: +, -, *, /, and, or, not Assignment statement Assignment statement Conditional statement (if statement) Conditional statement (if statement) Loop (while statement) Loop (while statement) Program blocks (begin … end) Program blocks (begin … end) Develop an XML-based syntax of the language Develop an XML-based syntax of the language Write the grammar of the language in EBNF Write the grammar of the language in EBNF Write a sample program by using the language that you defined Write a sample program by using the language that you defined Display the sample program on MS Internet Explorer to validate its XML syntax Display the sample program on MS Internet Explorer to validate its XML syntax Explain the language design decisions such as application domains, and naming, binding, type compatibility, scoping rules Explain the language design decisions such as application domains, and naming, binding, type compatibility, scoping rules Due by April 2nd


Download ppt "March 19, 2004 1 ICE 1341 – Programming Languages (Lecture #8) In-Young Ko Programming Languages (ICE 1341) Lecture #8 Programming Languages (ICE 1341)"

Similar presentations


Ads by Google