CS135 Chapter : Module 3 - Syntax and Semantics.docx

70 views2 pages

Document Summary

A program has a precise meaning and effect. A model of a programming language provides a way of describing the meaning of a program. There are few language constructs, making the model descriptions short. No more than the language itself is necessary. (i. e. no need for diagrams, etc. ) Identifiers are the names of constants, parameters, and user-defined functions. Identifiers must contain at least one non-number and may not contain any spaces or these: ( ) , ; , - * + . There are rules for numbers (integers, rationals, and decimals). Built-in constants such as true and false also exist. Syntax: the way in which one is allowed to say something. Ambiguity: a valid sentence has only 1 meaning. Grammars enforce syntax and help to avoid ambiguity. This is similar to the grammar found in spoken languages. The issue of semantics can be solved using a semantics model of a programming language.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents