lang quiz 2 Flashcards
(26 cards)
Alogl68
insane orthogonality
Pascal
teaching language
C
originally a sys language. Many operators poor type checking
smalltalk
first OOP plus had built in gui
C++
added OOP to C
syntax
The form or structure oft he expressions, statements, and program units
semantics
The meaning of the expressions, statements, and program units
lexical analysis
converts characters in the source program into lexical units (tokens)
token
syntactic family that forms a class of units (literal key word, operator)
lexeme
the actual sequence of characters in the token, terminal
meta lang
language used to describe other languages
grammar
A meta-language used to define the syntax of a language
recognizer
can verify if a sentence contains valid syntax for the language
generator
generates a random syntactically valid sentence
sentential form vs sentence
sentential form is any line in a derivation but a sentence is the final line with just terminals
an ambiguous grammar has
multiple potential parse trees for the same sentence
static type binding types
explicit (C++) Implied (fortran) inferencing (C++)
dynamic type binding
Python and JS more expensive
lifetime of a var
time it is bound to a particular memory cell
static variables
exist at compile time. Never added to nor die. efficient, globally accessible, history sensitive subprogram support. Does not allow for recursion or sharing memory.
stack dynamic
variables created when elaborated. allows recursion, conserves storage, however subprograms not history-sensitive, indirect addressing, increased allocate and deallocate over head
explicit heap dynamic
programmer explicitly allocates and deallocates. allows for dynamic storage management, can be error prone and needs a complex management solution
implicit heap dynamic
maximum flexibility but also inefficient because all attributes are re-assigned arrays and strings in JS
scope
where is it visible and who is it visible to