: gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp

Size: px
Start display at page:

Download ": gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp"

Transcription

1 7 OCaml () () (compiler) (interpreter) 2 OCaml (syntax) (BNF,backus normal form ) 1 + 2; let x be 2-1 in x; ::= ; let be in ; ::= + - ::= * / ::= 7.1 ( (printable characters) (tokens) 1 (lexical analizer) let twice x=x*2; lettwicex=x*2; let (reserved word)twicex (identifier) =* (symbol)2 56: token type token = LET BE IN EOF ID of string NUM of int ONE of char 1 79

2 : gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := input_char!_istream; c) let skip () = (ch := input_char!_istream) let lookahead () =!ch (* *) let rec integer i = let c = lookahead () in if (c >= 0 && c <= 9 ) then integer (10*i+(Char.compare (read ()) 0 )) else i (* *) and identifier id = let c = lookahead () in if ((c >= a && c <= z ) (c >= A && c <= Z ) (c >= 0 && c <= 9 ) c == _ ) then identifier (id^(char.escaped (read ()))) else id (* *) and native_token () = let c = lookahead () in if ((c >= a && c <= z ) (c >= A && c <= Z ) c == _ ) then let id = identifier "" in match id with "let" -> LET "be" -> BE "in" -> IN _ -> ID (id) else if (c >= 0 && c <= 9 ) then NUM (integer 0) else ONE (read ()) (* *) and gettoken () = try let token = native_token () in match token with ONE -> gettoken () ONE \t -> gettoken () ONE \n -> gettoken () _ -> token with End_of_file -> EOF

3 token LETBEEOFIN stringint char IDNUM ONE ID("fun")Num(1001)ONE( ; ) 58: type = 1 of 1 n of n i of i i ( i ) type i of i i i gettoken lookahead ch (look ahead) ch ch type (variant types) (C union ) (record type) () match with match with 1 -> 1 2 -> 2 59: match of n -> n input char ( ISTREAM 1 lookahead char read read() ch ch () gettoken native token gettoken native token gettoken 83: gettoken # gettoken ();; + - : ONE + # gettoken ();; 1 - : NUM 1 # gettoken ();; abd - : ID "abd"

4 82 7. gettoken 1 1 run() 60: run0 (* *) let print_token tk = match tk with (ID i) -> P.printf "ID(%s)" i (NUM n) -> P.printf "NUM(%d)" n (LET) -> P.printf "LET" (BE) -> P.printf "BE" (IN) -> P.printf "IN" (EOF) -> P.printf "EOF" (ONE c) -> P.printf "ONE(%c)" c (* *) let rec run () = flush stdout; let rlt = gettoken () in match rlt with (ONE $ ) -> raise End_of_system _ -> (print_token rlt; P.printf "\n"; run()) gettoken token () print token run gettoken while 2 while $ gettoken 2 SML while

5 : run() # run();; 1+2; NUM(1) ONE(+) NUM(2) ONE(;) let x be 10 in x; LET ID(x) BE NUM(10) IN ID(x) ONE(;) $ Exception: End of system. module module Lexer 61: module Lexer module Lexer = struct end 7.2 ( (parser tree) ) ::= ; Expr() let be in ; Def(,, ) ::= + App(Var +,Pair(, )) - App(Var -,Pair(, )) ::= * App( Var *,Pair(, )) / App( Var /,Pair(, )) ::= Num() Var() () (top down parser) (bottom up parser) 2

6 84 7. Knuth LL(k)(Left-to-right parse, Leftmost-derivation, k-symbol lookahead)lr(k)(left-to-right parse, Rightmost-derivation, k-symbol lookahead) P ET F P let be E in E ; P E ; E T E E + T E E T T F T T F T T / F F F E T E E + T E E T T F T T F T T / F 2, 3 (left recursive) LL(1) LL(1) E T E E + T E E T E E T T F T T F T T / F T T terminal symbolnon-terminal symbol 1.

7 !tok match with tok!tok tok parse advance() x eat(x) eatid eatnum advance tok parse 85: prase # parse ();; let x be 20 in x; $ - : unit = () # parse ();; 1+2; $ - : unit = () $ E0F 1 $

8 : parse (* *) module L = Lexer (* tok *) let gettoken () = L.gettoken () let tok = ref (L.ONE ) let advance () = tok := gettoken() (* let advance () = (tok := gettoken(); L.print_token (!tok)) *) (* *) exception Syntax_error let error () = raise Syntax_error (* *) let eat t = if (!tok=t) then advance() else error() let eatid () = match!tok with (L.ID _) -> advance() _ -> error() let eatnum () = match!tok with (L.NUM _) -> advance() _ -> error() (* *) let rec parse () = (advance(); p()) and p () = match!tok with L.LET -> (eat(l.let); eatid(); eat(l.be); e(); eat(l.in); e(); eat(l.one ; )) _ -> (e(); eat(l.one ; )) and e () = (t(); e ()) and e () = match!tok with L.ONE + -> (eat(l.one + ); t(); e ()) L.ONE - -> (eat(l.one - ); t(); e ()) _ -> () and t() = (f(); t ()) and t () = match!tok with L.ONE * -> (eat(l.one * ); f(); t ()) L.ONE / -> (eat(l.one / ); f(); t ()) _ -> () and f() = match!tok with L.ID _ -> eatid() L.NUM _ -> eatnum() _ -> error() parse parse () ( ) definition( ) expr (

9 ) 63: definition expr type definition = Def of string * expr * expr Expr of expr and expr = Num of int Var of string App of expr * expr Pair of expr * expr module 64: module Ast module Ast = struct end 86: ## let x be 10 in x ; $ Def(x,Num 10,Var x) ## 1+2; $ Expr(App(Var +,Pair(Num 1,Num 2))) ## let y be 10-3 in y/2; $ Def(y,App(Var -,Pair(Num 10,Num 3)),App(Var /,Pair(Var y,num 2))) let x be 10 in x; Def(x,Num 10,Var x) 1+2 Expr(App(Var +,Pair(Num 1,Num 2))) let y be 10-3 in y/2; Def(y,App(Var -,Pair(Num 10,Num 3)), App(Var /,Pair(Var y,num 2))) Def(x,Num 10,Var x) Def / \ x Num 10 Var x

10 : parse (* *) module L = Lexer module A = Ast (* tok *) let gettoken () = L.gettoken () let tok = ref (L.ONE ) let advance () = tok := gettoken() (* let advance () = (tok := gettoken(); L.print_token (!tok)) *) (* *) exception Syntax_error let error () = raise Syntax_error (* *) let eat t = if (!tok=t) then advance() else error() let eatid () = match!tok with (L.ID id) -> (advance(); id) _ -> error() let eatnum () = match!tok with (L.NUM num) -> (advance(); num) _ -> error() (* *) let rec parse () = (advance(); p()) and p () = match!tok with L.LET -> (eat(l.let); let _str = eatid() in (eat(l.be); let _e1 = e() in eat(l.in); let _e2 = e() in (eat(l.one ; ); A.Def (_str, _e1, _e2)))) _ -> let _e = e() in (eat(l.one ; ); A.Expr _e) and e () = let _t = t() in (e _t) and e _e = match!tok with L.ONE + -> (eat(l.one + ); let _pre = A.App(A.Var "+", A.Pair(_e, t())) in (e _pre)) L.ONE - -> (eat(l.one - ); let _pre = A.App(A.Var "-", A.Pair(_e, t())) in (e _pre)) _ -> _e and t () = let _f = f() in (t _f) and t _t = match!tok with L.ONE * -> (eat(l.one * ); let _pre = A.App(A.Var "*", A.Pair(_t, f())) in (t _pre)) L.ONE / -> (eat(l.one / ); let _pre = A.App(A.Var "/", A.Pair(_t, f())) in (t _pre)) _ -> _t and f() = match!tok with L.ID _ -> A.Var (eatid()) L.NUM _ -> A.Num (eatnum()) _ -> error()

11 Expr(App(Var +,Pair(Num 1,Num 2))) Expr App / \ Var + Pair / \ Num 1 Num 2 Def(y,App(Var -,Pair(Num 10,Num 3)), App(Var /,Pair(Var y,num 2))) Def / \ y App App / \ / \ Var - Pair Var / Pair / \ / \ Num 10 Num 3 Var y Num 2 parse let E T E E + T E E T E E E + T E and e _e = match!tok with (L.ONE + ) -> (eat(l.one + ); let _pre = A.App(A.Var "+", A.Pair(_e,t())) in (e _pre)) parse

12 : parse # parse ();; let x be 20 in x; $ - : definition = Def ("x", Num 20, Var "x")val it = Def ("x",num 20,Var "x") # parse ();; 1+2; $ - : definition = Expr (App(Var "+",Pair (Num 1, Num 2))) module module Parser 66: module Parser module Parser = struct end

13 (referential type) 67: # let x = 10;; val x : int = 10 # let f = fun x -> x;; val f : a -> a = <fun> 10 x (fun x -> x) f (procedural language) (imperative language) () x x (reference) x --> > (C )x x OCaml 3 88: # let x = ref 10;; val x : int ref = contents = 10 # x;; - : int ref = contents = 10 # let y =!x;; val y : int = 10 # y;; - : int = 10 x ref 10 ref! (dereference ) y (assignment) 3 (garbage) (garbage collector) OCaml

14 : # x := 33;; - : unit = () # x;; - : int ref = contents = 33 #!x;; - : int = 33 # x := "true";; Characters 5-11: x := "true";; ŒŒ Error: This expression has type string but an expression was expected of type int := () ( x int) 4 ref (constructor) OCaml 90: ref # ref;; - : a -> a ref = <fun> 4 let

Parametric Polymorphism

Parametric Polymorphism ML 2 2011/04/19 Parametric Polymorphism Type Polymorphism ? : val hd_int : int list - > int val hd_bool : bool list - > bool val hd_i_x_b : (int * bool) list - > int * bool etc. let hd_int = function (x

More information

jssst-ocaml.mgp

jssst-ocaml.mgp Objective Caml Jacques Garrigue Kyoto University garrigue@kurims.kyoto-u.ac.jp Objective Caml? 2 Objective Caml GC() Standard MLHaskell 3 OCaml () OCaml 5 let let x = 1 + 2 ;; val x : int = 3 ;; val-:

More information

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 More Logic More Types ML/OCaml GADT Jacques Garrigue ( ) Jacques Le Normand (Google) Didier Rémy (INRIA) @garriguejej ocamlgadt ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 ( ) ML type nebou and

More information

Jacques Garrigue

Jacques Garrigue Jacques Garrigue Garrigue 1 Garrigue 2 $ print_lines () > for i in $1; do > echo $i > done $ print_lines "a b c" a b c Garrigue 3 Emacs Lisp (defun print-lines (lines) (dolist (str lines) (insert str)

More information

# let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsu

# let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsu II 4 : 2001 11 7 keywords: 1 OCaml OCaml (first-class value) (higher-order function) 1.1 1 2 + 2 2 + + n 2 sqsum 1 3 + 2 3 + + n 3 cbsum # let rec sqsum n = # if n = 0 then 0 else n * n + sqsum (n - 1)

More information

プログラミング言語 8 字句解析器(lexer)と構文解析器(parser)

プログラミング言語 8   字句解析器(lexer)と構文解析器(parser) 8 (lexer) (parser) 1 / 73 (lexer, tokenizer) (parser) Web Page (HTML XML) CSV, SVG,...... config file... ( )! 2 / 73 1 1 OCaml : ocamllex ocamlyacc 2 Python : ply 2! 3 / 73 ( ) 字句解析器 構文解析器 ご注文はうさぎさんですか?

More information

( ) ( ) lex LL(1) LL(1)

( ) ( ) lex LL(1) LL(1) () () lex LL(1) LL(1) http://www.cs.info.mie-u.ac.jp/~toshi/lectures/compiler/ 29 5 14 1 1 () / (front end) (back end) (phase) (pass) 1 2 1 () () var left, right; fun int main() { left = 0; right = 10;

More information

Objective Caml 3.12 Jacques Garrigue ( ) with Alain Frisch (Lexifi), OCaml developper team (INRIA)

Objective Caml 3.12 Jacques Garrigue ( )   with Alain Frisch (Lexifi), OCaml developper team (INRIA) Objective Caml 3.12 Jacques Garrigue ( ) http://www.math.nagoya-u.ac.jp/~garrigue/ with Alain Frisch (Lexifi), OCaml developper team (INRIA) Jacques Garrigue Modules in Objective Caml 3.12 1 Objective

More information

r02.dvi

r02.dvi 172 2017.7.16 1 1.1? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X ( ) 1.2 1 2-0 ( ) ( ) ( ) (12) ( ) (112) (131) 281 26 1 (syntax) (semantics) ( ) 2 2.1 BNF BNF(Backus Normal Form) Joun Backus (grammer) English

More information

ohp02.dvi

ohp02.dvi 172 2017.7.16 1 ? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X 2 ( ) 3 2-0 ( ) ( ) ( ) (12) ( ) (112) 31) 281 26 1 4 (syntax) (semantics) ( ) 5 BNF BNF(Backus Normal Form) Joun Backus (grammer) English grammer

More information

compiler-text.dvi

compiler-text.dvi 2018.4 1 2 2.1 1 1 1 1: 1. (source program) 2. (object code) 3. 1 2.2 C if while return C input() output() fun var ( ) main() C (C-Prime) C A B C 2.3 Pascal P 1 C LDC load constant LOD load STR store AOP

More information

ML λ λ 1 λ 1.1 λ λ λ e (λ ) ::= x ( ) λx.e (λ ) e 1 e 2 ( ) ML λx.e Objective Caml fun x -> e x e let 1

ML λ λ 1 λ 1.1 λ λ λ e (λ ) ::= x ( ) λx.e (λ ) e 1 e 2 ( ) ML λx.e Objective Caml fun x -> e x e let 1 2005 sumii@ecei.tohoku.ac.jp 2005 6 24 ML λ λ 1 λ 1.1 λ λ λ e (λ ) ::= x ( ) λx.e (λ ) e 1 e 2 ( ) ML λx.e Objective Caml fun x -> e x e let 1 let λ 1 let x = e1 in e2 (λx.e 2 )e 1 e 1 x e 2 λ 3 λx.(λy.e)

More information

r9.dvi

r9.dvi 2011 9 2011.12.9 Ruby B Web ( ) 1 1.1 2 def delete if at then return @cur = @prev.next = @cur.next (1) EOF (2)@cur 1 ()@prev 1 def exch if at @cur.next == @tail then return a = @prev; b = @cur.next; c

More information

# let st1 = {name = "Taro Yamada"; id = };; val st1 : student = {name="taro Yamada"; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n

# let st1 = {name = Taro Yamada; id = };; val st1 : student = {name=taro Yamada; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n II 6 / : 2001 11 21 (OCaml ) 1 (field) name id type # type student = {name : string; id : int};; type student = { name : string; id : int; } student {} type = { 1 : 1 ;...; n : n } { 1 = 1 ;...; n = n

More information

untitled

untitled II 4 Yacc Lex 2005 : 0 1 Yacc 20 Lex 1 20 traverse 1 %% 2 [0-9]+ { yylval.val = atoi((char*)yytext); return NUM; 3 "+" { return + ; 4 "*" { return * ; 5 "-" { return - ; 6 "/" { return / ; 7 [ \t] { /*

More information

() / (front end) (back end) (phase) (pass) 1 2

() / (front end) (back end) (phase) (pass) 1 2 1 () () lex http://www.cs.info.mie-u.ac.jp/~toshi/lectures/compiler/ 2018 4 1 () / (front end) (back end) (phase) (pass) 1 2 () () var left, right; fun int main() { left = 0; right = 10; return ((left

More information

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* ( 2016 2016 07 28 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF : 11011 N N 0 N N 11 1001 N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) 1100100 (2) 1111011 (3) 1110010 (4) 1001011

More information

ohp07.dvi

ohp07.dvi 17 7 (2) 2017.9.13 1 BNF BNF ( ) ( ) 0 ( ) + 1 ( ) ( ) [ ] BNF BNF BNF prog ::= ( stat ) stat ::= ident = expr ; read ident ; print expr ; if ( expr ) stat while ( expr ) stat { prog expr ::= term ( +

More information

listings-ext

listings-ext (6) Python (2) ( ) ohsaki@kwansei.ac.jp 5 Python (2) 1 5.1 (statement)........................... 1 5.2 (scope)......................... 11 5.3 (subroutine).................... 14 5 Python (2) Python 5.1

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2017 2017 08 03 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF X [ S ] a S S ; X X X, S [, a, ], ; BNF X (parse tree) (1) [a;a] (2) [[a]] (3) [a;[a]] (4) [[a];a] : [a] X 2 222222

More information

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) +

More information

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp 3 Haskell Haskell Haskell 1. 2. 3. 4. 5. 1. 2. 3. 4. 5. 6. C Java 3.1 Haskell Haskell GHC (Glasgow Haskell Compiler 1 ) GHC Haskell GHC http://www.haskell. 1 Guarded Horn Clauses III - 1 org/ghc/ Windows

More information

Microsoft PowerPoint - Compiler06note.pptx

Microsoft PowerPoint - Compiler06note.pptx コンパイラ 第 6 回構文解析 構文解析プログラムの作成 http://www.info.kindai.ac.jp/compiler 38 号館 4 階 N-411 内線 5459 takasi-i@info.kindai.ac.jp コンパイラの構造 字句解析系 構文解析系 制約検査系 中間コード生成系 最適化系 目的コード生成系 処理の流れ情報システムプロジェクト I の場合 output (ab);

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool VDM-SL VDM++ 23 6 28 VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web 2 1 3 1.1............................................... 3 1.1.1 bool......................................... 3 1.1.2 real rat int

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

More information

Dive into Algebraic Effects

Dive into Algebraic Effects Dive into Algebraic Effects びしょ じょ ML Days #2 September 16, 2018 やること Algebraic Effects を伝道 Algebraic Effects is 何 Algebraic Effects が使える言語 Algebraic Effects の活用事例 研究のご紹介先日 JSSST でポスター発表した内容を紹介シマス 目次 自己紹介

More information

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C 1 6 9 1 main main 1 NULL NULL 1 15 23 25 48 26 30 32 36 38 43 45 47 50 52 for 2 (a) 2 2 1 Yacc 2 (b) 2 3 yytext tmp2 ("") tmp2->next->word tmp2 yytext tmp2->next->word

More information

Microsoft PowerPoint - 04SyntaxAnalysis.ppt [互換モード]

Microsoft PowerPoint - 04SyntaxAnalysis.ppt [互換モード] 字句解析と構文解析 コンパイラ理論 4 構文解析導入 字句解析 トークンの提供 トークンの要求 構文解析 櫻井彰人 記号表 次の コンパイラ理論 5 も続けて行います なぜ分けるか? 字句解析を構文解析から分ける理由 : 設計が単純になる 効率 ( 速度等 ) の向上が図れる 可搬性がます 字句解析 構文解析それぞれによいツールが存在する トークン 字句 パターン (Tokens, Lexemes,

More information

Microsoft PowerPoint - Compiler06.pptx

Microsoft PowerPoint - Compiler06.pptx コンパイラ 第 6 回構文解析 構文解析プログラムの作成 http://www.info.kindai.ac.jp/compiler 38 号館 4 階 N-411 内線 5459 takasi-i@info.kindai.ac.jp コンパイラの構造 字句解析系 構文解析系 制約検査系 中間コード生成系 最適化系 目的コード生成系 処理の流れ 情報システムプロジェクト I の場合 output (ab);

More information

連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines "" = [] lines s = let (l,s'

連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines  = [] lines s = let (l,s' 連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) nobsun@sampou.org 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines "" = [] lines s = let (l,s') = break ('\n'==) s in l : case s' of [] -> [] (_:s'')

More information

(ver. 1.3 (2018) ) yacc 1 1 yacc yacc (Yet Another Compiler Compiler) UNIX yacc yacc y *.y yacc ) yacc *.tab.h *.tab.c C C yacc yacc UNIX yacc bison 2

(ver. 1.3 (2018) ) yacc 1 1 yacc yacc (Yet Another Compiler Compiler) UNIX yacc yacc y *.y yacc ) yacc *.tab.h *.tab.c C C yacc yacc UNIX yacc bison 2 (ver. 1.3 (2018) ) yacc 1 1 yacc yacc (Yet Another Compiler Compiler) UNIX yacc yacc y *.y yacc ) yacc *.tab.h *.tab.c C C yacc yacc UNIX yacc bison 2 yacc yacc lex %token yacc yacc token *.tab.h #define

More information

slide9.dvi

slide9.dvi - val a = Array.array(20,""); val a = [ "","","","","","","","","","",\ "","",... ] : string array - Array.update(a,5,"abc"); val it = () : unit - Array.sub(a,5); val it = "abc" : string 9-1 - Array.length(a);

More information

Int Int 29 print Int fmt tostring 2 2 [19] ML ML [19] ML Emacs Standard ML M M ::= x c λx.m M M let x = M in M end (M) x c λx.

Int Int 29 print Int fmt tostring 2 2 [19] ML ML [19] ML Emacs Standard ML M M ::= x c λx.m M M let x = M in M end (M) x c λx. 1, 2 1 m110057@shibaura-it.ac.jp 2 sasano@sic.shibaura-it.ac.jp Eclipse Visual Studio ML Standard ML Emacs 1 ( IDE ) IDE C C++ Java IDE IDE IDE IDE Eclipse Java IDE Java Standard ML 1 print (Int. 1 Int

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

yacc.dvi

yacc.dvi 2017 c 8 Yacc Mini-C C/C++, yacc, Mini-C, run,, Mini-C 81 Yacc Yacc, 1, 2 ( ), while ::= "while" "(" ")" while yacc 1: st while : lex KW WHILE lex LPAREN expression lex RPAREN statement 2: 3: $$ = new

More information

Copyright c 2008 Zhenjiang Hu, All Right Reserved.

Copyright c 2008 Zhenjiang Hu, All Right Reserved. 2008 10 27 Copyright c 2008 Zhenjiang Hu, All Right Reserved. (Bool) True False data Bool = False True Remark: not :: Bool Bool not False = True not True = False (Pattern matching) (Rewriting rules) not

More information

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B A/B (2018/10/19) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2018/soft/soft.html 2018 10 19 A/B 1 2018 10 19 2 1 1 1.1 OHP.................................... 1

More information

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D 6 2019 5 14 6.1 Minimum C....................... 6 1 6.2....................................... 6 7 6.1 Minimum C Minimum C BNF T okenseq W hite Any Digit ::= 0 1 2... 9. Number ::= Digit Digit. Alphabet

More information

「プログラミング言語」 SICP 第4章 ~超言語的抽象~ その6

「プログラミング言語」  SICP 第4章   ~超言語的抽象~   その6 SICP 4 6 igarashi@kuis.kyoto-u.ac.jp July 21, 2015 ( ) SICP 4 ( 6) July 21, 2015 1 / 30 4.3: Variations on a Scheme Non-deterministic Computing 4.3.1: amb 4.3.2: 4.3.3: amb ( ) SICP 4 ( 6) July 21, 2015

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

More information

parser.y 3. node.rb 4. CD-ROM

parser.y 3. node.rb 4. CD-ROM 1. 1 51 2. parser.y 3. node.rb 4. CD-ROM 1 10 2 i 0 i 10 " i i+1 3 for(i = 0; i

More information

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1 I117 II I117 PROGRAMMING PRACTICE II 2 MEMORY MANAGEMENT 2 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara yasu@jaist.ac.jp / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming

More information

5 IO Haskell return (>>=) Haskell Haskell Haskell 5.1 Util Util (Util: Tiny Imperative Language) 1 UtilErr, UtilST, UtilCont, Haskell C

5 IO Haskell return (>>=) Haskell Haskell Haskell 5.1 Util Util (Util: Tiny Imperative Language) 1 UtilErr, UtilST, UtilCont, Haskell C 5 IO Haskell return (>>=) Haskell Haskell Haskell 5.1 Util Util (Util: Tiny Imperative Language) 1 UtilErr, UtilST, UtilCont,... 5.1.1 5.1.2 Haskell C LR ( ) 1 (recursive acronym) PHP, GNU V - 1 5.1.1

More information

TEX American Mathematical Society PostScript Adobe Systems Incorporated

TEX American Mathematical Society PostScript Adobe Systems Incorporated P A D manual ( pad2ps 3.1j ) (seiichi@muraoka.info.waseda.ac.jp) 1996 11 2 TEX American Mathematical Society PostScript Adobe Systems Incorporated pad2ps PAD PAD (Problem Analysis Diagram) C 1 2 PAD PAD

More information

untitled

untitled Q 8 1 8.1 (C++) C++ cin cout 5 C++ 16 6 p.63 8.3 #include 7 showbase noshowbase showpoint noshowpoint 8.3 uppercase 16 nouppercase 16 setfill(int) setprecision(int) setw(int) setbase(int) dec

More information

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装 Ruby Scheme 2013-04-16 ( )! SICP *1 ;-) SchemeR SICP MIT * 1 Structure and Interpretaion of Computer Programs 2nd ed.: 2 i SchemeR Ruby Ruby Ruby Ruby & 3.0 Ruby ii https://github.com/ichusrlocalbin/scheme_in_ruby

More information

fp.gby

fp.gby 1 1 2 2 3 2 4 5 6 7 8 9 10 11 Haskell 12 13 Haskell 14 15 ( ) 16 ) 30 17 static 18 (IORef) 19 20 OK NG 21 Haskell (+) :: Num a => a -> a -> a sort :: Ord a => [a] -> [a] delete :: Eq a => a -> [a] -> [a]

More information

test.gby

test.gby Beautiful Programming Language and Beautiful Testing 1 Haskeller Haskeller 2 Haskeller (Doctest QuickCheck ) github 3 Haskeller 4 Haskell Platform 2011.4.0.0 Glasgow Haskell Compiler + 23 19 8 5 10 5 Q)

More information

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B 3 3.1 algebraic datatype data 1 2... k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] Bob String y Charlie Foo Double Integer Alice 3.14 [1,2],

More information

shift/reset [13] 2 shift / reset shift reset k call/cc reset shift k shift (...) k 1 + shift(fun k -> 2 * (k 3)) k 2 * (1 + 3) 8 reset shift reset (..

shift/reset [13] 2 shift / reset shift reset k call/cc reset shift k shift (...) k 1 + shift(fun k -> 2 * (k 3)) k 2 * (1 + 3) 8 reset shift reset (.. arisa@pllab.is.ocha.ac.jp asai@is.ocha.ac.jp shift / reset CPS shift / reset CPS CPS 1 [3, 5] goto try/catch raise call/cc [17] control/prompt [8], shift/reset [5] control/prompt, shift/reset call/cc (continuationpassing

More information

koba/class/soft-kiso/ 1 λ if λx.λy.y false 0 λ typed λ-calculus λ λ 1.1 λ λ, syntax τ (types) ::= b τ 1 τ 2 τ 1

koba/class/soft-kiso/ 1 λ if λx.λy.y false 0 λ typed λ-calculus λ λ 1.1 λ λ, syntax τ (types) ::= b τ 1 τ 2 τ 1 http://www.kb.ecei.tohoku.ac.jp/ koba/class/soft-kiso/ 1 λ if λx.λy.y false 0 λ typed λ-calculus λ λ 1.1 λ 1.1.1 λ, syntax τ (types) ::= b τ 1 τ 2 τ 1 τ 2 M (terms) ::= c τ x M 1 M 2 λx : τ.m (M 1,M 2

More information

B演習(言語処理系演習)第一回

B演習(言語処理系演習)第一回 B 演習 ( 言語処理系演習 ) 第 3 回 字句解析 田浦 今日の予定 字句解析インタフェース 今週の課題 字句の定義 字句解析器の仕組み ( 概要 ) 下請け部品 char_buf, char_stream, int_stack まめ知識 : デバッガ デバッグに関する若干の抽象論 字句解析器とは ) 字句解析器 (tokenizer) d e f f i b ( n ) : ( Identifier

More information

2005 D Pascal CASL ( ) Pascal C 3. A A Pascal TA TA TA

2005 D Pascal CASL ( ) Pascal C 3. A A Pascal TA TA TA 2005 D 1 1.1 1.2 Pascal CASL ( ) Pascal 1. 2005 10 13 2006 1 19 12 2. C 3. A A 2 1 2 Pascal 1.3 1. 2. TA TA TA sdate@ist.osaka-u.ac.jp nakamoto@image.med.osaka-u.ac.jp h-kido@ist.osaka-u.ac.jp m-nakata@ist.osaka-u.ac.jp

More information

HPB16_表1-表4.ai

HPB16_表1-表4.ai 03-5324-762406-6886-9300 03-5324-760806-6886-8218 03-5324-760606-6886-5035 http://just-hpb.jp/ Contents 4988637153787 4988637153794 4988637153930 4988637153947 41 4988637153800 4988637153848 4988637153954

More information

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

ML 演習 第 4 回

ML 演習 第 4 回 ML 演習第 4 回 おおいわ Mar 6, 2003 今回の内容 補足 Ocaml のモジュールシステム structure signature functor Ocaml コンパイラの利用 2 識別子について 利用可能文字 先頭文字 : A~Z, a~z, _ ( 小文字扱い ) 2 文字目以降 : A~Z, a~z, 0~9, _, 先頭の文字の case で 2 つに区別 小文字 : 変数,

More information

橡挿入法の実践

橡挿入法の実践 PAGE:1 7JFC1121 PAGE:2 7JFC1121 PAGE:3 7JFC1121 Kadai_1.pas program input_file;{7jfc1121 19 20 { type item = record id : integer; math : integer; english : integer; var wfile data flag id_no filename :

More information

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1 Java (9) 1 Lesson 7 2008-05-20 Java System.out.println() 1 Java API 1 Java Java 1 GUI 2 Java 3 1.1 5 3 1.0 10.0, 1.0, 0.5 5.0, 3.0, 0.3 4.0, 1.0, 0.6 1 2 4 3, ( 2 3 2 1.2 Java (stream) 4 1 a 5 (End of

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

「消える」金融、「創る」金融-2010年のリテール金融

「消える」金融、「創る」金融-2010年のリテール金融 2010 2010 CONTENTS 1 2 3 4 18 20066 1 2 19 20 20066 3 1 12 21 2 22 20066 3 4 23 1 1997 1997 1984 1893 1983 1980 2001 1990 1990 24 20066 1 260 26,418 213,597 239,416 1720062 25 2 3 26 20066 3 5 27 4 4 44

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

第10回 コーディングと統合(WWW用).PDF

第10回 コーディングと統合(WWW用).PDF 10 January 8, 2004 algorithm algorithm algorithm (unit testing) (integrated testing) (acceptance testing) Big-Bang (incremental development) (goto goto DO 50 I=1,COUNT IF (ERROR1) GO TO 60 IF (ERROR2)

More information

untitled

untitled C -1 - -2 - concept lecture keywords FILE, fopen, fclose, fscanf, fprintf, EOF, r w a, typedef gifts.dat Yt JZK-3 Jizake tsumeawase 45 BSP-15 Body soap set 3 BT-2 Bath towel set 25 TEA-2 Koutya

More information

「計算と論理」 Software Foundations その4

「計算と論理」  Software Foundations   その4 Software Foundations 4 cal17@fos.kuis.kyoto-u.ac.jp http://www.fos.kuis.kyoto-u.ac.jp/~igarashi/class/cal/ November 7, 2017 ( ) ( 4) November 7, 2017 1 / 51 Poly.v ( ) ( 4) November 7, 2017 2 / 51 : (

More information

Condition DAQ condition condition 2 3 XML key value

Condition DAQ condition condition 2 3 XML key value Condition DAQ condition 2009 6 10 2009 7 2 2009 7 3 2010 8 3 1 2 2 condition 2 3 XML key value 3 4 4 4.1............................. 5 4.2...................... 5 5 6 6 Makefile 7 7 9 7.1 Condition.h.............................

More information

第12回 モナドパーサ

第12回 モナドパーサ 1 関数型プログラミング 第 13 回モナドパーサ 萩野達也 hagino@sfc.keio.ac.jp Slide URL https://vu5.sfc.keio.ac.jp/slide/ 2 モナドパーサ モナドを使って構文解析を行ってみましょう. data Parser a = Parser (String -> Maybe (a, String)) 字句解析も構文解析の一部に含めてしまいます.

More information

lexex.dvi

lexex.dvi (2018, c ) http://istksckwanseiacjp/ ishiura/cpl/ 4 41 1 mini-c lexc,, 2 testlexc, lexc mini-c 1 ( ) mini-c ( ) (int, char, if, else, while, return 6 ) ( ) (+, -, *, /, %, &, =, ==,!=, >, >=,

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

1. A0 A B A0 A : A1,...,A5 B : B1,...,B 1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 3. 4. 5. A0 A, B Z Z m, n Z m n m, n A m, n B m=n (1) A, B (2) A B = A B = Z/ π : Z Z/ (3) A B Z/ (4) Z/ A, B (5) f : Z Z f(n) = n f = g π g : Z/ Z A, B (6)

More information

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル Instruction Manual Disk No. RE01 6th Edition: November 1999 (YK) All Rights Reserved, Copyright 1996 Yokogawa Electric Corporation 801234567 9 ABCDEF 1 2 3 4 1 2 3 4 1 2 3 4 1 2

More information

PL : pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc ( ) Visitor DepthFirstAdapter 1 (Depth

PL : pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc ( ) Visitor DepthFirstAdapter 1 (Depth PL0 2007 : 2007.05.29 pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc () Visitor DepthFirstAdapter 1 (Depth First traversal) ( ) (breadth first) 2 sablecc 1.2

More information

Terminal ocaml $ ocaml Objective Caml version # 1+2;;<ret> # 1+2;; - : int = 3 ;; OCaml <ret> - : int = 3 OC

Terminal ocaml $ ocaml Objective Caml version # 1+2;;<ret> # 1+2;; - : int = 3 ;; OCaml <ret> - : int = 3 OC Jacques Garrigue, 2013 8 8-9 OCaml 1 OCaml OCaml ML ML Haskell ML Haskell ML 70 Edinburgh LCF Robin Milner 1 Caml ML OCaml OCaml OCaml-Nagoya OCaml 2007 in OCaml 2007 (Computer Science Library 3) 2007

More information

Microsoft PowerPoint - Compiler05.pptx

Microsoft PowerPoint - Compiler05.pptx コンパイラ 第 5 回下降型構文解析 http://www.info.kindai.ac.jp/compiler 38 号館 4 階 N-411 内線 5459 takasi-i@info.kindai.ac.jp コンパイラの構造 字句解析系 構文解析系 制約検査系 中間コード生成系 最適化系 目的コード生成系 処理の流れ 情報システムプロジェクト I の場合 output (ab); 字句解析系

More information

haskell.gby

haskell.gby Haskell 1 2 3 Haskell ( ) 4 Haskell Lisper 5 Haskell = Haskell 6 Haskell Haskell... 7 qsort [8,2,5,1] [1,2,5,8] "Hello, " ++ "world!" "Hello, world!" 1 + 2 div 8 2 (+) 1 2 8 div 2 3 4 map even [1,2,3,4]

More information

() () (parse tree) ( (( ) * 50) ) ( ( NUM 10 + NUM 30 ) * NUM 50 ) ( * ) ( + ) NUM 50 NUM NUM (abstract syntax tree, AST) ( (( ) * 5

() () (parse tree) ( (( ) * 50) ) ( ( NUM 10 + NUM 30 ) * NUM 50 ) ( * ) ( + ) NUM 50 NUM NUM (abstract syntax tree, AST) ( (( ) * 5 3 lex yacc http://www.cs.info.mie-u.ac.jp/~toshi/lectures/compiler/ 2018 6 1 () () (parse tree) ( ((10 + 30) * 50) ) ( ( NUM 10 + NUM 30 ) * NUM 50 ) ( * ) ( + ) NUM 50 NUM NUM 10 30 (abstract syntax tree,

More information

新・明解Java入門

新・明解Java入門 537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,

More information

ohp03.dvi

ohp03.dvi 19 3 ( ) 2019.4.20 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void int main(int argc, char *argv[]) {... 2 (2) argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0

More information

Appendix A BASIC BASIC Beginner s All-purpose Symbolic Instruction Code FORTRAN COBOL C JAVA PASCAL (NEC N88-BASIC Windows BASIC (1) (2) ( ) BASIC BAS

Appendix A BASIC BASIC Beginner s All-purpose Symbolic Instruction Code FORTRAN COBOL C JAVA PASCAL (NEC N88-BASIC Windows BASIC (1) (2) ( ) BASIC BAS Appendix A BASIC BASIC Beginner s All-purpose Symbolic Instruction Code FORTRAN COBOL C JAVA PASCAL (NEC N88-BASIC Windows BASIC (1 (2 ( BASIC BASIC download TUTORIAL.PDF http://hp.vector.co.jp/authors/va008683/

More information

2009 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA

2009 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA 2009 D 1 1.1 1.2 Pascal CASL II ( ) Pascal 1. 2009 10 15 2010 1 29 16 2. C 3. A A 2 1 2 Pascal 1.3 1. 2. TA enshud@image.med.osaka-u.ac.jp TA enshu-d@image.med.osaka-u.ac.jp nakamoto@image.med.osaka-u.ac.jp

More information

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B A/B (2010/10/08) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2010/soft/soft.html 2010 10 8 A/B 1 2010 10 8 2 1 1 1.1 OHP.................................... 1 1.2.......................................

More information

1 # include < stdio.h> 2 # include < string.h> 3 4 int main (){ 5 char str [222]; 6 scanf ("%s", str ); 7 int n= strlen ( str ); 8 for ( int i=n -2; i

1 # include < stdio.h> 2 # include < string.h> 3 4 int main (){ 5 char str [222]; 6 scanf (%s, str ); 7 int n= strlen ( str ); 8 for ( int i=n -2; i ABC066 / ARC077 writer: nuip 2017 7 1 For International Readers: English editorial starts from page 8. A : ringring a + b b + c a + c a, b, c a + b + c 1 # include < stdio.h> 2 3 int main (){ 4 int a,

More information

PBASIC 2.5 PBASIC 2.5 $PBASIC directive PIN type New DEBUG control characters DEBUGIN Line continuation for comma-delimited lists IF THEN ELSE * SELEC

PBASIC 2.5 PBASIC 2.5 $PBASIC directive PIN type New DEBUG control characters DEBUGIN Line continuation for comma-delimited lists IF THEN ELSE * SELEC PBASIC 2.5 PBASIC 2.5 BASIC Stamp Editor / Development System Version 2.0 Beta Release 2 2.0 PBASIC BASIC StampR PBASIC PBASIC PBASIC 2.5 Parallax, Inc. PBASIC 2.5 PBASIC 2.5 support@microbot-ed.com 1

More information

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l C/C++ 2007 6 18 1 C STL(1) 2 1.1............................................... 2 1.2 stdio................................................ 3 1.3.......................................... 10 2 11 2.1 sizeof......................................

More information

2011 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA enshu-

2011 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA enshu- 2011 D 1 1.1 1.2 Pascal CASL II ( ) Pascal 1. 2011 10 6 2011 2 9 15 2. C 3. A A 2 1 2 Pascal 1.3 1. 2. TA enshud@fenrir.ics.es.osaka-u.ac.jp TA enshu-d@fenrir.ics.es.osaka-u.ac.jp higo@ist.osaka-u.ac.jp

More information

JEB Plugin 開発チュートリアル 第4回

JEB Plugin 開発チュートリアル 第4回 Japan Computer Emergency Response Team Coordination Center 電子署名者 : Japan Computer Emergency Response Team Coordination Center DN : c=jp, st=tokyo, l=chiyoda-ku, email=office@jpcert.or.jp, o=japan Computer

More information

Platypus-QM β ( )

Platypus-QM β ( ) Platypus-QM β (2012.11.12) 1 1 1.1...................................... 1 1.1.1...................................... 1 1.1.2................................... 1 1.1.3..........................................

More information

2.2 Sage I 11 factor Sage Sage exit quit 1 sage : exit 2 Exiting Sage ( CPU time 0m0.06s, Wall time 2m8.71 s). 2.2 Sage Python Sage 1. Sage.sage 2. sa

2.2 Sage I 11 factor Sage Sage exit quit 1 sage : exit 2 Exiting Sage ( CPU time 0m0.06s, Wall time 2m8.71 s). 2.2 Sage Python Sage 1. Sage.sage 2. sa I 2017 11 1 SageMath SageMath( Sage ) Sage Python Sage Python Sage Maxima Maxima Sage Sage Sage Linux, Mac, Windows *1 2 Sage Sage 4 1. ( sage CUI) 2. Sage ( sage.sage ) 3. Sage ( notebook() ) 4. Sage

More information

Microsoft Word - no15.docx

Microsoft Word - no15.docx ex33.c /* */ #define IDLENGTH 7 /* */ #define MAX 100 /* */ /* */ struct student char idnumber[idlength + 1]; /* */ int math; /* () */ int english; /* () */ int japanese; /* () */ double average; /* */

More information

AN 100: ISPを使用するためのガイドライン

AN 100: ISPを使用するためのガイドライン ISP AN 100: In-System Programmability Guidelines 1998 8 ver.1.01 Application Note 100 ISP Altera Corporation Page 1 A-AN-100-01.01/J VCCINT VCCINT VCCINT Page 2 Altera Corporation IEEE Std. 1149.1 TCK

More information

SML#³«È¯ºÇÁ°Àþ

SML#³«È¯ºÇÁ°Àþ SML# 2011 in Tokyo, 2011/09/17 1 / 34 SML# 2011 in Tokyo, 2011/09/17 1 / 34 SML# 2011 in Tokyo, 2011/09/17 1 / 34 SML# ML 1993 SML# of Kansai 2003 e-society JAIST 2006 SML# 0.10 2011 9 SML# 0.90 2 / 34

More information

PowerPoint Presentation

PowerPoint Presentation p.130 p.198 p.208 2 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i i < NUM; i++ ) ) if if ( weight[i] > max ) max = weight[i]: if if ( weight[i] < min ) min = weight[i]: weight

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

Microsoft PowerPoint - lectureNote6.ppt

Microsoft PowerPoint - lectureNote6.ppt i217 関 数 プログラミング 第 6 回 レコードと 組 二 木 厚 吉 緒 方 和 博 レコード(1) いくつかの 値 v 1,,v n をひとまとめにしたデータで, 各 値 v i には 互 いに 異 なるラベルl i が 割 当 てられる. {l 1 = v 1,,l n = v n } このレコードの 型 は, 各 viの 型 をt i とすると, {l 1 :t 1,,l n :t n

More information

untitled

untitled Fortran90 ( ) 17 12 29 1 Fortran90 Fortran90 FORTRAN77 Fortran90 1 Fortran90 module 1.1 Windows Windows UNIX Cygwin (http://www.cygwin.com) C\: Install Cygwin f77 emacs latex ps2eps dvips Fortran90 Intel

More information

6-1

6-1 6-1 (data type) 6-2 6-3 ML, Haskell, Scala Lisp, Prolog (setq x 123) (+ x 456) (setq x "abc") (+ x 456) ; 6-4 ( ) subtype INDEX is INTEGER range -10..10; type DAY is (MON, TUE, WED, THU, FRI, SAT, SUN);

More information

橡ソート手順比較

橡ソート手順比較 PAGE:1 [Page] 20 1 20 20 QuickSort 21 QuickSort 21 21 22 QuickSort 22 QuickSort 22 23 0 23 QuickSort 23 QuickSort 24 Order 25 25 26 26 7 26 QuickSort 27 PAGE:2 PAGE:3 program sort; { { type item = record

More information