Computers/Programming Language 9

PL/0 Virtual Machine - instruction

수업 때 쓰기위해 교수님께서 만드신 어셈블러...@_@ 레지스터 : P - program counter : 다음 실행 명령 주소를 갖고 있음I - Instruction Register : 현재 실행중인 명령의 내용을 갖고 있음B - Base Register T - Top Register 메모리 :code[] : instructions[] : data PL/0 Machine Instruction 1. LIT : Load ConstantLIT 0, a T = T+1S[T] = a 2. INT : Memory Allocation//memory allocation 위해 top 증가 - a만큼 메모리 증가INT 0, a T = T+a 3. JMP : Unconditional Jump// P의 주소를 a로 변경해서..

ch6-2. Data Type

▷ Array types : an homogenous aggregate of data elements in which the individual element is identified by its position in the aggregate , relative to the first♠ Design issue - subscript의 자료형? - subscript의 범위? (c같은 경우는 0부터 시작... 1부터 시작하는 언어도 있음 ) - array allocation은 언제 해야할지? - 얼마나 많은 subscript가 허용되야 할까?(a[10][5] - 배열의 배열, a[10,5] - 2차원 배열 in pascal, ada) - array 초기화? - 어떤 종류의 slice를 허용할지? ♠ Array..

ch6-1. Data Type

▷ Intro★ Goal : PL에서 제공되는 데이터 타입이 현실의 문제 범위에 얼마나 잘 일치할까?! How well the DATA TYPES provided by a programming language match the REAL WORLD PROBLEM DOMAIN? ★ Primitive data type vs. User-defined data type★ Concept and Implementation ♠ Data type : a collection of data value and a set of predefined operations on those values. ※ Descriptor : the collection of the attributes of a variable. - In an imp..

ch4. Lexical and syntax analysis

▷ PL에 대해 접근하는 방식♠ Compilation- use complier / 고급언어를 기계언어로 translate해줌- PLs used for large application, such as C++, COBOL♠ Pure interpreter- no translate- usually used for smaller systems in which execution efficiency is not critical, such as scripts embedded in HTML, written in languages such as JavaScript♠ Hybrid System- translate programs written in high-level languages into intermediate form..

ch3. describe syntax and semantics

▷ Language Design / describing▷ Syntax / Semantics - Syntax : the form of its expression, statements, and program units.문법. 형태. 구조. - Semantics : the meaning of those expression, statements, and program unit의미. (+가 먼저인가, *가 먼저인가) ♠ Terminologies - Alphabet - String - Language : set of sentences : set of strings of characters from alphabet - Sentence(Stmt) : the string of lang. : 문법에 맞는 string : ..

ch1. preliminaries

◆ Reasons for studying concepts of PLsIncreased capacity to express ideas Improved background for choosing appropriate language(적합한 언어를 선택)Increased ability to learn and describe new languages(새로운 언어를 쉽게 학습, cf. C언어는 알골 계열의 언어)Better understanding of the significance of implementation구현의 중요성(컴파일러마다 조금씩 상이)Better use of languages that already known(이미 알고 있는 언어를 더 잘 사용할 수 있음)Overall advancement of..