COM SCI 131 Lecture Notes - Lecture 4: Parse Tree, Compiler, Bell Labs
Document Summary
And (concatenation) pq mam p q = mam (p|q) let rec make_or_matcher p q = let pm = mam p and qm = mam q in fun acc frag match pm acc frag with. | x x let rec make_concatenation_matcher p q = let pm = mam p and qm = mam q in func acc frag . Expressions pm( fun gram qm acc frag ) frag. Mixed mode operation (i. e int + float + double ) In some languages, it solves it by overloading the binary operators. But have scaling issues with the increase in types. As such, most languages have rules to govern how they are added. Side-effects in expression i. e (x = 3) + (y = 4) Ada: the compiler chooses, must choose some order. C/c++: behaviour is undefined if order matters. Process of running a program from start to finish, and compiler construction. Few lectures ago, we tokenized program, and parsed it, made a parse tree.