본문 바로가기

학교48

CPL 1-2: Semantics and Transformations 목차 Translating from Java to Paret Example 1) Example 2) Example 3) Example 4) Mandatory Assignment desugar takes an abstract syntax tree (ExprExt) as input, and returns a core syntax tree (ExprC). interp takes a core syntax tree (ExprC) as input, and returns a value (Value). 1. Basics desugar: case TrueExt() => TrueC() case FalseExt() => FalseC() case NumExt(n) => NumC(n) case NilExt() => NilC().. 2024. 3. 26.
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.
반응형