• 沒有找到結果。

整合產生式與組裝式技術建構以流程為本之工具

N/A
N/A
Protected

Academic year: 2021

Share "整合產生式與組裝式技術建構以流程為本之工具"

Copied!
4
0
0

加載中.... (立即查看全文)

全文

(1)

 

Integrating Generative and Composite Techniques to Construct

Flow-based Tools

: 88-2213-E-009-015 : 87 5 1  88 7 31 :  :   !"#$: fjwang@csie.nctu.edu.tw %&'()* +*,-./(0[1] (Attribute Grammars – AGs) 12#345678 9:;< = >? @AB CD E FG56789H,-I=J@KL>1 MN>>89HOPG,-HQHRS TU./(0VWXYZ[H\/,=] 2#34 89 R^_ `a' WS b GUIcJHdeG+'UfghH ij MVS[3] (Model-View-Shape)> k 1 . / ( 0 H l m OOAG (Object-Oriented AG)[5][6] ,-nopq rsHd e: <t= ?@ AB C FGuQh@vnwxUfy,-89< tz6{>?|}F=]%{> ~€G>?|}FIE><t ‚ƒf^„…H†>XY>?‡ˆ ‰I=Š‹ OOAG ŒŽ|}>V HŒnR>H‘’“'n”h•– zIŒH—˜™š›œG

žŸ : program generator, attribute grammar, program analysis, flow-based tools

Abstract

The project presents an approach to construct language-based tools by

combining attribute grammars and object-oriented technology. The combination of AGs and OO exemplifies the integration of generative and compositional programming techniques. The approach, called OOAG, is presented to effectively construct language-based tools that deal with fine-grained language semantics as well as a mass of graphics-drawing activities. It consists of two inter-related parts: a model-view-shape class framework and an AG++, an object-oriented extension to traditional AGs, is intended to preserve both advantages introduced by respective OO and AG models, such as rapid prototyping, reusability, extensibility, incrementality, and applicability. So far, a flow-based editor associated with two flow-analyzer prototypes, DU/UD tools and a program slicer, have been implemented using OOAG on Windows programming environment. The flow-based editor can be used to construct programs by specifying the associated flow information in a visual way, while (incremental) flow analyzers incorporated into the editor can help analyze incomplete program fragments to

(2)

2

locate and inform the user of possible errors or anomalies during programming.

¡&¢‹1QH R£¤<tH“¥'n¦§››¨f© ª«¬:XY£¤H@\/G­®Rb ¯°n¦§±fr>r²H?«n® ³´?&µ?n¶·¸¹«n=] E-R «ºn=»¼r7½4 (facet) :¬ ¾>¿HGUf5À«¬Hde C%ÁI=ÂE¦§ÃÄoÅƜÇH £¤nˆ‰yde±ÈÉ^„…FH iʈËÌG ͈n¼ÎÏÐ%Ñ=?@+HF[2] Á%ÒÓ¥ÔՈ֐H×ØGÙyÏÚ 5ÛFÜÝD=%ÑqÞH†0ßnà y†0ߌ=qáH†>Ìâ<tH “nˆ‰Œ=ã-äHi+;<zyÛ FGåæCçn*¾iyQèoéV Wnꦧ<œ5ÛFëqÛìH\ eníÁ5ÀF(1)ëÁîï(0ð57 µñڎ>\/H|}nòÕ(2) óñjôœu^_õG îï\e%n¦§IUfö¯÷øZù: XY(0ðHµñÚúän=](0ð õHZ[|}GS\e¡n‹Sh6 H û ü ñ j ý Á % Ñ = MVS (Model-View-Shape) þÚ@ABb zH flow-based FnyþÚ›-+ Hûü'\e¡HG n¼“ flow-based FH<tx On Z[|}†½H>Uf á 0‘’nˆéUf÷øKL>n± i>éVWÄ1ÅÆHGÙ Á%{Z[|}HJ›Z0ð õª7éò·Hen‰|}Hµ ›SHeni%{Z[ |}JH>*|’Rr{ C++ ZùHÛ†0 (class methods)  nrs ÐHZ[|}Jní>Å ÆH!e:æn"#rsi%$MnêQ hH0%±ó+:"#rs ÐH >&Rò%{ C++ ۏn”öÃÅ ÆH'(GÙy¦§)*+Ž./(0 ÷øZù:,-g=.’H C++ Z [|}>n=/:sKL>H0 únÙ@./(0÷øI=órs ÐHZ [| }J ’Ré òH $M n=1/:VWÄ1ÅÆH0úG 2ùCn+ûüHQHRS3  RÏÚ flow-based FH“'nà Z[|}JH>I=Š‹ >sKLG  RÏÚ flow-based FH“'nq ž^_ O4|H5ŒnI=6“ MVS ”7H>k1$¾iG  6“÷øZùXY flow-based F H>89n=Ä:=; flow-based FH>89<=Ä1ÅÆH G =&ñj1>ß R+Hûü“'n¦§wx?@à ®AòÕUf,->1MN>89:Ï Ú=>?@ABH><tFG2# 3489R>Bƒf=]«C…D½ tœzEdFH\/G./(0R>Z ùHZ[ XY =] >s K L† ½nqEG÷/1Ž>(incremental)| }H0úG Rûü“'n¦§ƒf2#3489: XY./(0Z0ð¥'HenoR. /(0HZ0ð'H©b‚¨f IeÇ,(remote access)H5Œ:XY Z[‡oH©FqòÛ\JH./K' (aggregate)L:nòՎZ[|}H MG5Àîï./(0HNOn2…ÃZ [XY‚HXYJnàZ[PYQR2

(3)

3 S ‡ ò Õ 1 ” T à Z [ | } d … (optimization)HIŒ/G S MVS ^„…>kn‹SUwxó >?FH UI cJVNi2#3 4 H C > ‡ R 1 2 # 3 4 . / ( 0 (OOAG),-HÕWn OEöHþÚ ÓV/1Bƒf/G «%OHFÁ%{QX define-use H|}Fnîï a=c 5{PYn6“

OOAGHZ[XYnI=Yz use a HP

YnZý e>f&e=a&d=a+e&f=a ºPYn o‰6“ MVS H>knó5ÀPY Óï"HeèO(highlight)z:G «%&KLH DU FCP­[½ «¡OHFÁ%{2WH>~ €nîï a = b PYŽG4(forward)H >~n‹ OOAG HZ[÷øXY (\]^_)nó a > 1&c = a&a = a+1 º ¨fuQX a HPYYz:no‰‹ MVS >kó5ÀPYï"He èO(highlight)z:G «¡&KLH>~€P­[½ `&ij1sa + HijwxbiÃ,->1 KL>5 67 >8 9,- Hc de fno‰gEfSKL=?@ABC >FG yûühÃ÷zy6789,-Õ H£¤þÚ1biCno‰=2 H­!OP®A¨fy,-89G¤ õnûüñj1gbjHkbÓl-n ¼ñj1>ß'OHP­n¦§I=R mKL>1,->67>89I=, -L:nKL=>?@ABH>DE FG + C4|ûüij[4][7][8]w< ¬SӞnoC±p1qG r&\s(t

1. Alblas H., “Introduction to Attribute Grammars,” in Lecture Notes in Computer Science - Attribute Grammars, Applications and Systems, Alblas, H. and Melichar, B. (eds.), Springer-Verlag, 1991, pp. 1-15

2. Arefi, F. et al., “Automatically generating visual syntax-directed editors,” Communications of the ACM, Vol. 33, No. 3, March 1990, pp. 349-360.

(4)

4

“Constructing flow-based editors with a model-view-shape architecture,” Proceedings of the International Computer Symposium (ICS’96), Taiwan, 1996, pp. 391-397.

4. Hu, C.-H. And Wang, F.-J., “Constructing an Integrated Visual

Programming Environment,” Software – Practice and Experience,

1998.

5. Wu, P. C., Wang, F. J., and Yang J. T., “A Semantic Specification Language for Compiler Construction,” The Proceedings of the National Science Council, Vol. 20, No. 1, pp. 23—41, 1996

6. Yang, J. -T. And Wang. F. -J., “A Specification Language for Compiler

Construction Based on Attribute

Grammar,” Proceedings of the

International Computer Symposium (ICS ’96), Taiwan, pp.398-405.

7. Yang, J.-T., Hu, C.-H., Wang, F.-J., and Chu, C.-C. William, “Constructing a Toolset for Software Maintenance with

OOAG,” Asia Pacific Software

Engineering Conference, December 1998.

8. Yang, J.-T., Hu, C.-H., Wang, F.-J., and Chu, C.-C. William, "Constructing Flow-Based Tools with Generative and Compositional Techniques," accepted by International Journal of Software Engineering and Knowledge Engineering.

Appendix: ¨f OOAG :‘’>~€ (uvzr class H prototype wx4|)

%SEMANTICS

CLASS Statement-List INHERIT Tree-Node PROTOCOL

VOID GetBranchExpressionsBackwardUp(Tree-Node* from, NODELIST_REF marked_nodes) { ... } VOID GetBranchExpressionsBackwardDown(Tree-Node* from, NODELIST_REF marked_nodes) { ... }; END

//--- CLASS Expression INHERIT Tree-Node PROTOCOL

VOID ComputeBackwardSlice(STRING var_name, NODELIST_REF marked_nodes) { ... }

VOID GetBranchExpressionsBackwardUp(Tree-Node* from, NODELIST_REF marked_nodes) { ... }; END

//--- CLASS Assignment-Stmnt INHERIT Statement PROTOCOL

VOID ComputeForwardSlice(STRING var_name, NODELIST_REF marked_nodes) { ... }

VOID ComputeBackwardSlice(String variableName, StatementModel *pFrom, ModelList *pMarkedModels) { ... } VOID GetBranchExpressionsBackwardUp(STRING var_name, NODELIST_REF marked_nodes) { ... }

END

//--- CLASS If-Then-Else-Stmnt INHERIT Statement PROTOCOL

VOID GetBranchExpressionsBackwardUp(Tree-Node* from, NODELIST_REF marked_nodes) { ... } VOID GetBranchExpressionsBackwardDown(Tree-Node* from, NODELIST_REF marked_nodes) { ... } END

//--- CLASS While-Stmnt INHERIT Statement PROTOCOL

VOID GetBranchExpressionsBackwardUp(Tree-Node* from, NODELIST_REF marked_nodes) { ... } VOID GetBranchExpressionsBackwardDown(Tree-Node* from, NODELIST_REF marked_nodes) { ... } END

//---

CLASS Function, Compound-Stmnt, If-Then-Stmnt, Do-Stmnt, Statement, … ……

參考文獻

相關文件

Wallace (1989), &#34;National price levels, purchasing power parity, and cointegration: a test of four high inflation economics,&#34; Journal of International Money and Finance,

Wolfgang, &#34;The Virtual Device: Expanding Wireless Communication Services through Service Discovery and Session Mobility&#34;, IEEE International Conference on

(1999), &#34;Mining Association Rules with Multiple Minimum Supports,&#34; Proceedings of ACMSIGKDD International Conference on Knowledge Discovery and Data Mining, San Diego,

C., &#34;Prediction of pollutant emission through electricity consumption by the hotel industry in Hong Kong&#34;, International Journal of Hospitality Management..

Li, “Concurrent engineering: a strategy for procuring construction projects,” International Journal of Project Management, Vol. Towill and D.R., “Time compression and supply chain

(2004), &#34;Waiting Strategies for the Dynamic Pickup and Delivery Problem with Time Window&#34;, Transportation Research Part B, Vol. Odoni (1995),&#34;Stochastic and Dynamic

and Liu, S.J., “Quantifying Benefits of Knowledge Management System: A Case Study of an Engineering Consulting Firm,” Proceedings of International Symposium on Automation and

development of AutoLISP programming language for building and into Knowledge Engineering (Knowledge Based Engineering, KBE) technology, the ball screw and linear guideway the use