Annex A (Informative) Collected syntax The nonterminal symbols pointer-type, program, signed-number, simple-type, special-symbol, and structured-type

Size: px
Start display at page:

Download "Annex A (Informative) Collected syntax The nonterminal symbols pointer-type, program, signed-number, simple-type, special-symbol, and structured-type"

Transcription

1 Pascal ISO 7185:1990 This online copy of the unextended Pascal standard is provided only as an aid to standardization. In the case of dierences between this online version and the printed version, the printed version takes precedence. Do not modify this document. Do not include this document in another software product. You may print this document for personal use only. Do not sell this document. Use this information only for good; never for evil. Do not expose to re. Do not operate heavy equipment after reading, may cause drowsiness. Do not read under the inuence of alcohol (although there have been several unconrmed reports that alcohol actually improves the readability). The standard is written in English. If you have trouble understanding a particular section, read it again and again and again... Sit up straight. Eat your vegatables. Do not mumble. ciso/iec 1991

2 Annex A (Informative) Collected syntax The nonterminal symbols pointer-type, program, signed-number, simple-type, special-symbol, and structured-type are only referenced by the semantics and are not used in the right-handside of any production. The nonterminal symbol program is the start symbol of the grammar actual-parameter = expression j variable-access j procedure-identier j function-identier actual-parameter-list = `(' actual-parameter f `,' actual-parameter g `)' adding-operator = `+' j `,' j `or' apostrophe-image = `"' array-type = `array' `[' index-type f `,' index-type g `]' `of' component-type array-variable = variable-access assignment-statement = ( variable-access j function-identier ) `:=' expression base-type = ordinal-type block = label-declaration-part constant-denition-part type-denition-part variable-declaration-part procedure-and-function-declaration-part statement-part Boolean-expression = expression bound-identier = identier buer-variable = le-variable `"' case-constant = constant case-constant-list = case-constant f `,' case-constant g case-index = expression case-list-element = case-constant-list `:' statement case-statement = `case' case-index `of' case-list-element f `;' case-list-element g [ `;' ] `end' character-string = `'' string-element f string-element g `'' component-type = type-denoter component-variable = indexed-variable j eld-designator compound-statement = `begin' statement-sequence `end' conditional-statement = if-statement j case-statement. 65

3 conformant-array-parameter-specication = value-conformant-array-specication j variable-conformant-array-specication conformant-array-schema = packed-conformant-array-schema j unpacked-conformant-array-schema. 6.3 constant = [ sign ]( unsigned-number j constant-identier ) j character-string. 6.3 constant-denition = identier `=' constant constant-denition-part = [ `const' constant-denition `;' f constant-denition `;' g ]. 6.3 constant-identier = identier control-variable = entire-variable digit = `0' j `1' j `2' j `3' j `4' j `5' j `6' j `7' j `8' j `9' digit-sequence = digit f digit g directive = letter f letter j digit g domain-type = type-identier else-part = `else' statement empty-statement = entire-variable = variable-identier enumerated-type = `(' identier-list `)' expression = simple-expression [ relational-operator simple-expression ] factor > bound-identier factor > variable-access j unsigned-constant j function-designator j set-constructor j `(' expression `)' j `not' factor eld-designator = record-variable `.' eld-specier j eld-designator-identier eld-designator-identier = identier eld-identier = identier eld-list = [ ( xed-part [ `;' variant-part ] j variant-part )[ `;' ] ] eld-specier = eld-identier le-type = `le' `of' component-type le-variable = variable-access nal-value = expression xed-part = record-section f `;' record-section g. 66

4 for-statement = `for' control-variable `:=' initial-value ( `to' j `downto' ) nal-value `do' statement formal-parameter-list = `(' formal-parameter-section f `;' formal-parameter-section g `)' formal-parameter-section > value-parameter-specication j variable-parameter-specication j procedural-parameter-specication j functional-parameter-specication formal-parameter-section > conformant-array-parameter-specication fractional-part = digit-sequence function-block = block function-declaration = function-heading `;' directive j function-identication `;' function-block j function-heading `;' function-block function-designator = function-identier [ actual-parameter-list ] function-heading = `function' identier [ formal-parameter-list ] `:' result-type function-identication = `function' function-identier function-identier = identier functional-parameter-specication = function-heading goto-statement = `goto' label identied-variable = pointer-variable `"' identier = letter f letter j digit g identier-list = identier f `,' identier g if-statement = `if' Boolean-expression `then' statement [ else-part ] index-expression = expression index-type = ordinal-type index-type-specication = identier `..' identier `:' ordinal-type-identier indexed-variable = array-variable `[' index-expression, f `,' index-expression g `]' initial-value = expression label = digit-sequence label-declaration-part = [ `label' label f `,' label g `;' ] letter = `a' j `b' j `c' j `d' j `e' j `f' j `g' j `h' j `i' j `j' j `k' j `l' j `m' j `n' j `o' j `p' j `q' j `r' j `s' j `t' j `u' j `v' j `w' j `x' j `y' j `z'. 67

5 6.7.1 member-designator = expression [ `..' expression ] multiplying-operator = `*' j `/' j `div' j `mod' j `and' new-ordinal-type = enumerated-type j subrange-type new-pointer-type = `"' domain-type new-structured-type = [ `packed' ] unpacked-structured-type new-type = new-ordinal-type j new-structured-type j new-pointer-type ordinal-type = new-ordinal-type j ordinal-type-identier ordinal-type-identier = type-identier packed-conformant-array-schema = `packed' `array' `[' index-type-specication `]' `of' type-identier pointer-type = new-pointer-type j pointer-type-identier pointer-type-identier = type-identier pointer-variable = variable-access procedural-parameter-specication = procedure-heading procedure-and-function-declaration-part = f ( procedure-declaration j function-declaration )`;' g procedure-block = block procedure-declaration = procedure-heading `;' directive j procedure-identication `;' procedure-block j procedure-heading `;' procedure-block procedure-heading = `procedure' identier [ formal-parameter-list ] procedure-identication = `procedure' procedure-identier procedure-identier = identier procedure-statement = procedure-identier ( [ actual-parameter-list ] j read-parameter-list j readln-parameter-list j write-parameter-list j writeln-parameter-list ) program = program-heading `;' program-block `.' program-block = block program-heading = `program' identier [ `(' program-parameter-list `)' ] program-parameter-list = identier-list read-parameter-list = `(' [ le-variable `,' ]variable-access f `,' variable-access g `)'. 68

6 6.9.2 readln-parameter-list = [ `(' ( le-variable j variable-access ) f `,' variable-access g `)' ] real-type-identier = type-identier record-section = identier-list `:' type-denoter record-type = `record' eld-list `end' record-variable = variable-access record-variable-list = record-variable f `,' record-variable g relational-operator = `=' j `<>' j `<' j `>' j `<=' j `>=' j `in' repeat-statement = `repeat' statement-sequence `until' Boolean-expression repetitive-statement = repeat-statement j while-statement j for-statement result-type = simple-type-identier j pointer-type-identier scale-factor = [ sign ] digit-sequence set-constructor = `[' [ member-designator f `,' member-designator g ] `]' set-type = `set' `of' base-type sign = `+' j `,' signed-integer = [ sign ] unsigned-integer signed-number = signed-integer j signed-real signed-real = [ sign ] unsigned-real simple-expression = [ sign ] term f adding-operator term g simple-statement = empty-statement j assignment-statement j procedure-statement j goto-statement simple-type = ordinal-type j real-type-identier simple-type-identier = type-identier special-symbol = `+' j `,' j `*' j `/' j `=' j `<' j `>' j `[' j `]' j `.' j `,' j `:' j `;' j `"' j `(' j `)' j `<>' j `<=' j `>=' j `:=' j `..' j word-symbol statement = [ label `:' ] ( simple-statement j structured-statement ) statement-part = compound-statement statement-sequence = statement f `;' statement g string-character = one-of-a-set-of-implementation-dened-characters string-element = apostrophe-image j string-character. 69

7 structured-statement = compound-statement j conditional-statement j repetitive-statement j with-statement structured-type = new-structured-type j structured-type-identier structured-type-identier = type-identier subrange-type = constant `..' constant tag-eld = identier tag-type = ordinal-type-identier term = factor f multiplying-operator factor g type-denition = identier `=' type-denoter type-denition-part = [ `type' type-denition `;' f type-denition `;' g ] type-denoter = type-identier j new-type type-identier = identier unpacked-conformant-array-schema = `array' `[' index-type-specication f `;' index-type-specication g `]' `of' ( type-identier j conformant-array-schema ) unpacked-structured-type = array-type j record-type j set-type j le-type unsigned-constant = unsigned-number j character-string j constant-identier j `nil' unsigned-integer = digit-sequence unsigned-number = unsigned-integer j unsigned-real unsigned-real = digit-sequence `.' fractional-part [ `e' scale-factor ] j digit-sequence `e' scale-factor value-conformant-array-specication = identier-list `:' conformant-array-schema value-parameter-specication = identier-list `:' type-identier variable-access = entire-variable j component-variable j identied-variable j buer-variable variable-conformant-array-specication = `var' identier-list `:' conformant-array-schema variable-declaration = identier-list `:' type-denoter variable-declaration-part = [ `var' variable-declaration `;' f variable-declaration `;' g ] variable-identier = identier variable-parameter-specication = `var' identier-list `:' type-identier variant = case-constant-list `:' `(' eld-list `)'. 70

8 variant-part = `case' variant-selector `of' variant f `;' variant g variant-selector = [ tag-eld `:' ] tag-type while-statement = `while' Boolean-expression `do' statement with-statement = `with' record-variable-list `do' statement word-symbol = `and' j `array' j `begin' j `case' j `const' j `div' j `do' j `downto' j `else' j `end' j `le' j `for' j `function' j `goto' j `if' j `in' j `label' j `mod' j `nil' j `not' j `of' j `or' j `packed' j `procedure' j `program' j `record' j `repeat' j `set' j `then' j `to' j `type' j `until' j `var' j `while' j `with' write-parameter = expression [ `:' expression [ `:' expression ] ] write-parameter-list = `(' [ le-variable `,' ] write-parameter f `,' write-parameter g `)' writeln-parameter-list = [ `(' ( le-variable j write-parameter ) f `,' write-parameter g `)' ]. 71

Compiladores Prof. Bruno Lopes Lista 1

Compiladores Prof. Bruno Lopes Lista 1 1. Coteje as etapas do processo de compilação. 2. Seja a seguinte BNF da linguagem Pascal. Compiladores 2016.2 Prof. Bruno Lopes Lista 1 program ::= program identifier ; uses declaration ; block. uses

More information

The S-Expression Design Language (SEDL) James C. Corbett. September 1, Introduction. 2 Origins of SEDL 2. 3 The Language SEDL 2.

The S-Expression Design Language (SEDL) James C. Corbett. September 1, Introduction. 2 Origins of SEDL 2. 3 The Language SEDL 2. The S-Expression Design Language (SEDL) James C. Corbett September 1, 1993 Contents 1 Introduction 1 2 Origins of SEDL 2 3 The Language SEDL 2 3.1 Scopes : : : : : : : : : : : : : : : : : : : : : : : :

More information

520 Principles of Programming Languages. Arithmetic. Variable Declarations. 19: Pascal

520 Principles of Programming Languages. Arithmetic. Variable Declarations. 19: Pascal Structure of a Pascal Program 520 Principles of Programming Languages 19: Pascal Christian Collberg collberg@cs.arizona.edu Department of Computer Science University of Arizona PROGRAM Name (list of files);

More information

The Compositional C++ Language. Denition. Abstract. This document gives a concise denition of the syntax and semantics

The Compositional C++ Language. Denition. Abstract. This document gives a concise denition of the syntax and semantics The Compositional C++ Language Denition Peter Carlin Mani Chandy Carl Kesselman March 12, 1993 Revision 0.95 3/12/93, Comments welcome. Abstract This document gives a concise denition of the syntax and

More information

More Assigned Reading and Exercises on Syntax (for Exam 2)

More Assigned Reading and Exercises on Syntax (for Exam 2) More Assigned Reading and Exercises on Syntax (for Exam 2) 1. Read sections 2.3 (Lexical Syntax) and 2.4 (Context-Free Grammars) on pp. 33 41 of Sethi. 2. Read section 2.6 (Variants of Grammars) on pp.

More information

Quick Reference Guide

Quick Reference Guide SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD mikroelektronika Development tools - Books - Compilers Quick Reference Quick Reference Guide with EXAMPLES for Pascal language This reference guide

More information

History. used in early Mac development notable systems in Pascal Skype TeX embedded systems

History. used in early Mac development notable systems in Pascal Skype TeX embedded systems Overview The Pascal Programming Language (with material from tutorialspoint.com) Background & History Features Hello, world! General Syntax Variables/Data Types Operators Conditional Statements Functions

More information

Pascal Validation Suite Report

Pascal Validation Suite Report Pascal Validation Suite Report Pascal processor identification The ACK-Pascal compiler produces code for an EM machine as defined in [1]. It is up to the implementor of the EM machine whether errors like

More information

Compiler Techniques MN1 The nano-c Language

Compiler Techniques MN1 The nano-c Language Compiler Techniques MN1 The nano-c Language February 8, 2005 1 Overview nano-c is a small subset of C, corresponding to a typical imperative, procedural language. The following sections describe in more

More information

Beginning Programming (Pascal) Lecture 75. Figure 1. type-declarations. simple-type. pointer-type. array-type. file-type. set-type.

Beginning Programming (Pascal) Lecture 75. Figure 1. type-declarations. simple-type. pointer-type. array-type. file-type. set-type. -declarations -identifier = ; ; Figure 1. -declarations simple- pointer- array- file- set- record- Figure 2. simple- standard- subrange- enumerated- Figure 3. simple- standard- boolean char integer real

More information

Getting Started With Pascal Programming

Getting Started With Pascal Programming Getting Started With Pascal Programming How are computer programs created What is the basic structure of a Pascal Program Variables and constants Input and output Common programming errors Computer Programs

More information

In Delphi script, when values are assigned to variables, the colon-equal operator is used; :=

In Delphi script, when values are assigned to variables, the colon-equal operator is used; := Statements and Operators Old Content - visit altium.com/documentation Modified by on 13-Sep-2017 Parent page: DelphiScript DelphiScript Statements A statement in DelphiScript is considered as simple when

More information

Chapter 7. - FORTRAN I control statements were based directly on IBM 704 hardware

Chapter 7. - FORTRAN I control statements were based directly on IBM 704 hardware Levels of Control Flow: 1. Within expressions 2. Among program units 3. Among program statements Evolution: - FORTRAN I control statements were based directly on IBM 704 hardware - Much research and argument

More information

Control Structures. Outline. In Text: Chapter 8. Control structures Selection. Iteration. Gotos Guarded statements. One-way Two-way Multi-way

Control Structures. Outline. In Text: Chapter 8. Control structures Selection. Iteration. Gotos Guarded statements. One-way Two-way Multi-way Control Structures In Text: Chapter 8 1 Control structures Selection One-way Two-way Multi-way Iteration Counter-controlled Logically-controlled Gotos Guarded statements Outline Chapter 8: Control Structures

More information

Programming Language Concepts, cs2104 Lecture 04 ( )

Programming Language Concepts, cs2104 Lecture 04 ( ) Programming Language Concepts, cs2104 Lecture 04 (2003-08-29) Seif Haridi Department of Computer Science, NUS haridi@comp.nus.edu.sg 2003-09-05 S. Haridi, CS2104, L04 (slides: C. Schulte, S. Haridi) 1

More information

2. λ is a regular expression and denotes the set {λ} 4. If r and s are regular expressions denoting the languages R and S, respectively

2. λ is a regular expression and denotes the set {λ} 4. If r and s are regular expressions denoting the languages R and S, respectively Regular expressions: a regular expression is built up out of simpler regular expressions using a set of defining rules. Regular expressions allows us to define tokens of programming languages such as identifiers.

More information

Outline. 1 About the course

Outline. 1 About the course Outline EDAF50 C++ Programming 1. Introduction 1 About the course Sven Gestegård Robertz Computer Science, LTH 2018 2 Presentation of C++ History Introduction Data types and variables 1. Introduction 2/1

More information

ii

ii Pascal ISO 7185:1990 This online copy of the unextended Pascal standard is provided only as an aid to standardization. In the case of dierences between this online version and the printed version, the

More information

Advanced Systems Programming

Advanced Systems Programming Advanced Systems Programming Introduction to C++ Martin Küttler September 19, 2017 1 / 18 About this presentation This presentation is not about learning programming or every C++ feature. It is a short

More information

Pascal/MT+ TM Language Reference Manual

Pascal/MT+ TM Language Reference Manual Pascal/MT+ TM Language Reference Manual Copyright 1983 Digital Research P.O. Box 579 801 Lighthouse Avenue Pacific Grove, CA 93950 (408) 649-3896 TWX 910 360 5001 All Rights Reserved COPYRIGHT Copyright

More information

The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University September 27, 1995 (revised October 15, 2002) 1 Introduction The PCAT language

More information

Algorithmic "imperative" language

Algorithmic imperative language Algorithmic "imperative" language Undergraduate years Epita November 2014 The aim of this document is to introduce breiy the "imperative algorithmic" language used in the courses and tutorials during the

More information

CSCI 3155: Principles of Programming Languages Exam preparation #1 2007

CSCI 3155: Principles of Programming Languages Exam preparation #1 2007 CSCI 3155: Principles of Programming Languages Exam preparation #1 2007 Exercise 1. Consider the if-then-else construct of Pascal, as in the following example: IF 1 = 2 THEN PRINT X ELSE PRINT Y (a) Assume

More information

Chapter 8 Statement-Level Control Structure

Chapter 8 Statement-Level Control Structure Chapter 8 Statement-Level Control Structure To make programs more flexible and powerful: Some means of selecting among alternative control flow paths. Selection statement (conditional statements) Unconditional

More information

CtoP. Knowledge Software Ltd Farnborough, Hants, England

CtoP. Knowledge Software Ltd Farnborough, Hants, England CtoP Knowledge Software Ltd Farnborough, Hants, England Support Knowledge Software Ltd provides telephone and mail support for those users who have purchased their systems from Knowledge Software Ltd.

More information

Ch. 7: Control Structures

Ch. 7: Control Structures Ch. 7: Control Structures I. Introduction A. Flow of control can be at multiple levels: within expressions, among statements (discussed here), and among units. B. Computation in imperative languages uses

More information

CA4003 Compiler Construction Assignment Language Definition

CA4003 Compiler Construction Assignment Language Definition CA4003 Compiler Construction Assignment Language Definition David Sinclair 2017-2018 1 Overview The language is not case sensitive. A nonterminal, X, is represented by enclosing it in angle brackets, e.g.

More information

CSCE 531, Spring 2015 Final Exam Answer Key

CSCE 531, Spring 2015 Final Exam Answer Key CSCE 531, Spring 2015 Final Exam Answer Key 1. (40 points total) Consider the following grammar with start symbol S : S S S asb S T T T a T cs T ɛ (a) (10 points) Find FIRST(S), FIRST(T ), FOLLOW(S), and

More information

FreePascal changes: user documentation

FreePascal changes: user documentation FreePascal changes: user documentation Table of Contents Jochem Berndsen February 2007 1Introduction...1 2Accepted syntax...2 Declarations...2 Statements...3 Class invariants...3 3Semantics...3 Definitions,

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings of Programs:

More information

2 3. Syllabus Time Event 9:00{10:00 morning lecture 10:00{10:30 morning break 10:30{12:30 morning practical session 12:30{1:30 lunch break 1:30{2:00 a

2 3. Syllabus Time Event 9:00{10:00 morning lecture 10:00{10:30 morning break 10:30{12:30 morning practical session 12:30{1:30 lunch break 1:30{2:00 a 1 Syllabus for the Advanced 3 Day Fortran 90 Course AC Marshall cuniversity of Liverpool, 1997 Abstract The course is scheduled for 3 days. The timetable allows for two sessions a day each with a one hour

More information

c 1991 Numerik Software GmbH, Baden-Baden Printed in Germany All rights reserved. No part of this book may be translated or reproduced in any form wit

c 1991 Numerik Software GmbH, Baden-Baden Printed in Germany All rights reserved. No part of this book may be translated or reproduced in any form wit U. Allendorfer D. Cordes PASCAL{XSC User's Guide Numerik Software GmbH Baden-Baden, Germany c 1991 Numerik Software GmbH, Baden-Baden Printed in Germany All rights reserved. No part of this book may be

More information

Getting Started With Pascal Programming

Getting Started With Pascal Programming Getting Started With Pascal Programming How are computer programs created What is the basic structure of a Pascal Program Variables and constants Input and output Pascal operators Common programming errors

More information

Principles of Programming Languages COMP251: Syntax and Grammars

Principles of Programming Languages COMP251: Syntax and Grammars Principles of Programming Languages COMP251: Syntax and Grammars Prof. Dekai Wu Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong, China Fall 2006

More information

Arrays CSCE 110. From James Tam s material J. Michael Moore

Arrays CSCE 110. From James Tam s material J. Michael Moore Arrays CSCE 110 From James Tam s material Typical (although simplified) Problem Write a program that will track student grades in a class. The grades are saved as percentages. The program should allow

More information

Quick Reference Guide

Quick Reference Guide SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD mikroelektronika Development tools - Books - Compilers Quick Reference Quick Reference Guide with EXAMPLES for Basic language This reference guide

More information

Programming Languages, Summary CSC419; Odelia Schwartz

Programming Languages, Summary CSC419; Odelia Schwartz Programming Languages, Summary CSC419; Odelia Schwartz Chapter 1 Topics Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation Criteria Influences on Language Design

More information

Tuple Abstract Data Type

Tuple Abstract Data Type 1 Tuple Abstract Data Type Table of Contents Introduction... 1 The tuple object... 2 The tuple fields... 3 Operations on tuples... 4 Enquiry operations... 4.1 Read operations... 4.2 Write operations...

More information

Defining Languages GMU

Defining Languages GMU Defining Languages CS463 @ GMU How do we discuss languages? We might focus on these qualities: readability: how well does a language explicitly and clearly describe its purpose? writability: how expressive

More information

CMa simple C Abstract Machine

CMa simple C Abstract Machine CMa simple C Abstract Machine CMa architecture An abstract machine has set of instructions which can be executed in an abstract hardware. The abstract hardware may be seen as a collection of certain data

More information

Principles of Programming Languages COMP251: Syntax and Grammars

Principles of Programming Languages COMP251: Syntax and Grammars Principles of Programming Languages COMP251: Syntax and Grammars Prof. Dekai Wu Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong, China Fall 2007

More information

Type Checking. Outline. General properties of type systems. Types in programming languages. Notation for type rules.

Type Checking. Outline. General properties of type systems. Types in programming languages. Notation for type rules. Outline Type Checking General properties of type systems Types in programming languages Notation for type rules Logical rules of inference Common type rules 2 Static Checking Refers to the compile-time

More information

DelphiScript Keywords

DelphiScript Keywords DelphiScript Keywords Old Content - visit altium.com/documentation Modified by on 13-Sep-2017 This reference covers the DelphiScript keywords used for the Scripting System in Altium Designer. The scripting

More information

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008.

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008. Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008. Outline. Abstractions for telling a computer how to do things. Computational Paradigms. Language Definition, Translation.

More information

Outline. General properties of type systems. Types in programming languages. Notation for type rules. Common type rules. Logical rules of inference

Outline. General properties of type systems. Types in programming languages. Notation for type rules. Common type rules. Logical rules of inference Type Checking Outline General properties of type systems Types in programming languages Notation for type rules Logical rules of inference Common type rules 2 Static Checking Refers to the compile-time

More information

The New C Standard (Excerpted material)

The New C Standard (Excerpted material) The New C Standard (Excerpted material) An Economic and Cultural Derek M. Jones derek@knosof.co.uk Copyright 2002-2008 Derek M. Jones. All rights reserved. 1378 type specifier type-specifier: void char

More information

Data Types. Outline. In Text: Chapter 6. What is a type? Primitives Strings Ordinals Arrays Records Sets Pointers 5-1. Chapter 6: Data Types 2

Data Types. Outline. In Text: Chapter 6. What is a type? Primitives Strings Ordinals Arrays Records Sets Pointers 5-1. Chapter 6: Data Types 2 Data Types In Text: Chapter 6 1 Outline What is a type? Primitives Strings Ordinals Arrays Records Sets Pointers Chapter 6: Data Types 2 5-1 Data Types Two components: Set of objects in the type (domain

More information

Haskell 98 in short! CPSC 449 Principles of Programming Languages

Haskell 98 in short! CPSC 449 Principles of Programming Languages Haskell 98 in short! n Syntax and type inferencing similar to ML! n Strongly typed! n Allows for pattern matching in definitions! n Uses lazy evaluation" F definition of infinite lists possible! n Has

More information

Topic IV. Block-structured procedural languages Algol and Pascal. References:

Topic IV. Block-structured procedural languages Algol and Pascal. References: References: Topic IV Block-structured procedural languages Algol and Pascal Chapters 5 and 7, of Concepts in programming languages by J. C. Mitchell. CUP, 2003. Chapters 10( 2) and 11( 1) of Programming

More information

Learning to program is a lot like learning to speak a new language. You must learn new vocabulary,

Learning to program is a lot like learning to speak a new language. You must learn new vocabulary, Chapter 2 Basic Concepts Learning to program is a lot like learning to speak a new language. You must learn new vocabulary, i.e. the words of the language the syntax, (also called the grammar) i.e. the

More information

SE352b: Roadmap. SE352b Software Engineering Design Tools. W3: Programming Paradigms

SE352b: Roadmap. SE352b Software Engineering Design Tools. W3: Programming Paradigms SE352b Software Engineering Design Tools W3: Programming Paradigms Feb. 3, 2005 SE352b, ECE,UWO, Hamada Ghenniwa SE352b: Roadmap CASE Tools: Introduction System Programming Tools Programming Paradigms

More information

COS 140: Foundations of Computer Science

COS 140: Foundations of Computer Science COS 140: Foundations of Computer Science Variables and Primitive Data Types Fall 2017 Introduction 3 What is a variable?......................................................... 3 Variable attributes..........................................................

More information

Professor Peter Cheung EEE, Imperial College

Professor Peter Cheung EEE, Imperial College 1/1 1/2 Professor Peter Cheung EEE, Imperial College In this lecture, we take an overview of the course, and briefly review the programming language. The rough guide is not very complete. You should use

More information

VHDL Lexical Elements

VHDL Lexical Elements 1 Design File = Sequence of Lexical Elements && Separators (a) Separators: Any # of Separators Allowed Between Lexical Elements 1. Space character 2. Tab 3. Line Feed / Carriage Return (EOL) (b) Lexical

More information

CSE 12 Abstract Syntax Trees

CSE 12 Abstract Syntax Trees CSE 12 Abstract Syntax Trees Compilers and Interpreters Parse Trees and Abstract Syntax Trees (AST's) Creating and Evaluating AST's The Table ADT and Symbol Tables 16 Using Algorithms and Data Structures

More information

G Programming Languages Spring 2010 Lecture 6. Robert Grimm, New York University

G Programming Languages Spring 2010 Lecture 6. Robert Grimm, New York University G22.2110-001 Programming Languages Spring 2010 Lecture 6 Robert Grimm, New York University 1 Review Last week Function Languages Lambda Calculus SCHEME review 2 Outline Promises, promises, promises Types,

More information

Topic IV. Parameters. Chapter 5 of Programming languages: Concepts & constructs by R. Sethi (2ND EDITION). Addison-Wesley, 1996.

Topic IV. Parameters. Chapter 5 of Programming languages: Concepts & constructs by R. Sethi (2ND EDITION). Addison-Wesley, 1996. References: Topic IV Block-structured procedural languages Algol and Pascal Chapters 5 and 7, of Concepts in programming languages by J. C. Mitchell. CUP, 2003. Chapter 5 of Programming languages: Concepts

More information

Workstations and Servers

Workstations and Servers HP 9000 Computer Systems HP C/HP-UX Reference Manual Workstations and Servers ABCDE HP Part No. 92453-90085 Printed in U.S.A. May 1997 E0597 The information contained in this document is subject to change

More information

What is VectorScript?

What is VectorScript? What is VectorScript? VectorScript is the scripting language component of the VectorWorks software package. It is a lightweight programming language which syntactically resembles Pascal. VectorScript is

More information

BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

More information

PCO ASPs IUT. Tester. ASPs PCO. PDUs. Test System TCP. ASPs PCO. PDUs IUT. Service Provider. Lower Tester Control Function TCP

PCO ASPs IUT. Tester. ASPs PCO. PDUs. Test System TCP. ASPs PCO. PDUs IUT. Service Provider. Lower Tester Control Function TCP Accepted for Computer Networks & ISDN Systems: Special Issue on Protocol Testing TTCN: Towards a Formal Semantics and Validation of Test Suites Finn Kristoersen Thomas Walter y Abstract TTCN (Tree and

More information

1 Programming. 1.1 Analyzing a problem

1 Programming. 1.1 Analyzing a problem 1 Programming The chapter concerns the following; ² How to analyze a problem and develop an algorithm ² Control structures and their use ² ² Finding alternate solutions to a problem ² Programming in Pascal

More information

Specifying Syntax. An English Grammar. Components of a Grammar. Language Specification. Types of Grammars. 1. Terminal symbols or terminals, Σ

Specifying Syntax. An English Grammar. Components of a Grammar. Language Specification. Types of Grammars. 1. Terminal symbols or terminals, Σ Specifying Syntax Language Specification Components of a Grammar 1. Terminal symbols or terminals, Σ Syntax Form of phrases Physical arrangement of symbols 2. Nonterminal symbols or syntactic categories,

More information

Chapter 2.5 Writing maintainable programs

Chapter 2.5 Writing maintainable programs Chapter 2.5 Writing maintainable programs Good program writing techniques Maintenance is the updating of a program after it has been released. Maintenance will be helped when the programmer uses good programming

More information

Getting Started With Pascal Programming

Getting Started With Pascal Programming Getting Started With Pascal Programming How are computer programs created What is the basic structure of a Pascal Program Variables and constants Input and output Pascal operators Common programming errors

More information

A simple syntax-directed

A simple syntax-directed Syntax-directed is a grammaroriented compiling technique Programming languages: Syntax: what its programs look like? Semantic: what its programs mean? 1 A simple syntax-directed Lexical Syntax Character

More information

Flow of Control Execution Sequence

Flow of Control Execution Sequence Flow of Control Execution Sequence Sequence sequence Decision tree Repetition graph Language Constructs sequence statements (incl Foc) simple / compound decision (1 /2 / n way) if then [else] case / switch

More information

Typescript on LLVM Language Reference Manual

Typescript on LLVM Language Reference Manual Typescript on LLVM Language Reference Manual Ratheet Pandya UNI: rp2707 COMS 4115 H01 (CVN) 1. Introduction 2. Lexical Conventions 2.1 Tokens 2.2 Comments 2.3 Identifiers 2.4 Reserved Keywords 2.5 String

More information

Generating Continuation Passing Style Code for the Co-op Language

Generating Continuation Passing Style Code for the Co-op Language Generating Continuation Passing Style Code for the Co-op Language Mark Laarakkers University of Twente Faculty: Computer Science Chair: Software engineering Graduation committee: dr.ing. C.M. Bockisch

More information

On Academic Dishonesty. Declarative Computation Model. Single assignment store. Single assignment store (2) Single assignment store (3)

On Academic Dishonesty. Declarative Computation Model. Single assignment store. Single assignment store (2) Single assignment store (3) Declarative Computation Model Single assignment store (VRH 2.2) Kernel language syntax (VRH 2.3) Carlos Varela RPI October 6, 2009 Adapted with permission from: Seif Haridi KTH Peter Van Roy UCL On Academic

More information

HP Pascal/iX Reference Manual

HP Pascal/iX Reference Manual HP Pascal/iX Reference Manual HP 3000 MPE/iX Computer Systems Edition 5 Manufacturing Part Number: 31502-90022 E0692 USA June 1992 Notice The information contained in this document is subject to change

More information

The Compiler So Far. CSC 4181 Compiler Construction. Semantic Analysis. Beyond Syntax. Goals of a Semantic Analyzer.

The Compiler So Far. CSC 4181 Compiler Construction. Semantic Analysis. Beyond Syntax. Goals of a Semantic Analyzer. The Compiler So Far CSC 4181 Compiler Construction Scanner - Lexical analysis Detects inputs with illegal tokens e.g.: main 5 (); Parser - Syntactic analysis Detects inputs with ill-formed parse trees

More information

COP4020 Spring 2011 Midterm Exam

COP4020 Spring 2011 Midterm Exam COP4020 Spring 2011 Midterm Exam Name: (Please print Put the answers on these sheets. Use additional sheets when necessary or write on the back. Show how you derived your answer (this is required for full

More information

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and #include The Use of printf() and scanf() The Use of printf()

More information

Introduction Primitive Data Types Character String Types User-Defined Ordinal Types Array Types. Record Types. Pointer and Reference Types

Introduction Primitive Data Types Character String Types User-Defined Ordinal Types Array Types. Record Types. Pointer and Reference Types Chapter 6 Topics WEEK E FOUR Data Types Introduction Primitive Data Types Character String Types User-Defined Ordinal Types Array Types Associative Arrays Record Types Union Types Pointer and Reference

More information

CMPS Programming Languages. Dr. Chengwei Lei CEECS California State University, Bakersfield

CMPS Programming Languages. Dr. Chengwei Lei CEECS California State University, Bakersfield CMPS 3500 Programming Languages Dr. Chengwei Lei CEECS California State University, Bakersfield Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing

More information

LECTURE 18. Control Flow

LECTURE 18. Control Flow LECTURE 18 Control Flow CONTROL FLOW Sequencing: the execution of statements and evaluation of expressions is usually in the order in which they appear in a program text. Selection (or alternation): a

More information

Test 1 Summer 2014 Multiple Choice. Write your answer to the LEFT of each problem. 5 points each 1. Preprocessor macros are associated with: A. C B.

Test 1 Summer 2014 Multiple Choice. Write your answer to the LEFT of each problem. 5 points each 1. Preprocessor macros are associated with: A. C B. CSE 3302 Test 1 1. Preprocessor macros are associated with: A. C B. Java C. JavaScript D. Pascal 2. (define x (lambda (y z) (+ y z))) is an example of: A. Applying an anonymous function B. Defining a function

More information

CS109A ML Notes for the Week of 1/16/96. Using ML. ML can be used as an interactive language. We. shall use a version running under UNIX, called

CS109A ML Notes for the Week of 1/16/96. Using ML. ML can be used as an interactive language. We. shall use a version running under UNIX, called CS109A ML Notes for the Week of 1/16/96 Using ML ML can be used as an interactive language. We shall use a version running under UNIX, called SML/NJ or \Standard ML of New Jersey." You can get SML/NJ by

More information

Working with Lists 4

Working with Lists 4 CS 61A Lecture 10 Announcements Lists ['Demo'] Working with Lists 4 Working with Lists >>> digits = [1, 8, 2, 8] 4 Working with Lists >>> digits = [1, 8, 2, 8] >>> digits = [2//2, 2+2+2+2, 2, 2*2*2] 4

More information

Chapter 8. Statement-Level Control Structures

Chapter 8. Statement-Level Control Structures Chapter 8 Statement-Level Control Structures Chapter 8 Topics Introduction Selection Statements Iterative Statements Unconditional Branching Guarded Commands Conclusions Copyright 2009 Addison-Wesley.

More information

Chapter 3. Describing Syntax and Semantics ISBN

Chapter 3. Describing Syntax and Semantics ISBN Chapter 3 Describing Syntax and Semantics ISBN 0-321-49362-1 Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the

More information

GOZO COLLEGE. Boys Secondary Victoria - Gozo, Malta Ninu Cremona. Half Yearly Examination

GOZO COLLEGE. Boys Secondary Victoria - Gozo, Malta Ninu Cremona. Half Yearly Examination GOZO COLLEGE Boys Secondary Victoria - Gozo, Malta Ninu Cremona Half Yearly Examination 2010 2011 Subject: Form: Time: COMPUTER STUDIES 4 Junior Lyceum 1 hr 30 min NAME: CLASS: INDEX NO: Instructions to

More information

A Short Summary of Javali

A Short Summary of Javali A Short Summary of Javali October 15, 2015 1 Introduction Javali is a simple language based on ideas found in languages like C++ or Java. Its purpose is to serve as the source language for a simple compiler

More information

COS 140: Foundations of Computer Science

COS 140: Foundations of Computer Science COS 140: Foundations of Variables and Primitive Data Types Fall 2017 Copyright c 2002 2017 UMaine School of Computing and Information S 1 / 29 Homework Reading: Chapter 16 Homework: Exercises at end of

More information

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary GATE- 2016-17 Postal Correspondence 1 C-Programming Computer Science & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key concepts, Analysis

More information

SMPL - A Simplified Modeling Language for Mathematical Programming

SMPL - A Simplified Modeling Language for Mathematical Programming SMPL - A Simplified Modeling Language for Mathematical Programming Mihály Csaba Markót November 3, 2008 1 Purpose and Scope This working paper describes SMPL, an initiative of a Simplified Modeling Language

More information

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating

More information

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating

More information

Data Types In Text: Ch C apter 6 1

Data Types In Text: Ch C apter 6 1 Data Types In Text: Chapter 6 1 Outline What is a type? Primitives Strings Ordinals Arrays Records Sets Pointers 2 Data Types Two components: Set of objects in the type (domain of values) Set of applicable

More information

Programming Languages Lecture 14: Sum, Product, Recursive Types

Programming Languages Lecture 14: Sum, Product, Recursive Types CSE 230: Winter 200 Principles of Programming Languages Lecture 4: Sum, Product, Recursive Types The end is nigh HW 3 No HW 4 (= Final) Project (Meeting + Talk) Ranjit Jhala UC San Diego Recap Goal: Relate

More information

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards Language Reference Manual Introduction The purpose of

More information

Programming, numerics and optimization

Programming, numerics and optimization Programming, numerics and optimization Lecture A-2: Programming basics II Łukasz Jankowski ljank@ippt.pan.pl Institute of Fundamental Technological Research Room 4.32, Phone +22.8261281 ext. 428 March

More information

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) Technology & Information Management Instructor: Michael Kremer, Ph.D. Database Program: Microsoft Access Series DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) AGENDA 3. Executing VBA

More information

COMP 202 Java in one week

COMP 202 Java in one week COMP 202 Java in one week... Continued CONTENTS: Return to material from previous lecture At-home programming exercises Please Do Ask Questions It's perfectly normal not to understand everything Most of

More information

Abstract This paper describes AxSL, an Axiomatic Specication Language that extends algebraic axiom methods to support object-oriented concepts such as

Abstract This paper describes AxSL, an Axiomatic Specication Language that extends algebraic axiom methods to support object-oriented concepts such as Extending Algebraic Axiom Techniques to Handle Object-Oriented Specications Alyce Brady, Member, IEEE David R. Musser, Member, IEEE Computer Society David L. Spooner, Member, IEEE August 2, 1999 Abstract

More information

The ACK Modula-2 Compiler

The ACK Modula-2 Compiler The ACK Modula-2 Compiler Ceriel J.H. Jacobs Department of Mathematics and Computer Science Vrije Universiteit Amsterdam The Netherlands 1. Introduction This document describes the implementation-specific

More information

This book is licensed under a Creative Commons Attribution 3.0 License

This book is licensed under a Creative Commons Attribution 3.0 License 6. Syntax Learning objectives: syntax and semantics syntax diagrams and EBNF describe context-free grammars terminal and nonterminal symbols productions definition of EBNF by itself parse tree grammars

More information

The MaSH Programming Language At the Statements Level

The MaSH Programming Language At the Statements Level The MaSH Programming Language At the Statements Level Andrew Rock School of Information and Communication Technology Griffith University Nathan, Queensland, 4111, Australia a.rock@griffith.edu.au June

More information

BNF, EBNF Regular Expressions. Programming Languages,

BNF, EBNF Regular Expressions. Programming Languages, BNF, EBNF Regular Expressions Programming Languages, 234319 1 Reminder - (E)BNF A notation for describing the grammar of a language The notation consists of: Terminals: the actual legal strings, written

More information