FIRST and FOLLOW sets a necessary preliminary to constructing the LL(1) parsing table
|
|
|
- Stuart Hampton
- 10 years ago
- Views:
Transcription
1 FIRST and FOLLOW sets a necessary preliminary to constructing the LL(1) parsing table Remember: A predictive parser can only be built for an LL(1) grammar. A grammar is not LL(1) if it is: 1. Left recursive, or 2. Not left factored. However, grammars that are not left recursive and are left factored may still not be LL(1). To see if a grammar is LL(1), try to build the parse table for the predictive parser by the method we are about to describe. If any element in the table contains more than one grammar rule right-hand side, then the grammar is not LL(1). To build the table, we must must compute FIRST and FOLLOW sets for the grammar. 1
2 FIRST Sets Ultimately, we want to define FIRST sets for the right-hand sides of each of the grammar s productions. The idea is that for a sequence α of symbols, FIRST(α) is the set of terminals that begin the strings derivable from α, and also, if α can derive ǫ, then ǫ is in FIRST(α). By allowing ǫ to be in FIRST(α), we can avoid defining the notion of nullable as Appel does in the book. More formally: FIRST(α) = {t (t is a terminal and α tβ) or (t = ǫ and α ǫ)} To define FIRST(α) for arbitrary α, we start by defining FIRST(X), for a single symbol X (a terminal, a nonterminal, or ǫ): X is a terminal: FIRST(X) = X X is ǫ: FIRST(X) = ǫ 2
3 X is a nonterminal. In this case, we must look at all grammar productions with X on the left, i.e., productions of the form: X Y 1 Y 2 Y 3... Y k where each Y k is a single terminal or nonterminal (or there is just one Y, and it is ǫ). For each such production, we perform the following actions: Put FIRST(Y 1 ) {ǫ} into FIRST(X). If ǫ is in FIRST(Y 1 ), then put FIRST(Y 2 ) {ǫ} into FIRST(X). If ǫ is in FIRST(Y 2 ), then put FIRST(Y 3 ) {ǫ} into FIRST(X).... If ǫ is in FIRST(Y i ) for 1 i k (all production right- hand sides) then put ǫ into FIRST(X). For example, compute the FIRST sets of each of the non-terminals in the following grammar: exp term exp 3
4 exp term exp ǫ term factor term term / factor term ǫ factor INTLITERAL ( exp ) Once we have computed FIRST(X) for each terminal and nonterminal X, we can compute FIRST(α) for every production s right-hand-side α. In general, alpha will be of the form: X 1 X 2... X n where each X is a single terminal or nonterminal, or there is just one X 1 and it is ǫ. The rules for computing FIRST(α) are essentially the same as the rules for computing the first set of a nonterminal. Put FIRST(X 1 ) {ǫ} into FIRST(α) If ǫ is in FIRST(X 1 ) put FIRST(X 2 ) {ǫ} into FIRST(α). 4
5 ... If ǫ is in the FIRST set for every X k, put ǫ into FIRST(α). For the example grammar above, compute the FIRST sets for each production s right-hand side. Why do we care about the FIRST(α) sets? During parsing, suppose the top-of- stack symbol is nonterminal A, that there are two productions A α and A β, and that the current token is a. Well, if FIRST(α) includes a... 5
6 FOLLOW sets FOLLOW sets are only defined for single nonterminals. The definition is as follows: For a nonterminal A, FOLLOW(A) is the set of terminals that can appear immediately to the right of A in some partial derivation; i.e., terminal t is in FOLLOW(A) if: S +... A t... where t is a terminal Furthermore, if A can be the rightmost symbol in a derivation, then EOF is in FOLLOW(A). It is worth noting that epsilon is never in a FOLLOW set. Notationally: 6
7 FOLLOW(A) = {t (t is a terminal and S + α A t β) or (t is EOF and S αa)} Some conditions under which symbols a, c, and EOF are in the FOLLOW set of nonterminal A: S S S / \ / \ / \ / \ / \ / \ / \ / X Y\ / \ / /\ \ / / \ / \ A \ /\ (A) /\ A B /\ / \ / / \ (a)b c epsilon / \ / / \ EOF is in FOLLOW(A) (c)d e f a is in FOLLOW(A) \ c is in FOLLOW(A) 7
8 How to compute FOLLOW(A) for each nonterminal A: If A is the start nonterminal, put EOF in FOLLOW(A) Find the productions with A on the right-hand-side: For each production X αaβ, put FIRST(β) {ǫ} in FOLLOW(A) If ǫ is in F IRST(β) then put F OLLOW(X) into F OLLOW(A) For each production X αa, put FOLLOW(X) into FOLLOW(A) Note that To compute FIRST(A) you must look for A on a production s left-hand side. To compute FOLLOW(A) you must look for A on a production s right-hand side. FIRST and FOLLOW sets are always sets of terminals (plus, perhaps, ǫ for FIRST sets, and EOF for follow sets). Nonterminals are never in a FIRST or a FOLLOW set. 8
9 Example: Compute FOLLOW sets of the non-terminals in the following language: S B c D B B a b c S D d ǫ Why do we care about FOLLOW sets? Suppose during parsing we have X on top of the stack and a is the current token. What if X has two productions X α and X β but a is not in the FIRST set of either α or β? 9
10 How to build parse tables and tell if a grammar is LL(1) To build the table, we fill in the rows one at a time for each nonterminal X as follows: for each production X α for each terminal t in First(α): put α in Table[X,t] if ǫ is in First(α) then: for each terminal t in Follow(X): put α in Table[X,t] The grammar is not LL(1) if and only if there is more than one entry for any cell in the table. Try building a parse table for the following grammar: S B c D B B a b c S D d ǫ 10
Syntaktická analýza. Ján Šturc. Zima 208
Syntaktická analýza Ján Šturc Zima 208 Position of a Parser in the Compiler Model 2 The parser The task of the parser is to check syntax The syntax-directed translation stage in the compiler s front-end
FIRST AND FOLLOW Example
FIRST AND FOLLOW Example CS 447 -- Stephen Watt University of Western Ontario Copyright 2007 Stephen M. Watt FIRST/FOLLOW Main Ideas Look at all the grammar rules. Examine the possibilities of all substrings
If-Then-Else Problem (a motivating example for LR grammars)
If-Then-Else Problem (a motivating example for LR grammars) If x then y else z If a then if b then c else d this is analogous to a bracket notation when left brackets >= right brackets: [ [ ] ([ i ] j,
Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology
Honors Class (Foundations of) Informatics Tom Verhoeff Department of Mathematics & Computer Science Software Engineering & Technology www.win.tue.nl/~wstomv/edu/hci c 2011, T. Verhoeff @ TUE.NL 1/20 Information
COMP 356 Programming Language Structures Notes for Chapter 4 of Concepts of Programming Languages Scanning and Parsing
COMP 356 Programming Language Structures Notes for Chapter 4 of Concepts of Programming Languages Scanning and Parsing The scanner (or lexical analyzer) of a compiler processes the source program, recognizing
Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh [email protected].
Pushdown automata Informatics 2A: Lecture 9 Alex Simpson School of Informatics University of Edinburgh [email protected] 3 October, 2014 1 / 17 Recap of lecture 8 Context-free languages are defined by context-free
CS143 Handout 08 Summer 2008 July 02, 2007 Bottom-Up Parsing
CS143 Handout 08 Summer 2008 July 02, 2007 Bottom-Up Parsing Handout written by Maggie Johnson and revised by Julie Zelenski. Bottom-up parsing As the name suggests, bottom-up parsing works in the opposite
University of Toronto Department of Electrical and Computer Engineering. Midterm Examination. CSC467 Compilers and Interpreters Fall Semester, 2005
University of Toronto Department of Electrical and Computer Engineering Midterm Examination CSC467 Compilers and Interpreters Fall Semester, 2005 Time and date: TBA Location: TBA Print your name and ID
Context free grammars and predictive parsing
Context free grammars and predictive parsing Programming Language Concepts and Implementation Fall 2012, Lecture 6 Context free grammars Next week: LR parsing Describing programming language syntax Ambiguities
Bottom-Up Parsing. An Introductory Example
Bottom-Up Parsing Bottom-up parsing is more general than top-down parsing Just as efficient Builds on ideas in top-down parsing Bottom-up is the preferred method in practice Reading: Section 4.5 An Introductory
Bottom-Up Syntax Analysis LR - metódy
Bottom-Up Syntax Analysis LR - metódy Ján Šturc Shift-reduce parsing LR methods (Left-to-right, Righ most derivation) SLR, Canonical LR, LALR Other special cases: Operator-precedence parsing Backward deterministic
Compiler Construction
Compiler Construction Regular expressions Scanning Görel Hedin Reviderad 2013 01 23.a 2013 Compiler Construction 2013 F02-1 Compiler overview source code lexical analysis tokens intermediate code generation
SOLUTION Trial Test Grammar & Parsing Deficiency Course for the Master in Software Technology Programme Utrecht University
SOLUTION Trial Test Grammar & Parsing Deficiency Course for the Master in Software Technology Programme Utrecht University Year 2004/2005 1. (a) LM is a language that consists of sentences of L continued
Lexical analysis FORMAL LANGUAGES AND COMPILERS. Floriano Scioscia. Formal Languages and Compilers A.Y. 2015/2016
Master s Degree Course in Computer Engineering Formal Languages FORMAL LANGUAGES AND COMPILERS Lexical analysis Floriano Scioscia 1 Introductive terminological distinction Lexical string or lexeme = meaningful
Basic Parsing Algorithms Chart Parsing
Basic Parsing Algorithms Chart Parsing Seminar Recent Advances in Parsing Technology WS 2011/2012 Anna Schmidt Talk Outline Chart Parsing Basics Chart Parsing Algorithms Earley Algorithm CKY Algorithm
Design Patterns in Parsing
Abstract Axel T. Schreiner Department of Computer Science Rochester Institute of Technology 102 Lomb Memorial Drive Rochester NY 14623-5608 USA [email protected] Design Patterns in Parsing James E. Heliotis
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2005 Handout 7 Scanner Parser Project Wednesday, September 7 DUE: Wednesday, September 21 This
Formal Grammars and Languages
Formal Grammars and Languages Tao Jiang Department of Computer Science McMaster University Hamilton, Ontario L8S 4K1, Canada Bala Ravikumar Department of Computer Science University of Rhode Island Kingston,
Compiler I: Syntax Analysis Human Thought
Course map Compiler I: Syntax Analysis Human Thought Abstract design Chapters 9, 12 H.L. Language & Operating Sys. Compiler Chapters 10-11 Virtual Machine Software hierarchy Translator Chapters 7-8 Assembly
Flex/Bison Tutorial. Aaron Myles Landwehr [email protected] CAPSL 2/17/2012
Flex/Bison Tutorial Aaron Myles Landwehr [email protected] 1 GENERAL COMPILER OVERVIEW 2 Compiler Overview Frontend Middle-end Backend Lexer / Scanner Parser Semantic Analyzer Optimizers Code Generator
About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design
i About the Tutorial A compiler translates the codes written in one language to some other language without changing the meaning of the program. It is also expected that a compiler should make the target
Lecture Notes on Database Normalization
Lecture Notes on Database Normalization Chengkai Li Department of Computer Science and Engineering The University of Texas at Arlington April 15, 2012 I decided to write this document, because many students
Grammars and Parsing. 2. A finite nonterminal alphabet N. Symbols in this alphabet are variables of the grammar.
4 Grammars and Parsing Formally a language is a set of finite-length strings over a finite alphabet. Because most interesting languages are infinite sets, we cannot define such languages by enumerating
Stanford Math Circle: Sunday, May 9, 2010 Square-Triangular Numbers, Pell s Equation, and Continued Fractions
Stanford Math Circle: Sunday, May 9, 00 Square-Triangular Numbers, Pell s Equation, and Continued Fractions Recall that triangular numbers are numbers of the form T m = numbers that can be arranged in
1.4 Compound Inequalities
Section 1.4 Compound Inequalities 53 1.4 Compound Inequalities This section discusses a technique that is used to solve compound inequalities, which is a phrase that usually refers to a pair of inequalities
Lecture 9. Semantic Analysis Scoping and Symbol Table
Lecture 9. Semantic Analysis Scoping and Symbol Table Wei Le 2015.10 Outline Semantic analysis Scoping The Role of Symbol Table Implementing a Symbol Table Semantic Analysis Parser builds abstract syntax
Compiler Design July 2004
irst Prev Next Last CS432/CSL 728: Compiler Design July 2004 S. Arun-Kumar [email protected] Department of Computer Science and ngineering I. I.. Delhi, Hauz Khas, New Delhi 110 016. July 30, 2004
We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: 9081 + 900b + 90c = 9001 + 100c + 10b
In this session, we ll learn how to solve problems related to place value. This is one of the fundamental concepts in arithmetic, something every elementary and middle school mathematics teacher should
The previous chapter provided a definition of the semantics of a programming
Chapter 7 TRANSLATIONAL SEMANTICS The previous chapter provided a definition of the semantics of a programming language in terms of the programming language itself. The primary example was based on a Lisp
Chapter 7 Uncomputability
Chapter 7 Uncomputability 190 7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction
To give it a definition, an implicit function of x and y is simply any relationship that takes the form:
2 Implicit function theorems and applications 21 Implicit functions The implicit function theorem is one of the most useful single tools you ll meet this year After a while, it will be second nature to
How to make the computer understand? Lecture 15: Putting it all together. Example (Output assembly code) Example (input program) Anatomy of a Computer
How to make the computer understand? Fall 2005 Lecture 15: Putting it all together From parsing to code generation Write a program using a programming language Microprocessors talk in assembly language
Base Conversion written by Cathy Saxton
Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,
03 - Lexical Analysis
03 - Lexical Analysis First, let s see a simplified overview of the compilation process: source code file (sequence of char) Step 2: parsing (syntax analysis) arse Tree Step 1: scanning (lexical analysis)
Computer Science 281 Binary and Hexadecimal Review
Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two
Lexical Analysis and Scanning. Honors Compilers Feb 5 th 2001 Robert Dewar
Lexical Analysis and Scanning Honors Compilers Feb 5 th 2001 Robert Dewar The Input Read string input Might be sequence of characters (Unix) Might be sequence of lines (VMS) Character set ASCII ISO Latin-1
Architectural Design Patterns for Language Parsers
Architectural Design Patterns for Language Parsers Gábor Kövesdán, Márk Asztalos and László Lengyel Budapest University of Technology and Economics Department of Automation and Applied Informatics Magyar
Static vs. Dynamic. Lecture 10: Static Semantics Overview 1. Typical Semantic Errors: Java, C++ Typical Tasks of the Semantic Analyzer
Lecture 10: Static Semantics Overview 1 Lexical analysis Produces tokens Detects & eliminates illegal tokens Parsing Produces trees Detects & eliminates ill-formed parse trees Static semantic analysis
16. Recursion. COMP 110 Prasun Dewan 1. Developing a Recursive Solution
16. Recursion COMP 110 Prasun Dewan 1 Loops are one mechanism for making a program execute a statement a variable number of times. Recursion offers an alternative mechanism, considered by many to be more
Lecture 1. Basic Concepts of Set Theory, Functions and Relations
September 7, 2005 p. 1 Lecture 1. Basic Concepts of Set Theory, Functions and Relations 0. Preliminaries...1 1. Basic Concepts of Set Theory...1 1.1. Sets and elements...1 1.2. Specification of sets...2
Notes on Excel Forecasting Tools. Data Table, Scenario Manager, Goal Seek, & Solver
Notes on Excel Forecasting Tools Data Table, Scenario Manager, Goal Seek, & Solver 2001-2002 1 Contents Overview...1 Data Table Scenario Manager Goal Seek Solver Examples Data Table...2 Scenario Manager...8
Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi
Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the
Introduction to Turing Machines
Automata Theory, Languages and Computation - Mírian Halfeld-Ferrari p. 1/2 Introduction to Turing Machines SITE : http://www.sir.blois.univ-tours.fr/ mirian/ Automata Theory, Languages and Computation
9.2 Summation Notation
9. Summation Notation 66 9. Summation Notation In the previous section, we introduced sequences and now we shall present notation and theorems concerning the sum of terms of a sequence. We begin with a
6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10
Lesson The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base- system. When you
2.2. Instantaneous Velocity
2.2. Instantaneous Velocity toc Assuming that your are not familiar with the technical aspects of this section, when you think about it, your knowledge of velocity is limited. In terms of your own mathematical
CS / IT - 703 B.E. VII Semester Examination, December 2013 Cloud Computing Time : Three Hours Maximum Marks : 70
CS / IT - 703 B.E. VII Semester Examination, December 2013 Cloud Computing Time : Three Hours Maximum Marks : 70 Note: All questions are compulsory and carry equal marks. Unit - I 1. a) Differentiate between
LZ77. Example 2.10: Let T = badadadabaab and assume d max and l max are large. phrase b a d adadab aa b
LZ77 The original LZ77 algorithm works as follows: A phrase T j starting at a position i is encoded as a triple of the form distance, length, symbol. A triple d, l, s means that: T j = T [i...i + l] =
Discrete Mathematics: Homework 7 solution. Due: 2011.6.03
EE 2060 Discrete Mathematics spring 2011 Discrete Mathematics: Homework 7 solution Due: 2011.6.03 1. Let a n = 2 n + 5 3 n for n = 0, 1, 2,... (a) (2%) Find a 0, a 1, a 2, a 3 and a 4. (b) (2%) Show that
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Scanner-Parser Project Thursday, Feb 7 DUE: Wednesday, Feb 20, 9:00 pm This project
Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile
Pushdown Automata In the last section we found that restricting the computational power of computing devices produced solvable decision problems for the class of sets accepted by finite automata. But along
MATHEMATICS OF FINANCE AND INVESTMENT
MATHEMATICS OF FINANCE AND INVESTMENT G. I. FALIN Department of Probability Theory Faculty of Mechanics & Mathematics Moscow State Lomonosov University Moscow 119992 [email protected] 2 G.I.Falin. Mathematics
Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages
Introduction Compiler esign CSE 504 1 Overview 2 3 Phases of Translation ast modifled: Mon Jan 28 2013 at 17:19:57 EST Version: 1.5 23:45:54 2013/01/28 Compiled at 11:48 on 2015/01/28 Compiler esign Introduction
Turing Machines: An Introduction
CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions,
A Formal Theory of Inductive Inference. Part II
A Formal Theory of Inductive Inference. Part II Ray J. Solomonoff Visiting Professor, Computer Learning Research Center Royal Holloway, University of London IDSIA, Galleria, CH 698 Manno Lugano, Switzerland
Compilers Lexical Analysis
Compilers Lexical Analysis SITE : http://www.info.univ-tours.fr/ mirian/ TLC - Mírian Halfeld-Ferrari p. 1/3 The Role of the Lexical Analyzer The first phase of a compiler. Lexical analysis : process of
NATURAL LANGUAGE QUERY PROCESSING USING SEMANTIC GRAMMAR
NATURAL LANGUAGE QUERY PROCESSING USING SEMANTIC GRAMMAR 1 Gauri Rao, 2 Chanchal Agarwal, 3 Snehal Chaudhry, 4 Nikita Kulkarni,, 5 Dr. S.H. Patil 1 Lecturer department o f Computer Engineering BVUCOE,
SPSS Workbook 1 Data Entry : Questionnaire Data
TEESSIDE UNIVERSITY SCHOOL OF HEALTH & SOCIAL CARE SPSS Workbook 1 Data Entry : Questionnaire Data Prepared by: Sylvia Storey [email protected] SPSS data entry 1 This workbook is designed to introduce
Business Process- and Graph Grammar-Based Approach to ERP System Modelling
JOURNAL OF APPLIED COMPUTER SCIENCE Vol. 20 No. 1 (2012), pp. 7-21 Business Process- and Graph Grammar-Based Approach to ERP System Modelling Mariusz Flasiński, Janusz Jurek Jagiellonian University IT
Using MS Excel to Analyze Data: A Tutorial
Using MS Excel to Analyze Data: A Tutorial Various data analysis tools are available and some of them are free. Because using data to improve assessment and instruction primarily involves descriptive and
7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix
7. LU factorization EE103 (Fall 2011-12) factor-solve method LU factorization solving Ax = b with A nonsingular the inverse of a nonsingular matrix LU factorization algorithm effect of rounding error sparse
Think it s not worth the hassle to switch your checking account? With Fairport Savings Bank, it takes just minutes to switch!
Think it s not worth the hassle to switch your checking account? With Fairport Savings Bank, it takes just minutes to switch! Open a new Fairport Savings Bank Checking account Our branch representatives
Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6)
Semantic Analysis Scoping (Readings 7.1,7.4,7.6) Static Dynamic Parameter passing methods (7.5) Building symbol tables (7.6) How to use them to find multiply-declared and undeclared variables Type checking
28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE. v x. u y v z u z v y u y u z. v y v z
28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE 1.4 Cross Product 1.4.1 Definitions The cross product is the second multiplication operation between vectors we will study. The goal behind the definition
#1-12: Write the first 4 terms of the sequence. (Assume n begins with 1.)
Section 9.1: Sequences #1-12: Write the first 4 terms of the sequence. (Assume n begins with 1.) 1) a n = 3n a 1 = 3*1 = 3 a 2 = 3*2 = 6 a 3 = 3*3 = 9 a 4 = 3*4 = 12 3) a n = 3n 5 Answer: 3,6,9,12 a 1
Fibonacci Numbers and Greatest Common Divisors. The Finonacci numbers are the numbers in the sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,...
Fibonacci Numbers and Greatest Common Divisors The Finonacci numbers are the numbers in the sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,.... After starting with two 1s, we get each Fibonacci number
Programming Assignment II Due Date: See online CISC 672 schedule Individual Assignment
Programming Assignment II Due Date: See online CISC 672 schedule Individual Assignment 1 Overview Programming assignments II V will direct you to design and build a compiler for Cool. Each assignment will
the points are called control points approximating curve
Chapter 4 Spline Curves A spline curve is a mathematical representation for which it is easy to build an interface that will allow a user to design and control the shape of complex curves and surfaces.
Semester Review. CSC 301, Fall 2015
Semester Review CSC 301, Fall 2015 Programming Language Classes There are many different programming language classes, but four classes or paradigms stand out:! Imperative Languages! assignment and iteration!
Yacc: Yet Another Compiler-Compiler
Stephen C. Johnson ABSTRACT Computer program input generally has some structure in fact, every computer program that does input can be thought of as defining an input language which it accepts. An input
Exam 3 Review. FV = PV (1 + i) n. Format. What to Bring/Remember. Time Value of Money. Solving for Other Variables Example. Solving for Other Values
Format Exam 3 Review http://fates.cns.muskingum.edu/~ plaube/acct301/default.htm 15 questions Multiple choice (12) Essay (2) Problem (1) What to Bring/Remember What to bring Calculator I ll bring scrap
Scanning and parsing. Topics. Announcements Pick a partner by Monday Makeup lecture will be on Monday August 29th at 3pm
Scanning and Parsing Announcements Pick a partner by Monday Makeup lecture will be on Monday August 29th at 3pm Today Outline of planned topics for course Overall structure of a compiler Lexical analysis
Course Manual Automata & Complexity 2015
Course Manual Automata & Complexity 2015 Course code: Course homepage: Coordinator: Teachers lectures: Teacher exercise classes: Credits: X_401049 http://www.cs.vu.nl/~tcs/ac prof. dr. W.J. Fokkink home:
The Time Value of Money
CHAPTER 7 The Time Value of Money After studying this chapter, you should be able to: 1. Explain the concept of the time value of money. 2. Calculate the present value and future value of a stream of cash
Automata and Formal Languages
Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,
Regular Expressions and Automata using Haskell
Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions
Algorithms and Data Structures
Algorithms and Data Structures Part 2: Data Structures PD Dr. rer. nat. habil. Ralf-Peter Mundani Computation in Engineering (CiE) Summer Term 2016 Overview general linked lists stacks queues trees 2 2
Sequentially Indexed Grammars
Sequentially Indexed Grammars Jan van Eijck CWI and ILLC, Amsterdam, Uil-OTS, Utrecht To appear in the Journal of Logic and Computation Abstract This paper defines the grammar class of sequentially indexed
13 MATH FACTS 101. 2 a = 1. 7. The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.
3 MATH FACTS 0 3 MATH FACTS 3. Vectors 3.. Definition We use the overhead arrow to denote a column vector, i.e., a linear segment with a direction. For example, in three-space, we write a vector in terms
3.2 Matrix Multiplication
3.2 Matrix Multiplication Question : How do you multiply two matrices? Question 2: How do you interpret the entries in a product of two matrices? When you add or subtract two matrices, you add or subtract
Chapter 7: Functional Programming Languages
Chapter 7: Functional Programming Languages Aarne Ranta Slides for the book Implementing Programming Languages. An Introduction to Compilers and Interpreters, College Publications, 2012. Fun: a language
2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal
2/9/9 Binary number system Computer (electronic) systems prefer binary numbers Binary number: represent a number in base-2 Binary numbers 2 3 + 7 + 5 Some terminology Bit: a binary digit ( or ) Hexadecimal
Models of Sequential Computation
Models of Sequential Computation 13 C H A P T E R Programming is often considered as an art, but it raises mostly practical questions like which language should I choose, which algorithm is adequate, and
Synchronous Binarization for Machine Translation
Synchronous Binarization for Machine Translation Hao Zhang Computer Science Department University of Rochester Rochester, NY 14627 [email protected] Daniel Gildea Computer Science Department University
Microsoft Access Basics
Microsoft Access Basics 2006 ipic Development Group, LLC Authored by James D Ballotti Microsoft, Access, Excel, Word, and Office are registered trademarks of the Microsoft Corporation Version 1 - Revision
Antlr ANother TutoRiaL
Antlr ANother TutoRiaL Karl Stroetmann March 29, 2007 Contents 1 Introduction 1 2 Implementing a Simple Scanner 1 A Parser for Arithmetic Expressions 4 Symbolic Differentiation 6 5 Conclusion 10 1 Introduction
Software quality improvement via pattern matching
Software quality improvement via pattern matching Radu Kopetz and Pierre-Etienne Moreau INRIA & LORIA {Radu.Kopetz, [email protected] Abstract. Nested if-then-else statements is the most common
Intel Assembler. Project administration. Non-standard project. Project administration: Repository
Lecture 14 Project, Assembler and Exam Source code Compiler phases and program representations Frontend Lexical analysis (scanning) Backend Immediate code generation Today Project Emma Söderberg Revised
Row Echelon Form and Reduced Row Echelon Form
These notes closely follow the presentation of the material given in David C Lay s textbook Linear Algebra and its Applications (3rd edition) These notes are intended primarily for in-class presentation
