Mercurial > hg > Members > nobuyasu > myCompiler
comparison Bison-Flex/BasicCompiler-StackBase/script-parser.yy @ 2:fbe42292d479
upload test
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 10 May 2011 06:43:55 +0900 |
parents | a3ea4c73696b |
children |
comparison
equal
deleted
inserted
replaced
1:a3ea4c73696b | 2:fbe42292d479 |
---|---|
16 %lex-param { compiler& driver } | 16 %lex-param { compiler& driver } |
17 %locations | 17 %locations |
18 //%expect 7 | 18 //%expect 7 |
19 %initial-action | 19 %initial-action |
20 { | 20 { |
21 // ロケーション初期化 | 21 // P[V |
22 @$.begin.filename = @$.end.filename = &driver.get_filename(); | 22 @$.begin.filename = @$.end.filename = &driver.get_filename(); |
23 }; | 23 }; |
24 // %debug | 24 // %debug |
25 %error-verbose | 25 %error-verbose |
26 // Symbols. | 26 // Symbols. |
96 | "for" assign "to" expr { driver.ForStatement(@1, $2, $4, NULL); } | 96 | "for" assign "to" expr { driver.ForStatement(@1, $2, $4, NULL); } |
97 | "next" { driver.NextStatement(@1); } | 97 | "next" { driver.NextStatement(@1); } |
98 | "while" comp_expr { driver.WhileStatement(@1, $2); } | 98 | "while" comp_expr { driver.WhileStatement(@1, $2); } |
99 | "wend" { driver.WendStatement(@1); } | 99 | "wend" { driver.WendStatement(@1); } |
100 | "print" args { driver.PrintStatement(@1, $2); } | 100 | "print" args { driver.PrintStatement(@1, $2); } |
101 | error /* エラーの場合 */ | 101 | error /* G[̏ꍇ */ |
102 ; | 102 ; |
103 | 103 |
104 assign : value '=' expr { $$ = new CAssign(@1, '=', $1, $3); } | 104 assign : value '=' expr { $$ = new CAssign(@1, '=', $1, $3); } |
105 ; | 105 ; |
106 | 106 |