Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
17 Cards in this Set
- Front
- Back
Syntax
|
the form or structure of the expressions, statements, and program units
|
|
Semantics
|
the meaning of the expressions, statements, and program units
|
|
sentence
|
a string of characters over some alphabet
|
|
language
|
set of sentences
|
|
lexeme
|
lowest level syntactic unit of a language (e.g., *, sum, begin)
|
|
token
|
a category of lexemes (e.g., identifier)
|
|
Recognizers
|
reads input strings over the alphabet of the language and decides whether the input strings belong to the language
|
|
Generators
|
A device that generates sentences of a language
|
|
Context-Free Grammars
|
Language generators, meant to describe the syntax of natural languages. Developed by Noam Chomsky
|
|
Backus-Naur Form
|
Language generators, meant to describe the syntax of natural languages. Developed by Noam Chomsky
|
|
Grammar
|
a finite non-empty set of rules
|
|
grammar is ambiguous if:
|
it generates a sentential form that has two or more distinct parse trees
|
|
Attribute Grammars
|
a context-free grammar G = (S, N, T, P).
For each grammar symbol x there is a set A(x) of attribute values each rule has: -predicates to check for attribute consistency. -a set of functions that define certain attributes of the nonterminals in the rule. |
|
needs for a methodology and notation for semantics:
|
-Programmers need to know what statements mean
-Compiler writers must know exactly what language constructs do -Correctness proofs would be possible -Compiler generators would be possible -Designers could detect ambiguities and inconsistencies |
|
Operational Semantics
|
Describe the meaning of a program by executing its statements on a machine
|
|
Evaluation of Denotational Semantics
|
-Can be used to prove the correctness of programs
-Provides a rigorous way to think about programs -Can be an aid to language design -Has been used in compiler generation systems |
|
Axiomatic Semantics
|
Axioms or inference rules are defined for each statement type in the language (to allow transformations of logic expressions into more formal logic expressions)
|