본문 바로가기

학교/CPL16

Lecture 3: Semantics & Transformations 목차 Learning Objectives- Write interpreters for simple languages - Explain differences, advantages and disadvantages between compilers and interpreters - Know which different types of semantics exist - Apply big-step semantics rules to reduce expressions to values - Explain what desugaring is, and why it is useful - Implement a simple desugarer  Semantics (의미)Semantics is the meaning of program p.. 2024. 3. 26.
CPL 1 : Syntax and Parsing 목차 Parsing by Hand Given the following grammar: (1 + 2) * (1 + 4)를 AST와 Node Version으로 변환. Given the following Grammar: pi * r * r을 AST와 Node Version으로 변환. Given the following grammar: AndC가 OrC보다 먼저. false or true and (true or false) Paret context-free syntax Expr.NumExt = INT // integer literals Expr.TrueExt = [true] Expr.FalseExt = [false] Expr.UnOpExt = [([UnOp] [Expr])] Expr.BinOpExt = [([B.. 2024. 3. 25.
Lecture 2: Syntax & Parsing 목차 Learning ObjectivesUnderstand what grammars are Write your own grammars from a specificationKnow what Algebraic Data Types areDefine your own Algebraic Data Types (in Scala)Apply pattern matching in (Scala) programsCreate abstract syntax tree from programs given a grammar (EXAM QUESTION)Know what s-expressions areWrite simple parsers  Syntax Syntax: the structure of program phrases in a langu.. 2024. 3. 25.
Lecture 1: Introduction 목차 Abstraction (추상화) Programming languages are how we instruct machines to do our bidding The more precisely we can model domain-specific abstractions, the better programs we can write, i.e. - concise - maintainable - efficient - correct Abstraction is the process of generalizing concrete details to focus attention on details of greater importance. What is a Definitional Interpreter Definitional.. 2024. 3. 19.
반응형