



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of programming languages, focusing on their syntax and semantics. Topics include regular expressions, context-free grammars, finite automata, recursive descent parsers, implicit and explicit declarations, dynamic and static typing, functional and imperative paradigms, and more. From a computer science course (cmsc 330).
Typology: Study notes
1 / 7
This page cannot be seen from the preview
Don't miss anything!




CMSC 330 2
CMSC 330 3
CMSC 330 4
CMSC 330 5
CMSC 330 6
OCaml a == b a = b
Ruby a.equal?(b) a == b
C a == b *a == *b
Java a == b a.equals(b)
Physical Equality Structural Equality
CMSC 330 7
CMSC 330 8
CMSC 330 9
CMSC 330 10
CMSC 330 11
CMSC 330 19
CMSC 330 20
CMSC 330 21
CMSC 330 22
i is in scope
j is in scope
*void w(int i) { ... } void x(float j) { ... } void y(float i) { ... } void z(void) { int j; char i; ... }
CMSC 330 23
CMSC 330 24
let x = 3 in let y = x + 3 in... ( x is in scope here ) let x = 3 + x in ... ( error, x not in scope )
let rec length = function [] -> 0 | (h::t) -> 1 + (length t) ( ok, length in scope ) in ...
CMSC 330 25
int i; int j = i; / ok, i is in scope / i = 3; / also ok /
void f(...) { ... } int i; int j = j + 3; / error / f(...); / ok, f declared /
f(...); / may be error; need prototype (or oldstyle C) / void f(...) { ... } CMSC 330 26
class C { void f(){ ...g()... // OK } void g(){ ... } }
CMSC 330 27
OCaml let g = 3;; let g x = x + 3;; Java void h(int i) { { float i; // not allowed ... } } CMSC 330 28
CMSC 330 29
CMSC 330 30
CMSC 330 37
global local global CMSC 330 38