╱╱╭╮╱╱╱╱╱╱╭━━━╮╱╱╱╭╮╱╭╮╱╱╱╱╱╱ ╱╱┃┃╱╱╱╱╱╱┃╭━╮┃╱╱╱┃┃╱┃┃╱╱╱╱╱╱ ╱╱┃┣━━┳━━╮┃┃╱┃┣━╮╱┃╰━╯┣━━┳━╮╱ ╭╮┃┃╭╮┃┃━┫┃╰━╯┃╭╮╮┃╭━╮┃╭╮┃╭╮╮ ┃╰╯┃╭╮┃┃━┫┃╭━╮┃┃┃┃┃┃╱┃┃╭╮┃┃┃┃ ╰━━┻╯╰┻━━╯╰╯╱╰┻╯╰╯╰╯╱╰┻╯╰┻╯╰╯

CS/프로그래밍 언어론 10

[프로그래밍 언어론] Subprogram Control (10)

[9] Subprogram Control Introduction - Subprogram Control : sequence control, data control - Sequence Control : copy rules, static segment, dynamic segment - Scope Rules : static scope rule, dynami scope rule Data Control Problems - 정적 변수를 제외한 나머지 변수는 모두 Activation Record에 있다. - 정적 변수를 제외한 모든 변수의 l-value는 특정 AR에서 offset으로 계산 가능하다. @Computing L-Value - 1. 변수를 포함하는 AR을 찾음 - 2. AR의 특정위치에서 변수의 l-valu..

[프로그래밍 언어론] Sequence Control (9)

[8] Sequence Control Classifying Sequence Controls - Sequence Control : 수행 순서 제어 - Data Control : 서브프로그램 사이의 데이터 흐름 제어 @Sequence Control : 제어 대상 크기(granularity)에 따른 분류 - Expressions - Statements - Subprograms @Sequence Control : 표현 여부에 따른 분류 - Implicit - Explicit Tree Reprensentation of a Expression - Tree Representation : 표현식을 나타내는 기본적인 방법 - 연산자를 서브트리의 루트에, 피연산자를 하위 노드로 나타낸다. (function composit..

[프로그래밍 언어론] Inheritance (8)

[7] Inheritance Private Type - Enforcing encapsulation - Add protection Class - C++에서는 Class를 통해 ADT를 구현 - 데이터 공간 = 멤버 변수 - 추상 연산자 = 멤버 함수 Generic Data Type - Parameteric polymorphism을 형성 - 타입을 인수로 받아 생성된 새로운 타입 (Instantiation of a class) - 타입 인수는 컴파일 시간에 결정된다 Inheritance - 외부 변수 이름을 블록 내부에서 볼 수 있는 것도 interitance의 일종 - 어떠한 ADT를 보다 구체화한 새로운 ADT를 만드는 것 - Superclass, subclass 관계를 형성 - Should repres..

[프로그래밍 언어론] Encapsulation - Abstract Data Types (7)

[6] Encapsulation - Abstract Data Types Abstract Data Types - Abstraction : Making it simpler - Encapsulation : Making them into one unit - Information Hiding : Hiding the details - 추상화, 캡슐화, 정보은닉은 밀접한 연관이 있다 - Encapsulation is a language facility - Whereas information hiding is a design principle. - Encapsulation refers th the bundling of data with the methods that operate on that data. - The p..

[프로그래밍 언어론] Structured Data Types (6)

[5-2] Structured Data TypesEncapsulation -  Data와 Operation을 하나로 묶음 -  Information hiding? User-Defined Data Types Basic Mechanims 1. Structured Data -  복합 데이터를 만들 수 있는 기능 (필수)2. Subprograms -  새로운 연산을 정의할 수 있는 기능 (필수)3. Type Declarations -  새로운 타입을 정의할 수 있는 기능 (고급)4. Inheritance -  기존 타입에서 확장된 타입을 생성할 수 있는 기능 (고급) Structured Data -  다른 데이터 객체를 원소로 구성된 데이터 객체 -  배열, 레코드, 스택, 리스트, 집합 -  원소 선택 방법,..

[프로그래밍 언어론] Elementary Data Types (5)

[5-1] Elementary Data Types1. Data -  숫자, 문자, 군집 데이터, 복합 데이터, 메타 데이터(포인터) Data Object -  Binding of a name to a memoty location -  일반적으로 변수 Data Value -  특정 값을 나타내는 비트 패턴 Data Object Attributes -  Component attribute : type, location, value, name -  Variable attribute : scope, lifetime 상수 -  반드시 초기화되어야하는 변수 -  이후 변경x -  Literal (이름 == 값) -  Named constant (이름 != 값) ex. define 2. Type -  데이터의 분류 ..

[프로그래밍 언어론] Modeling Language Properties (4)

[4] Modeling Language PropertiesFormal Properties of Languages -  규칙에 의해 규정되는 언어와 이러한 언어의 인식에 관한 이론 Chomsky Hierarchy -  Type 3 : Regular Grammars - Finite Automata -  Type 2 : Context Free Grammars - (N) Pushdown Automata -  Type 1 : Context Sensitive Grammars - Linear Bounded Automata -  Type 0 : Unrestricted Grammars - Turing Machine Context Free Grammar -  좌변 : nonterminal 한 개 -  우변 : 제한 없음 ..

[프로그래밍 언어론] Language Translation Issues (3)

[3] Language Translation Issues프로그래밍 언어 정의 = 구문 + 의미 구문 (Syntax) -  Readability -  Writability -  Ease of verification -  Ease of translation -  Lack of ambiguity 의미 (semantics) -  Execution behavior 구문 표기법 -  BNF (Backus-Naur Form) -  EBNF -  CFG (Context-Free Grammar) -  Static Semantics @표기법 표현력 BNF = EBNF = CFG @Static Semantics -  Semantics에 포함시키기도함 -  Attribute Grammar로 표현 의미 표기법 -  Axioma..

[프로그래밍 언어론] Impact of Machine Architecture (2)

[2] Impact of Machine ArchitectureComputer - Data -  Primitive Operations -  Sequence Control -  Data Access -  Storage Management -  Operating Environment @Machine Cycle -  Fetch-Decode-Execute Cycle Firmware Computers -  하드웨어 + 마이크로 프로그램 @Firmware -  마이크로 프로그램@Emulation -  소프트웨어 적으로 마이프로그램 수행을 흉내 (VM) Virtual Architecture -  Language Machine (특정 언어를 펌웨어 형태로 지원) -  프로세서 + 언어 처리기 (고비용) -  구현 : t..

[프로그래밍 언어론] Language Design Issues (1)

[1] Language Design Issues 프로그래밍 언어의 역할- Man-machine interface- Man-man interface 프로그래밍 언어의 분류-  문제영역-  패러다임-  계산모델 좋은 언어의 조건-  언어의 성공은 외부적인 요인인 경우가 많다-  명료성, 간결성, 일관성-  직교성-  Language features-  추상화 지원 (control abstraction + data abstraction)-  Ease of verification-  Programming environment-  Portability-  비용 (수행, 번역, 작성, 관리) 직교성-  몇 개의 다른 기능을 임의로 조합할 수 있는 기능 (예외 없이)-  기능들의 독립성이 보장되어 있다는 의미 Lan..