중간코드생성
|
|
- 주현 범
- 6 years ago
- Views:
Transcription
1 컴파일러구성 제 11 강 결정적구문분석
2 Introduction Syntax-Directed Translation Code Generation U-Code Translator
3 Formal Specification lexical structure : regular expression syntactic structure : context-free grammar the remaining phases of compilation : no such notations but, we use a syntax-directed translation scheme which is a method associating semantic rules(or actions) with production. SDTS ::= cfg + semantic actions cfg 의 production rule 에있는 grammar symbol 을이용하여직접 semantic action 을기술하는방법. AST generation Attribute grammar
4 Intermediate code generation the phase that generates an explicit intermediate code of the source program. after syntax and semantic analysis. A Model for Intermediate code generation Source Program Scanner Parser Intermediate Representation Intermediate Code Generation IC Our implementations: Source program : Mini C 프로그램 Intermediate Representation : Abstract Syntax Tree (AST) Intermediate code : U-Code Execution : U-Code Interpreter
5 Implementation Model Mini C Compiler data Source Program *.mc Scanner Token Stream Parser SDT AST ICG Ucode *.uco Ucode Interpreter scanner : shift action of parser parser : main program (LR parser) SDT : reduce action of parser (AST generation) ICG : Intermediate code generation by traversing AST. Semantic Analysis 와 Intermediate Code Generation 을효율적으로처리하기위해서 AST 의 design 은매우중요. result
6 Syntax-Directed Translation Scheme(SDTS) ::= a production rule + semantic action(no widely-accepted formalism) A Model for SDTS Parsing table Source Program Scanner get_token token Parser (main) Result call semantic... Semantic Actions whenever a reduction takes place, the semantic rule corresponding to the applied syntactic rule is activated.
7 Advantages of SDT Providing a method describing semantic rules and that description is independent of any particular implementation. Easy to modify - new productions and semantic actions can be added without disturbing the existing ones. Disadvantages of SDT 파싱도중에 error가일어난경우이제까지행한 semantic action이모두무의미해진다. input에대해 one pass이면서 syntax-directed하게처리하기때문에어떤경우에는정보가부족하여후에필요한정보가나타났을때 backpatching 등복잡하게처리해야한다. Solution Syntax-directed 한방법으로는의미분석과코드생성시에필요한정보만을구성하고다음단계에서그것을이용하여의미분석과코드생성을한다.
8 SDTS(Syntax-Directed Translation Scheme) ::= production rules + semantic actions Description of Semantic Actions (1) Conventional PL. (2) Meta Language - Formal Semantic Language(FSL) Semantic Description Preprocessor table Input SDT Output
9 Semantic Description using Attributes of the Grammar Symbol ::= We associate information with a programming language construct by attaching attributes to the grammar symbols representing the construct. Values for attributes are computed by "semantic rules" associated with the grammar productions. An attribute of symbol ex) ::= A value associated with a grammar symbol. Each grammar symbol has an associated set of attributes. An attribute can represent anything we choose: a string, a number, a type, a memory location, or whatever. Production Semantic Rules L E$ E E 1 + T E T T T 1 * F T F F (E) F digit print(e.val) E.val := E 1.val + T.val E.val := T.val T.val := T 1.val * F.val T.val := F.val F.val := E.val F.val := digit.lexval
10 Synthesized attribute ::= the value of the attribute of the nonterminal on the left side of the production is defined as a function of the grammar symbols on the right side. ex) A XYZ A := f(x,y,z) Inherited attribute ::= the value of the attribute of a nonterminal on the right side of the production is defined in terms of an attribute of the nonterminal on the left. ex) A XYZ Y.val := 2 * X.val Synthesized attribute is more natural than inherited attribute for mapping most programming language constructs into intermediate code.
11 Designing steps Input design - language construct에대한 grammar를 cfg를이용하여 design. Scanner, Parser의작성. Semantic Specification - conventional PL. SDT Translator 의완성 - interconnection. Examples : 1. Desk Calculator 2. Conversion infix into postfix 3. Construction of AST
12 Step 1: Input design 0. S -> E $ 1. E -> E + E 2. E -> E * E 3. E -> ( E ) 4. E -> num Step 2: Parsing table states symbols num + * 0 s 3 ( ) s 2 $ E 1 1 s 4 s 5 acc 2 s 3 3 r 4 r 4 4 s 3 s 2 s 2 r 4 6 r s 3 s s 4 s 5 s 8 7 r 1 s 5 r 1 r 1 8 r 2 r 2 r 2 r 2 9 r 3 r 3 r 3 r 3
13 Step 3: Semantic Specification Production L E$ E E 1 + E 2 E E 1 * E 2 E (E 1 ) E num Semantic Rules print E.val E.val := E 1.val + E 2.val E.val := E 1.val * E 2.val E.val := E 1.val E.val := num.lexval Step 4: Implementation of Desk Calculator Parsing stack : Symbol stack + State stack + Value stack Value stack : holding the values of the corresponding attribute.
14 Code fragments corresponding to semantic actions Production S E$ E E + E E E * E E (E) E num Code Fragment print (val[top]) val[top-2] := val[top-2] + val[top] val[top-2] := val[top-2] * val[top] val[top-2] := val[top-1] val[top] := num.lexval the code fragments do not show how variable top is managed. lexval : token value the code fragments are executed before a reduction takes place.
15 ex) 23 * $ state input symbol value parse (0, 23 * 5 + 4$,,, ) s3 ==> (0 3, * 5 + 4$, num,, ) r4 ==> (0 1, * 5 + 4$, E, 23, 4 ) s5 ==> (0 1 5, 5 + 4$, E *, 23_, 4 ) s3 ==> ( , + 4$, E * num, 23, 4 ) r4 ==> ( , + 4$, E * E, 23_5, 4 4 ) r2 ==> (0 1, + 4$, E, 115, ) s4 ==> (0 1 4, 4$, E +, 115_, ) s3 ==> ( , $, E + num, 115, ) r4 ==> ( , $, E + E, 115_4, ) r1 ==> (0 1, $, E, 119, ) ==> accept
16 Code fragments Production E E + E E E * E E E / E E (E) E a print + print * print / no action print a Code Fragment ex) a + (a + a) * a a a a + a * +
17 AST is a condensed form of parse tree useful for representing language constructs. ex) a = b + 1; = a + b 1 ex) if (a > b) x = a; else x = b; if > = = a b x a x b
18 Functions to create the nodes of AST for expressions with binary operators. Each function returns a pointer to a newly created node. 1. mktree(op,left,right) creates an operator node with label op and two fields containing pointers to left and right. 2. mknode(a) creates a terminal node for a and returns the node pointer. Semantic Specification Production E E 1 + T E E 1 T E T T (E) T a Semantic Rules E.nptr := mktree( +, E 1.nptr, T.nptr) E.nptr := mktree(, E 1.nptr, T.nptr) E.nptr := T.nptr T.nptr := E.nptr T.nptr := mknode(a) The synthesized attribute nptr for E and T keeps track of the pointers returned by the function calls.
19 AST for a c + - id id num 4 to entry for c to entry for a
20 AST design Grammar form : production rule [ => nodename ] ; A α nodename ; nodename α 1 α 2 α n Note node name 의생략시에는부트리를구성하지않음.
21 Mini C Grammar with AST mini_c translation_unit PROGRAM; translation_unit external_dcl; translation_unit external_dcl; external_dcl function_def; declaration; function_def function_header compound_st FUNC_DEF; function_header dcl_spec function_name formal_param FUNC_HEAD; dcl_spec dcl_specifiers DCL_SPEC; dcl_specifiers dcl_specifier; dcl_specifiers dcl_specifier; dcl_specifier type_qualifier; type_specifier; Text p 참조
22 Data Structures A node form of AST token son noderep brother tokennumber tokenvalue next brother node son node Node structure struct tokentype { int tokennumber; char * tokenvalue; }; typedef struct nodetype { struct tokentype token; enum {terminal, nonterm} noderep; struct nodetype *son; struct nodetype *brother; } Node; // 토큰번호 // 토큰값 // 토큰종류 // 노드종류 // 왼쪽링크 // 오른쪽링크
23 Production rule name enum nodenumber { ACTUAL_PARAM, ADD, ADD_ASSIGN, ARRAY_VAR, ASSIGN_OP,, WHILE_ST }; char *nodename[] = { "ACTUAL_PARAM", "ADD", "ADD_ASSIGN", "ARRAY_VAR", "ASSIGN_OP", "WHILE_ST" }; int rulename[] = { /* */ 0, PROGRAM, 0, 0, 0, /* */ 0, 0, 0 };
24 AST Generation Shift buildnode(simple and easy) Reduce buildtree(complex and difficult) Shift action of parsing : if the token is meaningful, then call buildnode. Node *buildnode(struct tokentype token) { Node *ptr; ptr = (Node *) malloc(sizeof(node)); if (!ptr) { printf("malloc error in buildnode()\n"); exit(1); } ptr->token = token; ptr->noderep = terminal; ptr->son = ptr->brother = NULL; return ptr; }
25 Reduce action of parsing : Basic concept if the production rule is meaningful 1. build subtree - linking brothers - making a subtree else 2. only linking brothers buildtree() function step 1: finding a first index with node in value stack. step 2: linking brothers. step 3: making subtree root and linking son if meaningful.
26 Node *buildtree(int nodenumber, int rhslength) Node *buildtree(int nodenumber, int rhslength) { // i = sp - rhslength + 1; // step 1: find a first index with node in value stack while (i <= sp && valuestack[i] == NULL) i++; if (!nodenumber && i > sp) return NULL; start = i; // step 2: linking brothers while (i <= sp-1) { j = i + 1; while (j <= sp && valuestack[j] == NULL) j++; } if (j <= sp) { } i = j; ptr = valuestack[i]; while (ptr->brother) ptr = ptr->brother; ptr->brother=valuestack[j]; } first = (start > sp)? NULL : valuestack[start]; // step 3: making subtree root and linking son if (nodenumber) { // memory allocation for ptr ptr->token.tokennumber = nodenumber; ptr->token.tokenvalue = NULL; ptr->noderep = nonterm; ptr->son = first; ptr->brother = NULL; return ptr; } else return first; // 1 // 2 // 3 // 4 // 5 // 6 // 7
27 buildtree() 함수의설명 1 현재 reduce 되는생성규칙의 rhs 에노드가매달려있는인덱스를값스택에서찾는다. 형제노드로연결할노드의첫번째인덱스를찾은것이다. 2 의미있는생성규칙이아니고연결할형제노드도없으면그냥복귀한다. 3 형제노드로연결할노드의다음인덱스를 1 과같은방법으로찾는다. 4 만약다음인덱스를찾았으면, 형제노드로연결한다. 5 연속해서다음인덱스를찾기위해위치를앞으로이동한다. 6 연결된형제노드들의첫번째노드의포인터를 first 에저장한다. 7 의미있는생성규칙이면, nonterminal 노드를만든후에연결된형제노드를 son 으로연결하고새로만든노드의포인터를복귀한다. 의미있는생성규칙이아니면, 연결된형제노드의포인터만을복귀한다.
28 Parsing Stack and Value Stack Parsing Stack : Value Stack : SP Note Parsing Stack 과 Value Stack 은병렬로운행
29 Confirming the AST structures Printing an AST using indentation Traversing an AST in depth-first order Two functions printtree() printing an AST structure printnode() printing a node information printtree() function void printtree(node *pt, int indent) { } Node *p = pt; while (p!= NULL) { } printnode(p, indent); if (p->noderep == nonterm) printtree(p->son, indent+5); p = p->brother;
30 printnode() function void printnode(node *pt, int indent) { extern FILE * astfile; int i; } for (i=1; i<=indent; i++) fprintf(astfile," "); if (pt->noderep == terminal) { if (pt->token.number == tident) fprintf(astfile," Terminal: %s", pt->token.value.id); else if (pt->token.number == tnumber) fprintf(astfile," Terminal: %d", pt->token.value.num); } else { // nonterminal node int i; i = (int) (pt->token.number); fprintf(astfile," Nonterminal: %s", nodename[i]); } fprintf(astfile,"\n");
31 Implement a syntax-directed translator producing an AST for Mini C program. mini C Program *.mc Scanner Parser SDT AST Mini C Program : Perfect.mc(Text pp.447) The Output form of AST using printtree() : Text pp
untitled
5. hamks@dongguk.ac.kr (regular expression): (recognizer) : F(, scanner) CFG(context-free grammar): : PD(, parser) CFG 1 CFG form : N. Chomsky type 2 α, where V N and α V *. recursive construction ) E
More informationMicrosoft PowerPoint - PL_03-04.pptx
Copyright, 2011 H. Y. Kwak, Jeju National University. Kwak, Ho-Young http://cybertec.cheju.ac.kr Contents 1 프로그래밍 언어 소개 2 언어의 변천 3 프로그래밍 언어 설계 4 프로그래밍 언어의 구문과 구현 기법 5 6 7 컴파일러 개요 변수, 바인딩, 식 및 제어문 자료형 8
More information강의10
Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced
More informationchap 5: Trees
5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경
More information03장.스택.key
---------------- DATA STRUCTURES USING C ---------------- 03CHAPTER 1 ? (stack): (LIFO:Last-In First-Out) 2 : top : ( index -1 ),,, 3 : ( ) ( ) -> ->. ->.... 4 Stack ADT : (LIFO) : init():. is_empty():
More information컴파일러
YACC 응용예 Desktop Calculator 7/23 Lex 입력 수식문법을위한 lex 입력 : calc.l %{ #include calc.tab.h" %} %% [0-9]+ return(number) [ \t] \n return(0) \+ return('+') \* return('*'). { printf("'%c': illegal character\n",
More informationEA0015: 컴파일러
5 Context-Free Grammar 무엇을공부하나? 앞에서배운 " 정규식 " 은언어의 " 어휘 (lexeme)" 를표현하는도구로사용되었다. 언어의 " 구문 (syntax)" 은 " 정규언어 " 의범위를벗어나기때문에 " 정규식 " 으로표현이불가능하다. 본장에서배우는 " 문맥자유문법 " 은언어의 " 구문 (syntax)" 을표현할수있는도구이다. 어떤 " 문맥자유문법
More information자연언어처리
제 7 장파싱 파싱의개요 파싱 (Parsing) 입력문장의구조를분석하는과정 문법 (grammar) 언어에서허용되는문장의구조를정의하는체계 파싱기법 (parsing techniques) 문장의구조를문법에따라분석하는과정 차트파싱 (Chart Parsing) 2 문장의구조와트리 문장 : John ate the apple. Tree Representation List
More information슬라이드 제목 없음
Chapter 5: TREES Trees Trees Def) a tree is finite set of one or more nodes such that 1) there is a special node (root) 2) remaining nodes are partitioned into n 0 disjoint trees T 1,T 2,,T n where each
More informationMicrosoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100
2015-1 프로그래밍언어 9. 연결형리스트, Stack, Queue 2015 년 5 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) 연결리스트 (Linked List) 연결리스트연산 Stack
More informationMicrosoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600
균형이진탐색트리 -VL Tree delson, Velskii, Landis에의해 1962년에제안됨 VL trees are balanced n VL Tree is a binary search tree such that for every internal node v of T, the heights of the children of v can differ by at
More informationSIGPLwinterschool2012
1994 1992 2001 2008 2002 Semantics Engineering with PLT Redex Matthias Felleisen, Robert Bruce Findler and Matthew Flatt 2009 Text David A. Schmidt EXPRESSION E ::= N ( E1 O E2 ) OPERATOR O ::=
More informationMicrosoft PowerPoint - semantics
제 3 장시맨틱스 (Semantics) Reading Chap 13 숙대창병모 Sep. 2007 1 3.1 Operational Semantics 숙대창병모 Sep. 2007 2 시맨틱스의필요성 프로그램의미의정확한이해 소프트웨어의정확한명세 소프트웨어시스템에대한검증혹은추론 컴파일러혹은해석기작성의기초 숙대창병모 Sep. 2007 3 의미론의종류 Operational
More informationChapter 4. LISTS
연결리스트의응용 류관희 충북대학교 1 체인연산 체인을역순으로만드는 (inverting) 연산 3 개의포인터를적절히이용하여제자리 (in place) 에서문제를해결 typedef struct listnode *listpointer; typedef struct listnode { char data; listpointer link; ; 2 체인연산 체인을역순으로만드는
More information형식 언어
컴파일러개요 아주대학교정보및컴퓨터공학부 목차 컴파일러란 프로그래밍언어 관련프로그램들 컴파일러의일반적인구조 컴파일러자동화도구 Compiler 2 컴파일러란 Compiler A compiler is a computer program which translates programs written in a particular high-level programming
More informationstep 1-1
Written by Dr. In Ku Kim-Marshall STEP BY STEP Korean 1 through 15 Action Verbs Table of Contents Unit 1 The Korean Alphabet, hangeul Unit 2 Korean Sentences with 15 Action Verbs Introduction Review Exercises
More informationChapter 4. LISTS
C 언어에서리스트구현 리스트의생성 struct node { int data; struct node *link; ; struct node *ptr = NULL; ptr = (struct node *) malloc(sizeof(struct node)); Self-referential structure NULL: defined in stdio.h(k&r C) or
More informationDIY 챗봇 - LangCon
without Chatbot Builder & Deep Learning bage79@gmail.com Chatbot Builder (=Dialogue Manager),. We need different chatbot builders for various chatbot services. Chatbot builders can t call some external
More information4.18.국가직 9급_전산직_컴퓨터일반_손경희_ver.1.hwp
2015년도 국가직 9급 컴퓨터 일반 문 1. 시스템 소프트웨어에 포함되지 않는 것은? 1 1 스프레드시트(spreadsheet) 2 로더(loader) 3 링커(linker) 4 운영체제(operating system) - 시스템 소프트웨어 : 운영체제, 데이터베이스관리 프로그램,, 컴파일러, 링커, 로더, 유틸리티 소프트웨 어 등 - 스프레드시트 : 일상
More informationfinal_thesis
CORBA/SNMP DPNM Lab. POSTECH email : ymkang@postech.ac.kr Motivation CORBA/SNMP CORBA/SNMP 2 Motivation CMIP, SNMP and CORBA high cost, low efficiency, complexity 3 Goal (Information Model) (Operation)
More informationMPLAB C18 C
MPLAB C18 C MPLAB C18 MPLAB C18 C MPLAB C18 C #define START, c:\mcc18 errorlevel{0 1} char isascii(char ch); list[list_optioin,list_option] OK, Cancel , MPLAB IDE User s Guide MPLAB C18 C
More information5.스택(강의자료).key
CHP 5: https://www.youtube.com/watch?v=ns-r91557ds ? (stack): (LIFO:Last-In First-Out):. D C B C B C B C B (element) C (top) B (bottom) (DT) : n element : create() ::=. is_empty(s) ::=. is_full(s) ::=.
More information프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어
개나리 연구소 C 언어 노트 (tyback.egloos.com) 프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어먹고 하더라구요. 그래서,
More information1
1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2
More informationSemantic Consistency in Information Exchange
제 3 장시맨틱스 (Semantics) Reading Chap 13 숙대창병모 1 시맨틱스의필요성 프로그램의미의정확한이해 소프트웨어의정확한명세 소프트웨어시스템에대한검증혹은추론 컴파일러혹은해석기작성의기초 숙대창병모 2 3.1 Operational Semantics 숙대창병모 3 의미론의종류 Operational Semantics 프로그램의동작과정을정의 Denotational
More informationslide2
Program P ::= CL CommandList CL ::= C C ; CL Command C ::= L = E while E : CL end print L Expression E ::= N ( E + E ) L &L LefthandSide L ::= I *L Variable I ::= Numeral N ::=
More information2002년 2학기 자료구조
자료구조 (Data Structures) Chapter 1 Basic Concepts Overview : Data (1) Data vs Information (2) Data Linear list( 선형리스트 ) - Sequential list : - Linked list : Nonlinear list( 비선형리스트 ) - Tree : - Graph : (3)
More information4 CD Construct Special Model VI 2 nd Order Model VI 2 Note: Hands-on 1, 2 RC 1 RLC mass-spring-damper 2 2 ζ ω n (rad/sec) 2 ( ζ < 1), 1 (ζ = 1), ( ) 1
: LabVIEW Control Design, Simulation, & System Identification LabVIEW Control Design Toolkit, Simulation Module, System Identification Toolkit 2 (RLC Spring-Mass-Damper) Control Design toolkit LabVIEW
More informationMicrosoft Word - FunctionCall
Function all Mechanism /* Simple Program */ #define get_int() IN KEYOARD #define put_int(val) LD A val \ OUT MONITOR int add_two(int a, int b) { int tmp; tmp = a+b; return tmp; } local auto variable stack
More information구문 분석
컴파일러구성 제 10 강 중간언어 / 인터프리터 Motivation rapid development of machine architectures proliferation of programming languages portable & adaptable compiler design --- P_CODE porting --- rewriting only back-end
More informationadfasdfasfdasfasfadf
C 4.5 Source code Pt.3 ISL / 강한솔 2019-04-10 Index Tree structure Build.h Tree.h St-thresh.h 2 Tree structure *Concpets : Node, Branch, Leaf, Subtree, Attribute, Attribute Value, Class Play, Don't Play.
More informationchap x: G입력
원형큐 (Circular Queue) [2] [3] [2] [3] [1] [4] [1] [4] [0] [5] front = 0, rear = 0 [2] [3] [0] [5] front = 0, rear = 3 [1] [4] [0] [5] front = 0, rear = 0 최대큐이용률 = MAX_Q_SIZE 1 3 장. 스택과큐 (Page 13) 원형큐의구현
More informationexample code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for
2003 Development of the Software Generation Method using Model Driven Software Engineering Tool,,,,, Hoon-Seon Chang, Jae-Cheon Jung, Jae-Hack Kim Hee-Hwan Han, Do-Yeon Kim, Young-Woo Chang Wang Sik, Moon
More information13주-14주proc.PDF
12 : Pro*C/C++ 1 2 Embeded SQL 3 PRO *C 31 C/C++ PRO *C NOT! NOT AND && AND OR OR EQUAL == = SQL,,, Embeded SQL SQL 32 Pro*C C SQL Pro*C C, C Pro*C, C C 321, C char : char[n] : n int, short, long : float
More information4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona
이름 : 학번 : A. True or False: 각각항목마다 True 인지 False 인지적으세요. 1. (Python:) randint 함수를사용하려면, random 모듈을 import 해야한다. 2. (Python:) '' (single quote) 는한글자를표현할때, (double quote) 는문자열을표현할때사용한다. B. 다음에러를수정하는방법을적으세요.
More informationA Hierarchical Approach to Interactive Motion Editing for Human-like Figures
단일연결리스트 (Singly Linked List) 신찬수 연결리스트 (linked list)? tail 서울부산수원용인 null item next 구조체복습 struct name_card { char name[20]; int date; } struct name_card a; // 구조체변수 a 선언 a.name 또는 a.date // 구조체 a의멤버접근 struct
More informationOCaml
OCaml 2009.. (khheo@ropas.snu.ac.kr) 1 ML 2 ML OCaml INRIA, France SML Bell lab. & Princeton, USA nml SNU/KAIST, KOREA 3 4 (let) (* ex1.ml *) let a = 10 let add x y = x + y (* ex2.ml *) let sumofsquare
More informationC++-¿Ïº®Çؼ³10Àå
C C++. (preprocessor directives), C C++ C/C++... C++, C. C++ C. C C++. C,, C++, C++., C++.,.. #define #elif #else #error #if #itdef #ifndef #include #line #pragma #undef #.,.,. #include #include
More informationK&R2 Reference Manual 번역본
typewriter structunion struct union if-else if if else if if else if if if if else else ; auto register static extern typedef void char short int long float double signed unsigned const volatile { } struct
More informationchap 5: Trees
Chapter 5. TREES 목차 1. Introduction 2. 이진트리 (Binary Trees) 3. 이진트리의순회 (Binary Tree Traversals) 4. 이진트리의추가연산 5. 스레드이진트리 (Threaded Binary Trees) 6. 히프 (Heaps) 7. 이진탐색트리 (Binary Search Trees) 8. 선택트리 (Selection
More information11장 포인터
Dynamic Memory and Linked List 1 동적할당메모리의개념 프로그램이메모리를할당받는방법 정적 (static) 동적 (dynamic) 정적메모리할당 프로그램이시작되기전에미리정해진크기의메모리를할당받는것 메모리의크기는프로그램이시작하기전에결정 int i, j; int buffer[80]; char name[] = data structure"; 처음에결정된크기보다더큰입력이들어온다면처리하지못함
More informationC 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12
More information61 62 63 64 234 235 p r i n t f ( % 5 d :, i+1); g e t s ( s t u d e n t _ n a m e [ i ] ) ; if (student_name[i][0] == \ 0 ) i = MAX; p r i n t f (\ n :\ n ); 6 1 for (i = 0; student_name[i][0]!= \ 0&&
More informationC# Programming Guide - Types
C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든
More informationMicrosoft Word - ExecutionStack
Lecture 15: LM code from high level language /* Simple Program */ external int get_int(); external void put_int(); int sum; clear_sum() { sum=0; int step=2; main() { register int i; static int count; clear_sum();
More informationuntitled
Logic and Computer Design Fundamentals Chapter 4 Combinational Functions and Circuits Functions of a single variable Can be used on inputs to functional blocks to implement other than block s intended
More informationNo Slide Title
Copyright, 2001 Multimedia Lab., CH 3. COM object (In-process server) Eun-sung Lee twoss@mmlab.net Multimedia Lab. Dept. of Electrical and Computer Eng. University of Seoul Seoul, Korea 0. Contents 1.
More information05_tree
Tree Data Structures and Algorithms 목차 트리의개요 이진트리의구현 이진트리의순회 (Traversal) 수식트리 (Expression Tree) 의구현 Data Structures and Algorithms 2 트리의개요 Data Structures and Algorithms 3 트리의접근과이해 트리는계층적관계 (Hierarchical
More information슬라이드 1
/ 유닉스시스템개요 / 파일 / 프로세스 01 File Descriptor file file descriptor file type unix 에서의파일은단지바이트들의나열임 operating system 은파일에어떤포맷도부과하지않음 파일의내용은바이트단위로주소를줄수있음 file descriptor 는 0 이나양수임 file 은 open 이나 creat 로 file
More informationthesis
( Design and Implementation of a Generalized Management Information Repository Service for Network and System Management ) ssp@nile nile.postech.ac..ac.kr DPE Lab. 1997 12 16 GMIRS GMIRS GMIRS prototype
More informationchap01_time_complexity.key
1 : (resource),,, 2 (time complexity),,, (worst-case analysis) (average-case analysis) 3 (Asymptotic) n growth rate Θ-, Ο- ( ) 4 : n data, n/2. int sample( int data[], int n ) { int k = n/2 ; return data[k]
More information6주차.key
6, Process concept A program in execution Program code PCB (process control block) Program counter, registers, etc. Stack Heap Data section => global variable Process in memory Process state New Running
More informationChap 6: Graphs
5. 작업네트워크 (Activity Networks) 작업 (Activity) 부분프로젝트 (divide and conquer) 각각의작업들이완료되어야전체프로젝트가성공적으로완료 두가지종류의네트워크 Activity on Vertex (AOV) Networks Activity on Edge (AOE) Networks 6 장. 그래프 (Page 1) 5.1 AOV
More informationSNU =10100 =minusby by1000 ÇÁto0.03exÇÁto0.03exÇÁ=10100 =minusby by1000 ·Îto0.03ex·Îto0.03ex·Î=10100 =minusby by1000 ±×to0.
차례 SNU 4190.210 프로그래밍원리 (Principles of Programming) Part II Prof. Kwangkeun Yi 다음 데이타구현하기 (data implementation) 새로운타입의데이타 / 값구현하기 기억하는가 : 타입들 (types) τ ::= ι primitive type τ τ pair(product) type τ + τ
More informationHW5 Exercise 1 (60pts) M interpreter with a simple type system M. M. M.., M (simple type system). M, M. M., M.
오늘할것 5 6 HW5 Exercise 1 (60pts) M interpreter with a simple type system M. M. M.., M (simple type system). M, M. M., M. Review: 5-2 7 7 17 5 4 3 4 OR 0 2 1 2 ~20 ~40 ~60 ~80 ~100 M 언어 e ::= const constant
More informationPowerPoint Presentation
Lecture 01: Compiler Overview Kwang-Man Ko kkmam@sangji.ac.kr, compiler.sangji.ac.kr Department of Computer Engineering Sang Ji University 2019 강의정보 교과목명 : 컴파일러 개설학과 : 컴퓨터공학과 4학년 학점및시수 : 3학점 3시간 강의시간 :
More informationOrcad Capture 9.x
OrCAD Capture Workbook (Ver 10.xx) 0 Capture 1 2 3 Capture for window 4.opj ( OrCAD Project file) Design file Programe link file..dsn (OrCAD Design file) Design file..olb (OrCAD Library file) file..upd
More informationUSER GUIDE
Solution Package Volume II DATABASE MIGRATION 2010. 1. 9. U.Tu System 1 U.Tu System SeeMAGMA SYSTEM 차 례 1. INPUT & OUTPUT DATABASE LAYOUT...2 2. IPO 중 VB DATA DEFINE 자동작성...4 3. DATABASE UNLOAD...6 4.
More informationuntitled
Step Motor Device Driver Embedded System Lab. II Step Motor Step Motor Step Motor source Embedded System Lab. II 2 open loop, : : Pulse, 1 Pulse,, -, 1 +5%, step Step Motor (2),, Embedded System Lab. II
More information10주차.key
10, Process synchronization (concurrently) ( ) => critical section ( ) / =>, A, B / Race condition int counter; Process A { counter++; } Process B { counter ;.. } counter++ register1 = counter register1
More informationPowerPoint 프레젠테이션
@ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program
More information7장
CHAP 7: 트리 C 로쉽게풀어쓴자료구조 트리 (TREE) 트리 : 계층적인구조를나타내는자료구조 트리는부모 - 자식관계의노드들로이루어진다. 응용분야 : 계층적인조직표현파일시스템인공지능에서의결정트리 대표이사 총무부 영업부 생산부 전산팀구매팀경리팀생산 1 팀생산 2 팀 * 예제 : 책그림 7-2, 7-3, 7-4 트리의용어 노드 (node): 트리의구성요소 루트
More informationObservational Determinism for Concurrent Program Security
웹응용프로그램보안취약성 분석기구현 소프트웨어무결점센터 Workshop 2010. 8. 25 한국항공대학교, 안준선 1 소개 관련연구 Outline Input Validation Vulnerability 연구내용 Abstract Domain for Input Validation Implementation of Vulnerability Analyzer 기존연구
More information歯15-ROMPLD.PDF
MSI & PLD MSI (Medium Scale Integrate Circuit) gate adder, subtractor, comparator, decoder, encoder, multiplexer, demultiplexer, ROM, PLA PLD (programmable logic device) fuse( ) array IC AND OR array sum
More information04-다시_고속철도61~80p
Approach for Value Improvement to Increase High-speed Railway Speed An effective way to develop a highly competitive system is to create a new market place that can create new values. Creating tools and
More informationSNU =10100 =minusby by1000 ÇÁto0.03exÇÁto0.03exÇÁ=10100 =minusby by1000 ·Îto0.03ex·Îto0.03ex·Î=10100 =minusby by1000 ±×to0.
프로그래밍 원리 (Principles of Programming) Part II Prof. Kwangkeun Yi 차례 1 데이타구현하기 (data implementation) 2 데이터속구현감추기 (data abstraction) 3 여러구현동시지원하기 (multiple implemenations) 4 각계층별로속구현감추기 (data abstraction
More informationWRIEHFIDWQWF.hwp
목 차 Abstract 1. 서론 2. 한국영화 흥행의 배경 2.1. 대중문화와 흥행영화 2.2. 흥행변수에 관한 조망 3. 영화 의 내러티브 특징 3.1. 일원적 대칭형 인물 설정 3.2. 에피소드형 이야기 구조 3.3. 감각적인 대사 처리 4. 시청각 미디어 환경의 영향력 4.1. 대중 매체가 생산한 기억 4.2. 기존 히트곡 사용의 위력 5. 결론 참고문헌
More informationchap8.PDF
8 Hello!! C 2 3 4 struct - {...... }; struct jum{ int x_axis; int y_axis; }; struct - {...... } - ; struct jum{ int x_axis; int y_axis; }point1, *point2; 5 struct {....... } - ; struct{ int x_axis; int
More informationMicrosoft PowerPoint - Chap5 [호환 모드]
데이터구조 (hapter 5: Trees) 2011 년봄학기 숙명여자대학교정보과학부멀티미디어과학전공박영호 Index hapter 01: asic oncepts hapter 02: rrays and Structures hapter 03: Stacks and Queues hapter 04: Lists hapter 05: Trees hapter 06: Graphs
More informationMicrosoft PowerPoint - AC3.pptx
Chapter 3 Block Diagrams and Signal Flow Graphs Automatic Control Systems, 9th Edition Farid Golnaraghi, Simon Fraser University Benjamin C. Kuo, University of Illinois 1 Introduction In this chapter,
More informationDocsPin_Korean.pages
Unity Localize Script Service, Page 1 Unity Localize Script Service Introduction Application Game. Unity. Google Drive Unity.. Application Game. -? ( ) -? -?.. 준비사항 Google Drive. Google Drive.,.. - Google
More informationLet G = (V, E) be a connected, undirected graph with a real-valued weight function w defined on E. Let A be a set of E, possibly empty, that is includ
알고리즘설계와분석 (CSE3081(2 반 )) 기말고사 (2016년 12월15일 ( 목 ) 오전 9시40분 ~) 담당교수 : 서강대학교컴퓨터공학과임인성 < 주의 > 답안지에답을쓴후제출할것. 만약공간이부족하면답안지의뒷면을이용하고, 반드시답을쓰는칸에어느쪽의뒷면에답을기술하였는지명시할것. 연습지는수거하지않음. function MakeSet(x) { x.parent
More information이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다. 2
제 17 장동적메모리와연결리스트 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다.
More informationMAX+plus II Getting Started - 무작정따라하기
무작정 따라하기 2001 10 4 / Version 20-2 0 MAX+plus II Digital, Schematic Capture MAX+plus II, IC, CPLD FPGA (Logic) ALTERA PLD FLEX10K Series EPF10K10QC208-4 MAX+plus II Project, Schematic, Design Compilation,
More informationSomething that can be seen, touched or otherwise sensed
Something that can be seen, touched or otherwise sensed Things about an object Weight Height Material Things an object does Pen writes Book stores words Water have Fresh water Rivers Oceans have
More informationU.Tu System Application DW Service AGENDA 1. 개요 4. 솔루션 모음 1.1. 제안의 배경 및 목적 4.1. 고객정의 DW구축에 필요한 메타정보 생성 1.2. 제품 개요 4.2. 사전 변경 관리 1.3. 제품 특장점 4.3. 부품화형
AGENDA 1. 개요 4. 솔루션 모음 1.1. 제안의 배경 및 목적 4.1. 고객정의 DW구축에 필요한 메타정보 생성 1.2. 제품 개요 4.2. 사전 변경 관리 1.3. 제품 특장점 4.3. 부품화형 언어 변환 1.4. 기대 효과 4.4. 프로그램 Restructuring 4.5. 소스 모듈 관리 2. SeeMAGMA 적용 전략 2.1. SeeMAGMA
More information11강-힙정렬.ppt
11 (Heap ort) leejaku@shinbiro.com Topics? Heap Heap Opeations UpHeap/Insert, DownHeap/Extract Binary Tree / Index Heap ort Heap ort 11.1 (Priority Queue) Operations ? Priority Queue? Priority Queue tack
More informationPowerPoint Presentation
FORENSICINSIGHT SEMINAR SQLite Recovery zurum herosdfrc@google.co.kr Contents 1. SQLite! 2. SQLite 구조 3. 레코드의삭제 4. 삭제된영역추적 5. 레코드복원기법 forensicinsight.org Page 2 / 22 SQLite! - What is.. - and why? forensicinsight.org
More informationVol.257 C O N T E N T S M O N T H L Y P U B L I C F I N A N C E F O R U M
2017.11 Vol.257 C O N T E N T S 02 06 38 52 69 82 141 146 154 M O N T H L Y P U B L I C F I N A N C E F O R U M 2 2017.11 3 4 2017.11 6 2017.11 1) 7 2) 22.7 19.7 87 193.2 160.6 83 22.2 18.4 83 189.6 156.2
More information09권오설_ok.hwp
(JBE Vol. 19, No. 5, September 2014) (Regular Paper) 19 5, 2014 9 (JBE Vol. 19, No. 5, September 2014) http://dx.doi.org/10.5909/jbe.2014.19.5.656 ISSN 2287-9137 (Online) ISSN 1226-7953 (Print) a) Reduction
More informationChapter 4. LISTS
6. 동치관계 (Equivalence Relations) 동치관계 reflexive, symmetric, transitive 성질을만족 "equal to"(=) 관계는동치관계임. x = x x = y 이면 y = x x = y 이고 y = z 이면 x = z 동치관계를이용하여집합 S 를 동치클래스 로분할 동일한클래스내의원소 x, y 에대해서는 x y 관계성립
More information商用
商用 %{ /* * line numbering 1 */ int lineno = 1 % \n { lineno++ ECHO ^.*$ printf("%d\t%s", lineno, yytext) $ lex ln1.l $ gcc -o ln1 lex.yy.c -ll day := (1461*y) div 4 + (153*m+2) div 5 + d if a then c :=
More informationOracle Apps Day_SEM
Senior Consultant Application Sales Consulting Oracle Korea - 1. S = (P + R) x E S= P= R= E= Source : Strategy Execution, By Daniel M. Beall 2001 1. Strategy Formulation Sound Flawed Missed Opportunity
More information구조체정의 자료형 (data types) 기본자료형 (primitive data types) : char, int, float 등과같이 C 언어에서제공하는자료형. 사용자정의자료형 (user-defined data types) : 다양한자료형을묶어서목적에따라새로운자료형을
(structures) 구조체정의 구조체선언및초기화 구조체배열 구조체포인터 구조체배열과포인터 구조체와함수 중첩된구조체 구조체동적할당 공용체 (union) 1 구조체정의 자료형 (data types) 기본자료형 (primitive data types) : char, int, float 등과같이 C 언어에서제공하는자료형. 사용자정의자료형 (user-defined
More informationhlogin7
0x07. Return Oriented Programming ROP? , (DEP, ASLR). ROP (Return Oriented Programming) (excutable memory) rop. plt, got got overwrite RTL RTL Chain DEP, ASLR gadget Basic knowledge plt, got call function
More informationChap 6: Graphs
AOV Network 의표현 임의의 vertex 가 predecessor 를갖는지조사 각 vertex 에대해 immediate predecessor 의수를나타내는 count field 저장 Vertex 와그에부속된모든 edge 들을삭제 AOV network 을인접리스트로표현 count link struct node { int vertex; struct node
More informationPowerPoint 프레젠테이션
@ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field
More information08장.트리
---------------- T STRUTURES USING ---------------- HPTER 트리 /29 트리 (TREE) 트리 : 계층적인구조를나타내는자료구조 트리는부모-자식관계의노드들로이루어짐 응용분야 : 대표이사 총무부 영업부 생산부 전산팀구매팀경리팀 생산 팀 생산 2 팀 (a) 회사의조직도 내문서 동영상음악사진 영화예능드라마 여행 (b) 컴퓨터의폴더구조
More information제 1 장 기본 개념
이진트리순회와트리반복자 트리순회 (tree traversal) 트리에있는모든노드를한번씩만방문 순회방법 : LVR, LRV, VLR, VRL, RVL, RLV L : 왼쪽이동, V : 노드방문, R : 오른쪽이동 왼쪽을오른쪽보다먼저방문 (LR) LVR : 중위 (inorder) 순회 VLR : 전위 (preorder) 순회 LRV : 후위 (postorder)
More informationInterstage5 SOAP서비스 설정 가이드
Interstage 5 Application Server ( Solaris ) SOAP Service Internet Sample Test SOAP Server Application SOAP Client Application CORBA/SOAP Server Gateway CORBA/SOAP Gateway Client INTERSTAGE SOAP Service
More informationchap10.PDF
10 C++ Hello!! C C C++ C++ C++ 2 C++ 1980 Bell Bjarne Stroustrup C++ C C++ C, C++ C C 3 C C++ (prototype) (type checking) C C++ : C++ 4 C C++ (prototype) (type checking) [ 10-1] #include extern
More information#KM560
KM-560 KM-560-7 PARTS BOOK KM-560 KM-560-7 INFORMATION A. Parts Book Structure of Part Book Unique code by mechanism Unique name by mechanism Explode view Ref. No. : Unique identifcation number by part
More informationSRC PLUS 제어기 MANUAL
,,,, DE FIN E I N T R E A L L O C E N D SU B E N D S U B M O TIO
More informationPolly_with_Serverless_HOL_hyouk
{ } "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":[ "polly:synthesizespeech", "dynamodb:query", "dynamodb:scan", "dynamodb:putitem", "dynamodb:updateitem", "sns:publish", "s3:putobject",
More informationchap x: G입력
3. 미로찾기 (Mazing Problem) 2 차원배열을이용한미로의구현 maze[row][column]: 0 길, 1 벽 그림 3.8 참조 이동방향 8 방향 (N, NE, E, SE, S, SW, W, NW) 각방향에대한 maze 배열의첨자변환 : 그림 3.9 경계지역 : 8 방향이아님. ( 모서리 : 3 방향, 변 : 5 방향 ) m p 미로를 (m +
More informationuntitled
(shared) (integrated) (stored) (operational) (data) : (DBMS) :, (database) :DBMS File & Database - : - : ( : ) - : - : - :, - DB - - -DBMScatalog meta-data -DBMS -DBMS - -DBMS concurrency control E-R,
More information슬라이드 1
Pairwise Tool & Pairwise Test NuSRS 200511305 김성규 200511306 김성훈 200614164 김효석 200611124 유성배 200518036 곡진화 2 PICT Pairwise Tool - PICT Microsoft 의 Command-line 기반의 Free Software www.pairwise.org 에서다운로드후설치
More informationPowerPoint 프레젠테이션
Reasons for Poor Performance Programs 60% Design 20% System 2.5% Database 17.5% Source: ORACLE Performance Tuning 1 SMS TOOL DBA Monitoring TOOL Administration TOOL Performance Insight Backup SQL TUNING
More information#Ȳ¿ë¼®
http://www.kbc.go.kr/ A B yk u δ = 2u k 1 = yk u = 0. 659 2nu k = 1 k k 1 n yk k Abstract Web Repertoire and Concentration Rate : Analysing Web Traffic Data Yong - Suk Hwang (Research
More information