Prog. techniques. Standard prog. techniques Complex programs can be broken down into simpler parts called “Modules” These come in 2 types,“Procedures”

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

C Language.
Intermediate Code Generation
Chapter 6 Type Checking. The compiler should report an error if an operator is applied to an incompatible operand. Type checking can be performed without.
BNF. What is BNF? BNF stands for “Backus-Naur Form,” after the people who invented it BNF is a metalanguage--a language used to describe another language.
Chapter 3: Modularization
Chapter 2: Modularization
Programming Logic and Design Fourth Edition, Introductory
ALGORITHMS THIRD YEAR BANHA UNIVERSITY FACULTY OF COMPUTERS AND INFORMATIC Lecture two Dr. Hamdy M. Mousa.
 Lex helps to specify lexical analyzers by specifying regular expression  i/p notation for lex tool is lex language and the tool itself is refered to.
Case, Arrays, and Structures. Summary Slide  Case Structure –Select Case - Numeric Value Example 1 –Select Case - String Value Example  Arrays –Declaring.
CS1061 C Programming Lecture 2: A Few Simple Programs A. O’Riordan, 2004.
Program Design and Development
SUNY Morrisville-Norwich Campus-Week 12 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Chapter 9: Subprogram Control
Guide To UNIX Using Linux Third Edition
Problem Solving Chapter 2. What is an algorithm? n A solution to a problem that is: –Precise –Effective –Terminating.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
INTRODUCTION TO COMPUTING CHAPTER NO. 06. Compilers and Language Translation Introduction The Compilation Process Phase 1 – Lexical Analysis Phase 2 –
Higher Grade Computing Studies 2. Languages and Environments Higher Computing Software Development S. McCrossan 1 Classification of Languages 1. Procedural.
Programming Paradigms
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
Names and Scope. Scope Suppose that a name is used many times for different entities in text of the program, or in the course of execution. When the name.
Chapter 06 (Part I) Functions and an Introduction to Recursion.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Chapter 6: User-Defined Functions
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Introduction to Programming with RAPTOR
Visual Basic Programming
Chapter 4 - Visual Basic Schneider1 Chapter 4 General Procedures.
Python Functions.
D Goforth COSC Translating High Level Languages.
I Power Higher Computing Software Development Development Languages and Environments.
D Goforth COSC Translating High Level Languages Note error in assignment 1: #4 - refer to Example grammar 3.4, p. 126.
I Power Higher Computing Software Development High Level Language Constructs.
The Functions and Purposes of Translators Syntax (& Semantic) Analysis.
1 12/4/1435 h Lecture 2 Programs and Programming Languages.
COIT29222 Structured Programming 1 COIT29222-Structured Programming Lecture Week 02  Reading: Textbook(4 th Ed.), Chapter 2 Textbook (6 th Ed.), Chapters.
Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School Unit 2 Software Development Process Topic.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Introduction to OOP CPS235: Introduction.
Introduction to Functions CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Controlling Computers with Programs When you create a computer program you are creating a set of instructions that tell the computer exactly and completely.
Chapter 7: Repetition Structure (Loop) Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills.
1 Sections 3.1 – 3.2a Basic Syntax and Semantics Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Lecture 9 Symbol Table and Attributed Grammars
Test 2 Review Outline.
COMPUTATIONAL CONSTRUCTS
CS 326 Programming Languages, Concepts and Implementation
Programming Languages Translator
Chapter 2- Visual Basic Schneider
Objectives Identify the built-in data types in C++
Revision Lecture
Programming Logic n Techniques
Backus Naur form.
CS 240 – Lecture 5 Scope of Variables, The Stack, Automatic Variables, Global Variables, Constant Type.
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
What would be our focus ? Geometry deals with Declarative or “What is” knowledge. Computer Science deals with Imperative or “How to” knowledge 2/23/2019.
What are the names of the Meta Languages you have used?
Topics Introduction to Functions Defining and Calling a Function
1-6 Midterm Review.
A simple function.
CPS125.
Presentation transcript:

Prog. techniques

Standard prog. techniques Complex programs can be broken down into simpler parts called “Modules” These come in 2 types,“Procedures” and “Functions This allows multiple programmers to work on the same project at the same time This means you can assign more complex modules to higher level programmers

E.G school reports

Parameters variables passed to modules Can be declared when calling the module or declared inside the module itself These are known as “Local” variables Local variables reset once the module is exited Variables that have to be used by multiple modules are called “Global” variables

Calling procedures When a procedure is called, the computer has to save the location of the current module so that it can return once finished This is ok for simple programs when only 1 procedure is called at a time but when multiple procedures need to be called, the computer has to store the locations in order This can be done through the use of a stack (first in, last out)

Defining syntax Languages do not evolve but are invented The language must stick to a set of rules so that the translator can run correctly Each set of rules are language specific “for i = 0 to 5” in VB For(i=0;i<=5;i++){ in AS2

Terminal symbols These are the base characters (e.g. A, B, C, 1, 2, 3, etc) ABC is a combination of letters – can be described as “Letter, letter, letter” A is not a combination as it is a base character

BNF In BNF, you can define combinations using this syntax ::= “Is defined as” | “Or” E.g. ::= This allows words exactly 3 characters large To allow for unlimited characters, you can nest the definition E.G ::= |

Syntax Diagrams This is a more visual method for defining syntax Combinations are shown in flow graph format E.G

Reverse Polish