Programming Language
文章平均质量分 71
Programming Language Pragmatics - 4th edition, by Michael L. Scott
KnightHacker2077
CSNOOB
展开
-
CP5: Using polymorphism
In parseStmt, there is a big if-else branching part to match the stmt to the right alternative. This is very error-prone, becuase we rely on the programmer to set the alternative number to identify the subtype. If a wrong alt. num is set, boom, type error原创 2021-11-01 01:12:02 · 87 阅读 · 0 评论 -
CP4: Memory
Run-time Memory PortionsCode Portion: the compiled/interpreted source code Stack Portion:the portion allocated for function execution (may shrink and grow in size) Heap Portion: the portion allocated for all objects created using "new" In C++, dynami.原创 2021-11-01 00:53:02 · 113 阅读 · 0 评论 -
CP2 - Parser
Get input character stream from tokenizer, thenbuild the parse tree. (PT) Parent node to create an “empty” child node Pass the row number corresponding to the newly created node as argument Example: ParseIf()-- Call getToken(), check it is...原创 2021-10-13 12:36:30 · 100 阅读 · 0 评论 -
CP2: Tokenizer, Parser, Syntax & More
Syntax vs. Semantics: form (syntax) and meaning (semantics) of a language must be specified without ambiguity,Specifying Syntax: Regular Expressions and Context-Free GrammarsFormal Syntax rules: Concatenation Alternation -- choice from alternat原创 2021-08-26 01:07:43 · 259 阅读 · 0 评论 -
CP1: Intro to Programming Language
Compilation and Interpretation The compiler translates the high-level source program into an equivalent target program (machine language). Then at some arbitrary later time, the user tells the operating system to run the target program. Compilationlead.原创 2021-08-26 01:06:53 · 185 阅读 · 0 评论