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

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

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


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

untitled

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

untitled

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal

コンピュータ概論

compiler-text.dvi

r02.dvi

main.dvi

コンピュータ概論

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

K227 Java 2

unix15-script2_09.key

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


1 シミュレーションとは何か?

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

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 初版 1 刷発行時のものです.

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë

基礎情報処理 I (文字型)

syspro-0405.ppt

f(x) x S (optimal solution) f(x ) (optimal value) f(x) (1) 3 GLPK glpsol -m -d -m glpsol -h -m -d -o -y --simplex ( ) --interior --min --max --check -

ex01.dvi

untitled

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) * *

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£²¡Ë

n 第1章 章立ての部分は、書式(PC入門大見出し)を使います

Excel Excel Excel = Excel ( ) 1

PowerPoint プレゼンテーション

num2.dvi

B 5 (2) VBA R / B 5 ( ) / 34

アセンブラ入門(CASL II) 第3版

~~~~~~~~~~~~~~~~~~ wait Call CPU time 1, latch: library cache 7, latch: library cache lock 4, job scheduler co

p...{..P01-48(TF)

if clear = 1 then Q <= " "; elsif we = 1 then Q <= D; end rtl; regs.vhdl clk 0 1 rst clear we Write Enable we 1 we 0 if clk 1 Q if rst =

BASICとVisual Basic

2 1/2 1/4 x 1 x 2 x 1, x 2 9 3x 1 + 2x 2 9 (1.1) 1/3 RDA 1 15 x /4 RDA 1 6 x /6 1 x 1 3 x 2 15 x (1.2) (1.3) (1.4) 1 2 (1.5) x 1

StateMachine Composite Structure Sequence

L N P Y F C T V W Z I X Pentomino Form Name Caption Position FormMain podesktopcenter

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

橡点検記録(集約).PDF

橡Pascal-Tの挙動を調べる

CM-3G 周辺モジュール拡張技術文書 INA226センサ(電流、電圧、電力)

Excel Excel Excel = Excel III 7 ( ) 1

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

tuat1.dvi

離散数学 第 1回 論理 (1):命題論理

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

programmingII2019-v01

JavaScript 1.! DOM Ajax Shelley Powers,, JavaScript David Flanagan, JavaScript 2


1 I EViews View Proc Freeze

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë

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

FAX780TA_chap-first.fm

PowerPoint -O80_REP.PDF

3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200,

My関数の作成演習問題集

For_Beginners_CAPL.indd

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

Transcription:

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 higo@ist.osaka-u.ac.jp TA kz-miymt@ist.osaka-u.ac.jp t-kanemt@ist.osaka-u.ac.jp m-nisino@ist.osaka-u.ac.jp s-yamada@ist.osaka-u.ac.jp 1

3. ( )@exp.ics.es.osaka-u.ac.jp 4. A 5. (EnshuD-toolkit-2009.tgz) 2009 D ( http://www.image.med.osaka-u.ac.jp/member/nakamoto/enshud2009/index.html ) %cd ~ %tar xvfz EnshuD-toolkit-2009.tgz EnshuD 6. PATH ~/EnshuD/bin C PATH.cshrc set ( ) set PATH =( ~/EnshuD/bin /usr/ucb /usr/bin /bin /usr/bin/x11.) 7. SPC (read permission) (execute permission) SPC 8. ( chmod 700 directory ) 9. yacc CASLII D 1 1.4 (PDF ) 1 /home/exp/exppub/expd/report2009/1st/ 2 /home/exp/exppub/expd/report2009/2nd/ /home/exp/exppub/expd/report2009/final/ 2

( ) 4 ( ) ) 1001 NAKAMOTO Masahiko.pdf 444( ) 1.5 1. 60 2. 3 ( 0.5 ) 3. 1.6 1 10/15( ) 3,4 2 10/22( ) 3,4 3 10/29( ) 3,4 4 11/5( ) 3,4 1 11/11( ) 18:00 5 11/12( ) 3,4 6 11/19( ) 3,4 7 11/26( ) 3,4 8 12/3( ) 3,4 9 12/10( ) 3,4 2 12/16( ) 18:00 10 12/17( ) 3,4 11 1/7( ) 3,4 12 1/14( ) 3,4 13 1/21( ) 3,4 14 1/22( ) 4 15 1/28( ) 3,4 16 1/29( ) 4 2/4( ) 18:00 3

2 1 Pascal 2.1 Pascal Pascal scanner( 3) Pascal OK NG parser %parser filename.ts parser 1 parser Pascal ts parser parser (stderr) 2.2 Pascal Pascal Pascal Pascal 1. integer char, boolean (1 ) 2. if while if (begin end ) 3. (call-byvalue) 4. readln writeln 2 Pascal (Extended Backus-Naur Form (EBNF)) EBNF 1 ( ) (.) ( ) EBNF 0 { } (0 ) [ ] (0 1 ) (1 ) 4

2.3 scanner parser SYMBOL enum 1 3 1 1 parser OK NG -(Pascal )--------------- -(Pascal )--------------- { SAMPLE:OK } program coverage(output); var Sum, V : integer; { SAMPLE:NG } program coverage(output); var Sum, V : integer; procedure printdata; begin procedure printdata; Sum := 0;...... end. ------------------------------------ -( : )-------------- program SPROGRAM 17 2 coverage SIDENTIFIER 43 2 ( SLPAREN 33 2 output SIDENTIFIER 43 2 ) SRPAREN 34 2 ; SSEMICOLON 37 2 var SVAR 21 3 Sum SIDENTIFIER 43 3, SCOMMA 41 3 V SIDENTIFIER 43 3 : SCOLON 38 3 integer SINTEGER 11 3 ; SSEMICOLON 37 3 procedure SPROCEDURE 16 5 printdata SIDENTIFIER 43 5 ; SSEMICOLON 37 5 begin SBEGIN 2 6... end SEND 8 28. SDOT 42 28 ------------------------------------ -( : )-------------- OK ------------------------------------ end. ------------------------------------ -( : )-------------- program SPROGRAM 17 2 coverage SIDENTIFIER 43 2 ( SLPAREN 33 2 output SIDENTIFIER 43 2 ) SRPAREN 34 2 ; SSEMICOLON 37 2 var SVAR 21 3 Sum SIDENTIFIER 43 3, SCOMMA 41 3 V SIDENTIFIER 43 3 : SCOLON 38 3 integer SINTEGER 11 3 ; SSEMICOLON 37 3 procedure SPROCEDURE 16 5 printdata SIDENTIFIER 43 5 ; SSEMICOLON 37 5 Sum SIDENTIFIER 43 6 := SASSIGN 40 6 0 SCONSTANT 44 6 ; SSEMICOLON 37 6... end SEND 8 27. SDOT 42 27 ------------------------------------ -( )----------------------------- NG Line 6 ------------------------------------ 5

2.4 Pascal /EnshuD/testdata Pascal 001.pas 013.pas scanner 001.ts 013.ts /EnshuD/subtests new07: 9 integer char new08: 19 while integer boolean new10: 6 syntax new11: 19 a true test01: 49 syntax begin bigen test02: 35 po2 test03: 11 test04: 35 s test05: 10 test06: 16 smap test09: 8 test12: 21 if boolean test13: 21 dx test14: 46 syntax if begin 2.5 scanner C fscanf() ( ) 1 enum enum scanner lex scanner.l ( 3 ) 6

2.6 A4 5 SPC PARSE parser (chmod 600 ) 11 11 ( ) 18:00 7

3 2 Pascal 3.1 Pascal Pascal scanner( 3) checker %checker filename.ts checker 1 checker Pascal ts checker checker (stderr) 3.2 Pascal Pascal Pascal (call-by-value) Pascal 3.2.1 8 3.2.2 integer char boolean 3 integer -32767 32767 char ( ) boolean false( ) true( ) false<true 1 integer 8

3.2.3 boolean 3.2.4 integer 10 3.2.5 char ( ) ( ) 3.2.6 char ( ) ( ) 1 3.2.7 boolean boolean boolean true false 3.2.8 ( ) ( ) ( ) ( ) 1 3.2.9 9

3.2.10 1 ( + ) not integer not boolean 2 ( + / div mod ) ( and or ) ( = <> < <= > >= ) integer integer boolean boolean boolean Pascal / div 2 3.2.11 if while := readln writeln readln integer char char ( ) integer ( ) char 1 char 1 ( ) readln 1 writeln integer char char char ( char ) 1 writeln 3.2.12 10

( ) ( ) 3.2.13 program 3.2.14 1. 2. 3.3 1 OK Line 12: syntax error 1. (syntax error) 2. 3. 4. 11

5. 6. 7. 8. 9. 10. 11. integer 12. if while boolean 13. 3.4 TA ( ) SPC CHECK checker CHECK checker enshu-d@image.med.osaka-u.ac.jp TA TA Pascal /EnshuD/subtests 3.5 A4 5 SPC/CHECK (chmod 600 ) 12 16 ( ) 18:00 12

4 Pascal CASL II ( ) 4.1 Pascal Pascal scanner( 3) CASL II CASL II spc %spc filename.ts spc 1 spc Pascal ts spc CASL II cas filename.ts filename.cas ( ) UNIX checker spc 4.2 CASL II CASL II UNIX CASLII 30 4 START END DS DC 2 IN OUT 10 CASLII WRTINT, WRTCH, WRTSTR WRTLN MULT : GR1 GR2 GR2 DIV : GR2 / GR1 GR2, GR1 RDINT : (GR2) RDCH : (GR2) RDSTR : GR1 (GR2) RDLN : WRTINT : GR2 WRTCH : GR2 WRTSTR : (GR2) GR1 WRTLN : 13

4.2.1 GR6 GR7 GR6, GR7 GR6, GR7 4.2.2 A 4.3 CASL II spc CASL II COMET II %link.pl program.cas link.pl program.cas spc CASL II lib.cas link.pl lib.cas lib.cas program.cas CASL START BEGIN _OUTBUF DS 256 _BEGIN LAD GR6,0 LAD GR7,_OUTBUF CASL II pycasl2 %pycasl2 program.cas program.com program.com COMET II CASL II COMET II pycomet2 %pycomet2 program.com program.com CASL II COMET II 14

4.4 TA 1. 2010 1 14 2 4 2. /EnshuD/testdata TA ( 100% ) enshu-d@image.med.osaka-u.ac.jp TA 3. CASL II 4. SPC spc TA SPC spc SPC spc 0 5. TA 4.5 4.5.1 SPC (chmod 600 ) 4.5.2 20 15

1. 2. 3. 4. 5. (5 7) 6. 7. 5 6 ( 8. 9. 10. 11. 12. / (2009 ) (2009 ) 2 4 ( ) 18:00 16

1 SYMBOL enum SYMBOL { SAND, SARRAY, SBEGIN, SBOOLEAN, /* and array begin boolean */ SCHAR, SDIVD, /* char div / */ SDO, SELSE, SEND, /* do else end */ SFALSE, /* false */ SIF, SINTEGER, SMOD, SNOT, /* if integer mod not */ SOF, SOR, SPROCEDURE, SPROGRAM, /* of or procedure program */ SREADLN, STHEN, /* readln then */ STRUE, SVAR, /* true var */ SWHILE, SWRITELN, SEQUAL, SNOTEQUAL, /* while writeln = <> */ SLESS, SLESSEQUAL, SGREATEQUAL, SGREAT, /* < <= >= > */ SPLUS, SMINUS, SSTAR, SLPAREN, /* + - * ( */ SRPAREN, SLBRACKET, SRBRACKET, SSEMICOLON, /* ) [ ] ; */ SCOLON, SRANGE, SASSIGN, SCOMMA, /* :.. :=, */ SDOT, SIDENTIFIER, SCONSTANT, SSTRING, /*. */ SLBRACE, SRBRACE, SSQUOTE, SPARA, /* { } */ SDIGIT, SALPHA, SEOF, SNULL, /* */ 17

SERR /* */ }; /* */ /* */ /* */ /* SERR, SALPHA, SDIGIT, SLBRACE, SRBRACE, SSQUOTE */ /* SNULL */ /* SPARA */ /* */ /* */ 18

2 EBNF Pascal = program ( ) ;.. =. = {, }. =. = [ var ]. = : ; { : ; }. = {, }. =. =. = integer char boolean. = array [.. ] of. =. =. = [ ]. = + -. = { ; }. =. = procedure ;. =. = [ ( ) ]. = : { ; : }. = {, }. =. = begin end. = { ; }. = if then else if then while do. =. = :=. =. 19

=. =. = [ ]. =. = [ ( ) ]. = {, }. = [ ]. = [ ] { }. = { }. = ( ) not. = = <> < <= > >=. = + or. = / div mod and. = + -. = readln [ ( ) ] writeln [ ( ) ]. = {, }. = false true. = { }. = { }. = ( ) ( ). = { }. = a b z A B Z. = 0 1 9. 20

3 scanner 1. lex scanner.l scanner_src lex, cc lex lex C %cd ~/EnshuD/scanner_src %lex scanner.l %cc -o scanner lex.yy.c -ll %mv scanner../bin (-ll lex ) ( ~/EnshuD/bin ) scanner.l enum 2. Pascal (1) (2) SYMBOL (3)enum 1 (4) 1 1 3. %scanner filename.pas scanner 1 scanner Pascal pas scanner ts 4. Pascal Pascal 1 SYMBOL SYMBOL = + / = <> < <= > >= ( ) [ ] :=.,.. : ;. 21

= program var array of procedure begin end if then else while do not or div mod and char integer boolean readln writeln true false. = { }. = a b z A B Z. = 0 1 9. = { }. = { }. = ( ) ( ). char integer boolean readln writeln true false = { { } }. = }. 2 2 1 5. 1 22

TA ( ) TA -? -? TA -? -? ( ) Subject ( ) TA - - [ ] Subject: D From: xxxxx@exp.ics.es.osaka-u.ac.jp To: enshu-d@image.med.osaka-u.ac.jp Cc: xxxxx@exp.ics.es.osaka-u.ac.jp [ ] : : xxxx xxxx : 90xxxxxx /home/exp/exp0/xxxxxx/( ) % ( ) 23