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

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

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


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

compiler-text.dvi

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal

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

コンピュータ概論

コンピュータ概論

r02.dvi

untitled

untitled

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

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

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

main.dvi

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 -


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

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

橡Pascal-Tの挙動を調べる

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

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

PowerPoint プレゼンテーション

unix15-script2_09.key

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

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

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

double float

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

K227 Java 2

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 =

Excel Excel Excel = Excel ( ) 1

tuat1.dvi

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

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

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

BASICとVisual Basic

syspro-0405.ppt

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

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

Microsoft Word - Win-Outlook.docx

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

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

橡点検記録(集約).PDF

For_Beginners_CAPL.indd

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

Excel Excel Excel = Excel III 7 ( ) 1

num2.dvi


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

untitled

Compatibility list: vTESTstudio/CANoe

PowerRDBconnector説明書(SQLServer編)

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

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

Gray [6] cross tabulation CUBE, ROLL UP Johnson [7] pivoting SQL 3. SuperSQL SuperSQL SuperSQL SQL [1] [2] SQL SELECT GENERATE <media> <TFE> GENER- AT

IP L09( Tue) : Time-stamp: Tue 14:52 JST hig TCP/IP. IP,,,. ( ) L09 IP (2017) 1 / 28

Transcription:

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 fuhongye@ist.osaka-u.ac.jp s-miyake@ist.osaka-u.ac.jp 1

3. A 4. (EnshuD-toolkit-2005.tgz) 2005 D ( http://www.image.med.osaka-u.ac.jp/member/nakamoto/enshud2005/index.html ) % cd ~ % tar xvfz EnshuD-toolkit-2005.tgz EnshuD 5. PATH ~/EnshuD/bin C PATH.cshrc set ( ) set PATH =( ~/EnshuD/bin /usr/ucb /usr/bin /bin /usr/bin/x11.) 6. SPC (read permission) SPC 7. ( chmod 700 directory ) 1.4 (PDF ) A A-han B B-han 1 /home/suita/med/staff/k623144n/enshud2005/report/1st/ 2 /home/suita/med/staff/k623144n/enshud2005/report/2nd/ /home/suita/med/staff/k623144n/enshud2005/report/final/ ( ) 4 ( ) ) 1001 TADA Harumasa.pdf 444( ) 2

1.5 1 10/13( ) 2 10/20( ) 3 10/27( ) 4 11/10( ) 1 11/16( ) 5 11/17( ) 6 11/24( ) 7 12/1( ) 2 12/7( ) 8 12/8( ) 9 12/15( ) 10 12/22( ) 11 1/12( ) 12 1/19( ) 1/31( ) 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 2.5 scanner C fscanf() ( ) 1 enum enum scanner lex scanner.l ( 3 ) 2.6 A4 5 SPC PARSE parser (chmod 600 ) 11 16 ( ) 6 6

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 7

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 8

3.2.10 1 ( + ) not integer not boolean 2 ( + / div mod ) ( and or ) ( = <> < <= > >= ) integer boolean integer 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 9

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

5. 6. 7. 8. 9. 10. 11. integer 12. if while boolean 13. 3.4 TA ( ) SPC CHECK checker TA SPC tar TA TA Pascal /EnshuD/subtests 3.5 A4 5 SPC/CHECK (chmod 600 ) 12 7 ( ) 6 11

4 Pascal CASL ( ) 4.1 Pascal Pascal scanner( 3) CASL CASL spc %spc filename.ts spc 1 spc Pascal ts spc CASL imd ( ) UNIX checker spc 4.2 CASL CASL 4 CASL UNIX CASL 23 4 1.2 4 START END DS DC 3 IN OUT EXIT 3 1. OUTINT adr adr 2. MUL GR, adr (GR) (adr) GR 3. DIV GR, adr (GR) (adr) GR 0 12 GR3 GR4 CASL WRTINT, WRTCH, WRTSTR WRTLN 12

MULT : GR1 GR2 GR2 DIVD : GR2 DIV GR1 GR2 MOD : GR2 MOD GR1 GR2 RDINT : (GR2) RDCH : (GR2) RDSTR : ( GR1) (GR2) RDLN : WRTINT : GR2 WRTCH : GR2 WRTSTR : (GR2) GR1 WRTLN : ERRSTP : ( ) 4.3 CASL spc CASL CASL 4.2. 12 CASL CASL 4 casl %casl filename.imd casl 1 casl CASL imd casl CASL UNIX UNIX casl CASL (syntax error) CASL (run time error) syntax error in line run time error in address xxxx casl link %link filename.imd link 1 link CASL imd link CASL 13

4.4 TA 1. 2006 1 12 1 31 2. /EnshuD/testdata TA ( 100% ) TA 3. CASL 4. SPC spc TA SPC spc SPC spc 0 SPC tar TA TA TA 5. TA 4.5 4.5.1 SPC (chmod 600 ) 14

4.5.2 20 1. 2. 3. 4. 5. (5 7) 6. 7. 5 6 ( 8. 9. 10. 11. 12. / (2005 ) (2005 ) 1 31 ( ) 6 15

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, /* */ 16

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

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

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

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 = + / = <> < <= > >= ( ) [ ] :=.,.. : ;. 20

= 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 4 CASL CASL Makefile %cd ~/EnshuD/casl_src %make %mv casl../bin ( ~/EnshuD/bin ) 4.3 21

TA ( ) TA -? -? TA -? -? ( ) TA -? -? Subject ( ) TA - - tar SPC tgz 4 %cd ~ %tar cvfz 1001_Nakamoto_Masahiko.tgz./SPC 22

[ ] Subject: D From: xxxxx@exp.ics.es.osaka-u.ac.jp To: yyyyy@ist.osaka-u.ac.jp Cc: xxxxx@exp.ics.es.osaka-u.ac.jp [ ] : : xxxx xxxx : 90xxxxxx /home/exp/exp0/xxxxxx/( ) ( ) 23