1/78
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
True or False:
Syntax defines the meaning of programming language constructs.
False
True or False:
Semantics defines the meaning of statements in a programming language.
True
True or False:
Lexical analysis groups characters into tokens.
True
True or False:
A context-free grammar (CFG) is commonly used to describe semantics.
False
True or False:
BNF stands for Backus–Naur Form.
True
True or False:
In BNF, nonterminal symbols are typically written in angle brackets < >.
True
True or False:
Terminals in a grammar are symbols that can be further expanded.
False
True or False:
Ambiguity occurs when a grammar produces more than one parse tree for a single string.
True
True or False:
EBNF (Extended BNF) allows repetition and optional parts in grammar rules.
True
True or False:
Parse trees represent the semantic meaning of a program.
False
True or False:
A leftmost derivation always replaces the rightmost nonterminal first.
False
True or False:
Recursive descent parsers may require backtracking.
True
True or False:
Attribute grammars extend context-free grammars with attributes and rules.
True
True or False:
In attribute grammars, synthesized attributes pass information upward in the parse tree.
True
True or False:
Inherited attributes flow only upward in the parse tree.
False
True or False:
Static semantics involves properties checked at compile time.
True
True or False:
Type checking is a form of static semantics.
True
True or False:
Dynamic semantics refers to meaning that can be checked without execution.
False
True or False:
Operational semantics describes meaning by changes in an abstract machine’s state.
True
True or False:
Denotational semantics describes meaning using mathematical functions.
True
True or False:
Axiomatic semantics is based on predicate logic.
True
True or False:
Hoare triples are part of denotational semantics.
False
True or False:
A Hoare triple has the form {precondition} program {postcondition}.
True
True or False:
Operational semantics is the most abstract approach to describing semantics.
False
True or False:
Denotational semantics maps programming constructs to precise mathematical objects.
True
True or False:
Axiomatic semantics is mainly concerned with implementation efficiency.
False
True or False:
Regular expressions are sufficient to describe all programming language syntax.
False
True or False:
Context-free grammars can describe nested constructs such as balanced parentheses.
True
True or False:
All BNF grammars are guaranteed to be unambiguous.
False
True or False:
Arithmetic precedence rules can be expressed using context-free grammars.
True
True or False:
Static semantics cannot be described using grammar alone.
True
True or False:
Syntax-directed definitions link grammar rules with semantic actions.
True
True or False:
Attribute grammars cannot be used for static semantics checks.
False
True or False:
Denotational semantics is generally less mathematically precise than operational semantics.
False
True or False:
Axiomatic semantics uses logic to prove program correctness.
True
True or False:
Parse trees and derivations are used to represent semantics.
False
True or False:
BNF and EBNF are primarily concerned with describing syntax.
True
True or False:
Attribute grammars combine both syntax and semantics in a unified framework.
True
True or False:
In programming languages, syntax and semantics are unrelated.
False
True or False:
The study of semantics helps in understanding program correctness and reasoning.
True
The part of a programming language that defines the meaning of statements and constructs.
Semantics
The set of rules that defines the structure of programs and how symbols can be combined.
Syntax
The process of grouping characters from source code into meaningful tokens.
Lexical analysis
A formalism used to describe programming language syntax, not semantics.
Context-free grammar (CFG)
A notation for describing context-free grammars, commonly using angle brackets for nonterminals.
BNF (Backus–Naur Form)
Symbols in a grammar that cannot be expanded further.
Terminals
Occurs when a grammar can produce more than one parse tree for the same string.
Ambiguity
An extension of BNF that allows optional and repeated elements in grammar rules.
EBNF
Trees that represent the syntactic structure of a program.
Parse trees
A parsing strategy that may require backtracking when encountering multiple possible expansions.
Recursive descent parser
Grammars that are extended with attributes and rules to link syntax and semantics.
Attribute grammars
Attributes that pass information upward in the parse tree.
Synthesized attributes
Attributes that flow downward or across siblings in a parse tree.
Inherited attributes
Properties of a program that can be checked at compile time.
Static semantics
The process of verifying type correctness and other compile-time rules.
Type checking
Describes program meaning during execution rather than at compile time.
Dynamic semantics
Describes the meaning of a program by modeling state changes in an abstract machine.
Operational semantics
Describes programming constructs using precise mathematical functions.
Denotational semantics
Uses predicate logic to reason about program correctness.
Axiomatic semantics
A logical assertion of the form {precondition} program {postcondition}.
Hoare triple
The approach to describing semantics that focuses on proving program correctness rather than execution.
Axiomatic semantics
The formal system that maps programming constructs to precise mathematical objects.
Denotational semantics
Grammars capable of describing nested structures like balanced parentheses.
Context-free grammars (CFGs)
Grammars that may produce multiple parse trees for the same string are called…
Ambiguous grammars
The rules that define arithmetic precedence in programming languages can be expressed using this.
Context-free grammars
Describes properties of programs that cannot be enforced by grammar alone.
Static semantics
A method that links grammar rules directly with semantic actions.
Syntax-directed definitions
Grammars that can be used to check static semantics, like type consistency.
Attribute grammars
The formal approach to semantics that is less abstract and often models execution on an abstract machine.
Operational semantics
Trees or derivations that represent syntactic structure rather than semantic meaning.
Parse trees
A notation primarily concerned with describing syntax, such as grammar rules.
BNF or EBNF
A formalism that combines both syntax and semantics in a unified framework.
Attribute grammars
The study of meaning in programming languages, which helps reason about program correctness.
Semantics
Properties or rules of a program that can be enforced at compile-time rather than runtime.
Static semantics
The semantic approach that uses logic to prove correctness of programs.
Axiomatic semantics
Semantic method that describes meaning by mapping constructs to mathematical functions.
Denotational semantics
Semantic method that describes meaning via state changes in an abstract machine.
Operational semantics
A Hoare triple expresses correctness with a precondition, program, and postcondition.
{precondition} program {postcondition}
Dynamic semantics refers to meaning that is determined during program execution rather than at compile time.
Dynamic semantics