PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, 2000 1 PZ14A - Text processing Programming Language Design and.

Slides:



Advertisements
Similar presentations
DOCUMENT TYPES. Digital Documents Converting documents to an electronic format will preserve those documents, but how would such a process be organized?
Advertisements

A complete citation, notecard, and outlining tool
With Microsoft ® Excel 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 GO! with Microsoft ® Excel 2010 Chapter 1 Creating a Worksheet and.
Chapter 3 Creating a Business Letter with a Letterhead and Table
Creating and Editing a Web Page Using Inline Styles
Introduction to Microsoft Excel 2010 Chapter Extension 3.
Header and footer basics Add page numbers, date, and more Think of page formatting in a book. The book title is at the top of one page, the chapter title.
COE201 – Computer Proficiency Mr. Hamze Msheik
Microsoft Word Objectives: Word processing using Microsoft Word
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. Office PowerPoint 2007 Lab 1 Creating a Presentation.
Introduction to LaTeX CPS470 Software Engineering Fall 1998.
XP New Perspectives on Microsoft Office Word 2003 Tutorial 1 1 Microsoft Office Word 2003 Tutorial 1 – Creating a Document.
XP 1 Microsoft Office Word 2003 Tutorial 1 – Creating a Document.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Quark QuarkXPress 4 Intermediate Level Course. Working with Master Pages The Document Layout Palette allows you to add, delete, and move document and.
Chapter 12: Network Programming Desktop Publishing Translator models Latex Documentation Preparation Postscript programming language WYSIWIG Editors.
1 Chapter 11 Developing Custom Help. 11 Chapter Objectives Use HTML to create customized Help topics for an application Use the HTML Help Workshop to.
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Chapter 3 Planning Your Solution
Chapter 5 Using Business Information Sets
Database Design IST 7-10 Presented by Miss Egan and Miss Richards.
Module 3 Productivity Programs Common Features and Commands Microsoft Office 2007.
Word processing June 2013.
Welcome to the 3-day Workshop on > Presented by Saeid Abolfazli Faculty of Computer Science and IT University Malaya 23,24, and.
A First Program Using C#
W rking with W rds Word Processing and Desktop Publishing o o.
Word Processing ADE100- Computer Literacy Lecture 12.
Lecture 2 Character Codes and Low-Structure Text Document Formats.
Microsoft Office Word 2003 Tutorial 1 Creating a Document.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
PZ07A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ07A - Expressions Programming Language Design and Implementation.
Introduction to Unix – CS 21 Lecture 16. Lecture Overview LaTeX History Running and creating LaTeX documents Documents and Articles Tables Lists Fonts.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
XP New Perspectives on The Internet, Sixth Edition— Comprehensive Tutorial 8 1 Creating Effective Web Pages Creating HTML Documents Tutorial 8.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
XP 1 Microsoft Word 2002 Tutorial 1 – Creating a Document.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
Welcome! The Topic For Today Is Word Processing and Desktop Publishing.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
Chapter 1 Creating a Dreamweaver Web Page and Local Site
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
PZ07A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ07A - Expressions Programming Language Design and Implementation.
Microsoft® Excel Key and format dates and times. 1 Use Date & Time functions. 2 Use date and time arithmetic. 3 Use the IF function. 4 Create.
Chapter Three The UNIX Editors.
Text processing Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section 12.1.
1 Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
IS 1014 Introduction to Computer Graphics -- Paul Munro A Postscript Tutorial Book available at: cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF.
 Start Microsoft Word from the icon or shortcut for the application. This is usually accessible from the Start Button. Then go to Programs, then Microsoft.
Landscaper 101. Time Code AMC AMCNET HELP!!! Where do you go for help? –Upper right corner has a ? for the online help –This presentation.
Chapter 10 Creating a Template for an Online Form Microsoft Word 2013.
Computer Literacy for IC 3 Unit 2: Using Productivity Software Chapter 10: Enhancing a Presentation © 2010 Pearson Education, Inc. | Publishing as Prentice.
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
1 Week # 4 Introduction to PDM PDM is a workbench environment that lets programmers and system operators navigate the three levels of the AS/400’s object-based.
Chapter – 8 Software Tools.
Creating and Editing a Web Page Using Inline Styles
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Laboratory Exercise # 10 – Microsoft Word Additional Topics Office Productivity Tools 1 Laboratory Exercise # 10 Microsoft Word Additional Topics Objectives:
Academic Computing Services 2007 Microsoft Word 2010 Publishing Long Documents This Guide will teach you how to work with long documents such as dissertations.
Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Microsoft Excel Illustrated Introductory Workbooks and Preparing them for the Web Managing.
Microsoft Word Objectives: Word processing using Microsoft Word
CSCI-235 Micro-Computer Applications
Tutorial 1 – Creating a Document
Page description language from Adobe
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Text processing Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section 12.1.
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Presentation transcript:

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ14A - Text processing Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section 12.1

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, Desktop publishing Traditional publication systems: WYSIWYG - What you see is what you get Typewriters examples of early WYSIWYG systems More complex today - Multiple fonts, colors, embedded graphics Need for embedded commands to describe layout of document Three approaches to desktop publishing: WYSIWYG Page description languages Document compiling

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, WYSIWYG A common approach in PC world Tools like Microsoft Word and Corel WordPerfect Embedded commands in document to control layout (fonts, colors, font size, location of objects) Rich Text Format (RTF) - An ASCII language for describing such layout. Can be used to pass information among different processors

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, LaTeX TeX: Document processing system developed by Donald Knuth a macro processing system for creation of string text (i.e., documents) Arcane syntax LaTeX: Macros for TeX a set of macros developed for TeX by Leslie Lamport creates a series of environments and control structures similar to programming language structures for lack of a better term, we often refer to the compiling of the book as various chapters are processed by the TeX program This book developed using LaTeX

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, LaTeX execution Executes much like a traditional compiler: First pass: –Read in text and create output format. –Create symbol table for all internal references (section numbers, page numbers, figure numbers) –Create table of contents and index, if desired Second pass: –Read in text and create output format. –This time, internal references are correct because of symbol table created during pass 1. Third pass: –If no changes made to symbol table by pass 2, same as pass 2; otherwise repeat pass 2, again until no further changes are made to symbol table [Why more than 2 passes? - Think of putting a table of contents at beginning of a report.]

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, LaTeX features LaTeX creates environments that make TeX easier to use. These behave much like C or Pascal scope rules For example, one can begin and end a list of items: Numbered \begin{enumerate} \item text [Prints as number 1] \item text [prints as number 2] \end{enumerate} [End of list] Bulleted (“itemized”) Named (“description”) Starting new sections or subsections automatically adjusts the appropriate section numbers. LaTeX has a syntax similar to the block-structured style of a programming languages.

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, LaTeX structure

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, LaTeX execution By invoking LaTeX, the latex.tex macros are read into TeX to create commands for chapters, sections, subsections, figures, tables, lists, and the numerous other structures needed to write simple documents. The documentstyle command (in LaTeX) allows the user to add other style features. The required article parameter causes article.sty to be read in to tailor latex.tex with commands needed for an article. For example, there are no chapters in articles, but for style book (i.e., book.sty), chapters are defined. 11pt defines the size of the text font (11-point type), and art11.sty is read giving additional information on line and character spacing for 11- point type. The TeX program along with article.sty and art11.sty form the standard way to process a LaTeX article. Mystyle.sty defines addition maccros a user can add to tailor LaTeX for a specific document.

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, Page description languages A Postscript program consists of five components: 1. An interpreter for performing calculations. A simple postfix execution stack is the basic model. 2. A language syntax. This is based on Forth. 3. Painting extensions. An extension to Forth with painting commands for managing the process of painting text and pictures on a sheet of paper. 4. Defines a virtual machine for drawing information (text and graphics on a page). The showpage operator causes the described page to be displayed 5. Conventions. A series of conventions, not part of the formal Postscript language, that various printers use for consistency in presentation. Use of these conventions makes it easier for transporting postscript documents from one system to another.

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, Postscript execution model A Postscript program consists of a sequence of commands that represent the postfix of the algorithm necessary to paint the document. Postscript execution begins with two entries initially on the stack, which the program may not remove: Systemdict is the system dictionary, which represents the initial binding of Postscript objects to their internal representation. Userdict is the user dictionary, which represents the new definitions included within this execution of a Postscript program. This may include redefinition of primitive objects already defined in systemdict.

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, Sample Postscript command Each argument is stacked on Postscript stack: /box {newpath 0 0 moveto 0 1 lineto 3 1 lineto 3 0 lineto closepath} def /box: Add name box to stack. / says this is a definition and not to evaluate arguments, only move to stack (like quote in LISP) newpath: start a new path moveto: Take top two stack arguments and move cursor to that (X,Y) location lineto: Draw line from current cursor to the (X,Y) address, which is the top two stack numbers closepath: Draw line back to newpath location def: Everything within {... } is defined to be command box [Note that the command box now draws a rectangle from (0,0) to (0,1) to (3,1) to (3,0) and back to (0,0)]

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, Summary Note differences between models: LaTeX and MS Word - define the layout of the final document Postscript - defines a program which computes the final layout. A Postscript printer contains an interpreter that executes the Postscript program to produce the final printed document

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, Postscript execution stacks 1. The operand stack contains the operands as they are stacked,executed, and unstacked. 2. The dictionary stack contains only dictionary objects. This stack defines the scope and context of each definition. 3. The execution stack contains executable objects. For the most part, these are functions in intermediate stages of execution. 4. The graphics state stack manages the context for painting objects on the page A Postscript program is a sequence of ASCII characters. As each token is read, its definition is accessed in the stack (by first looking in userdict and then systemdict) and executed by an appropriate action.

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, Document conventions Conventions built into all Postscript interpreters: The leading comment should be%!PS That informs the interpreter that the file is a Postscript program. Each page of a document is usually bracketed by a save and a restore command to isolate that page from the effects of other pages. %DocumentFonts: a list of fonts used in the document %Title: an arbitrary string, the title of the document %Creator: the name of the program that created the file %CreationDate: the date and time of creation %Pages: the number of pages in the document. %BoundingBox: the four values that represent the lower left and upper right corners of the page that are actually painted by the program. This allows the pages to be inserted into other documents.

PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, Postscript summary Postscript was developed to be a virtual machine architecture that can be used to create printable documents. Postscript of a document is not meant to be read by a programmer. However, the syntax is quite simple and easily understood. Postscript has been developed further by Adobe with the creation of their Portable Document Format (PDF). PDF is a form of compressed Postscript. PDF readers are freely available over the Internet, and most Web browsers can display PDF files. PDF has become ubiquitous for the transmission and display of formatted documents. Giving away PDF display programs was a shrewd move for Adobe because they sell the Acrobat program needed to create PDF documents.