Ask a question from expert

Ask now

Concepts of Programming Language

15 Pages1712 Words339 Views
   

Added on  2020-05-16

Concepts of Programming Language

   Added on 2020-05-16

BookmarkShareRelated Documents
Running Head: CONCEPTS OF PROGRAMMING LANGUAGE1Programming Language ConceptsInstitutionDateName
Concepts of Programming Language_1
CONCEPTS OF PROGRAMMING LANGUAGE2Chapter 31.Syntax in programming is defined as the form of expressions, program units, and statements.Semantics, on the other hand, is the meaning of these expressions, program units, and statements (Stroustrup, 2014).2.Language descriptions include the syntax and semantics for every potential user or evaluator that is concerned in knowing and improving their skills in a given programminglanguage3.Semantics and syntax both provides a language’s definition. In a good language, its semantics follows straightforwardly from the syntax.4.Approaches for formally defining languages:Axiomatic semanticsDenotational semanticsAxiomatic Semantics – An approach which attempts to provide rules that indicate the relevant changes I data immediately after the execution of a feature in a given programming language.Denotational semantics – defines programs basing on mathematical functions and utilize these functions to obtain the properties of the program (Stroustrup, 2014).5.Language generation mechanismsSyntax: Set of instructions which specify how to write a given programming language.\\Semantics: Relates to the meaning of an instruction e.g. a++.
Concepts of Programming Language_2
CONCEPTS OF PROGRAMMING LANGUAGE36.Parse trees and derivation connection is so close. Parse trees or derivations can be constructed from one another. Derivations that have unambiguous grammar contain unique parse trees.7.Values of synthesized attributes are computed basing on the attribute values of child nodes while the value on an inherited attribute is computed basing on the attribute values of parent and sibling nodes8.Attribute grammars are used for:Compiler designStatic semantic specification
Concepts of Programming Language_3
CONCEPTS OF PROGRAMMING LANGUAGE4Problem Set1. a). Associativity:from left to the right= is right to the left+is left to the right|is left to the right*is left to the rightb). Precedence of operators from high to lowPrecedenceOperator25*6+13|16=c). Left most derivation
Concepts of Programming Language_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Compiler Construction: Context-Free Grammars and Top-Down Parsing
|2
|750
|282