Eclipse外文翻译Word格式.docx
《Eclipse外文翻译Word格式.docx》由会员分享,可在线阅读,更多相关《Eclipse外文翻译Word格式.docx(9页珍藏版)》请在冰豆网上搜索。
![Eclipse外文翻译Word格式.docx](https://file1.bdocx.com/fileroot1/2023-1/7/9fd5139f-65f6-4cf5-870b-cac8a0aa86d4/9fd5139f-65f6-4cf5-870b-cac8a0aa86d41.gif)
A.T.KookierJanuary2004
Introduction
TheAsf+SdfMeta-EnvironmentareaninteractivedevelopmentenvironmentwithagraphicaluserinterfacewritteninJFC/Swing.AtypicalsessioninthisenvironmentresultsinanoverwhelmingamountofwindowspresentingtheMeta-Environmentitselfnexttolotsofeditorsalltryingtocatchtheattentionoftheuser.AlthoughthedescribedsceneisalittlebitexaggeratedtheseveralopenwindowsandJFC/SwinggraphicaluserinterfacewerethereasonstotakealookintoEclipse.
Eclipseisaframeworkforcreatingprogrammingenvironments,whereforecurrentlyversionsareavailableforC/C++,javaandcobol.Eachversionaddressesaspecificprogramminglanguagewithitsownsetoftools,commandsandscreenlayout.BecauseEclipseisawelldevelopedenvironmenttheAsf+SdfMeta-EnvironmentcouldbenefitfromintegrationwithEclipse.Eclipseoffersthepossibilitytomakeyourownperspective(whichisascreenlayout)consistingoftreeviews,editorsandotherkindofviewsallinoneplace.
EclipsesontheothersidecanbenefitfromtheintegrationwiththeMeta-Environment,becausetheMeta-EnvironmentbringsgenericlanguagetechnologytoEclipse.InsteadofdevelopingadevelopmentenvironmentforeachprogramminglanguageonedevelopmentenvironmentfortheMeta-EnvironmentisenoughtoprovidetoolsforeveryprogramminglanguagedevelopedintheMeta-Environment.
Eclipseisanopensourceframeworkforcreatingprogrammingenvironments.CurrentlyversionsexistforC/C++1,javaandCobol2.Newtoolsandlanguagescanbeaddedbywritingjavaapplicationsthatperformparsing,typecheckingandthelikeforanewlanguage.Eclipseprovidesarichsetoftoolsorientedtowarduser-interfaceconstructionandjavacompilation.Thelevelofautomationforbuildingenvironmentsfornewlanguagesis,however,low.
TheAsf+SdfMeta-Environmentareaprogrammingenvironmentsgenerator:
givenalanguagedefinitionconsistingofasyntaxdefinition(grammar)andtooldescriptions(usingrewriterules)alanguagespecificenvironmentisgenerated.Alanguagedefinitiontypicallyincludessuchfeaturesasprettyprinting,typechecking,analysis,transformationandexecutionofprogramsinthetargetlanguage.TheAsf+SdfMeta-Environmentareusedtocreatetoolsfordomain-specificlanguagesandfortheanalysisandtransformationofsoftwaresystems.AstheEclipseandMeta-Environmenttechnologiesaretoalargeextentcomplementary,itisworthwhiletoinvestigatehowtheycanbeintegrated.
EclipsePluginTechnology
TheEclipsePlatformisdesignedforbuildingintegrateddevelopmentenvironments.AnIDEcanbebuiltbyprovidingtheEclipsePlatformwithaplugincontributingtoanextensionpointofsomeotherplugin.InfacttheEclipsePlatformisanumberofplug-initself.Itconsistsofasmallkernelwhichstartsallnecessaryplug-intorunabasicinstanceoftheEclipsePlatform.Allotherfunctionalityislocatedinplug-inwhichextendthesebasicplug-in.InthiswayEclipseprovidestoolproviderswithamechanismthatleadstoseamlesslyintegratedtools.
EclipsespluginarewritteninjavaandconsistofamanifestfileandjavaclassesinaJARarchive.Themanifestfiledeclarestheextensionpointsofthepluginandwhichotherpluginitextends.Onstart-uptheEclipsePlatformdiscoverswhichplug-inareavailableanditgeneratesaplug-inregistry.Theplug-initselfisloadedwhenitactuallyneedstoberun.
Meta-EnvironmentTechnology
TheAsf+Sdfformalismisusedforthedefinitionofsyntacticaswellassemanticaspectsofalanguage.Itcanbeusedforthedefinitionofarangeoflanguages(forprogramming,writingspecifications,queryingdatabases,textprocessing,orotherapplications).Inadditionitcanbeusedfortheformalspecificationofawidevarietyofproblems.Asf+Sdfcanbecharacterizedasamodular,rewriting-based,specificationformalisminwhichsyntaxandsemanticsarecompletelyintegrated.
TheAsf+SdfMeta-EnvironmentisbothaprogrammingenvironmentforAsf+SdfspecificationsandaprogrammingenvironmentgeneratorwhichusesanAsf+Sdfspecificationforsome(programming)languageLtogenerateastand-aloneenvironmentforL.ThedesignoftheMeta-Environmentisbasedonopenness,reuse,andextensibility.TheMeta-Environmentofferssyntax-directededitingofAsf+SdfspecificationsaswellascompilationofAsf+Sdfspecificationsintodedicatedinteractivestand-aloneenvironmentscontainingvarioustoolssuchasaparser,unparser,syntax-directededitor,debugger,andinterpreterorcompiler.
Figure1showstheuserinterfacedevelopedusingJFC/Swing.Thisfigureshowsthemodularstructureofthespecification.Eachnodeinthegraphcanbeclickedandallowstheinvocationofasyntax,equation,ortermeditor.
Thevarioustypesofeditorsaredecoratedwithdifferentpull-downmenus.Alleditorshavefunctionalitytoinvoketheparser,viewtheparsetreeofthefocusasgraph,andtomovethefocus.Termeditorsmayhavelanguagespecificpull-downmenus.
InordertoachieveastrictseparationbetweencoordinationandcomputationweusetheToolBuscoordinationarchitecture,aprogrammablesoftwarebusbasedonprocessalgebra.Coordinationisexpressedbyaformaldescriptionofthecooperationprotocolbetweencomponentswhilecomputationisexpressedincomponentsthatmaybewritteninanylanguage.Wethusobtaininteroperabilityofheterogeneouscomponentsina(possibly)distributedsystem.Thecomponentsarenotallowedtocommunicatedirectlywitheachother,butonlyviatheToolBus.Thisleadstoarigorousseparationofconcerns.
Architecturalconsiderations
TheMeta-Environmentconsistsofabout20cooperatingcomponents,includingaparsetablegenerator,aparserandunparser,atermstore(forcachingresults),andaninterpreterandcompiler.Also,agraphicaluserinterfaceandanumberoftexteditors(suchasGNUEmacs3andVim4)aswellasastructureeditorareconnectedtotheMeta-Environment.Theseallowuserinteractionwiththesystem,andinparticularallowuserstoeditsyntax,equationsandterms.
Figure2isa(simplified)viewshowingthesecomponentsconnectedtotheToolBusCurrentarchitecture:
usingJFC/Swingandexternaleditors.Figure2showsthecurrentimplementationwithseparatecomponentsfortheGUIandthevarioustexteditors.Currently,theGUIisimplementedinJFC/Swing.
Eachtimeatexteditingsessionisrequestedbytheuser,anewinstanceofoneofthesupportedsystemeditorsisexecutedtotakecareoftheeditingsession.ThesetexteditorsneedonlyimplementaminimalinterfacetobeusablebytheMeta-Environment.Someformofoperatingsystemlevelcommunicationchannelisneeded(e.g.socket,pipe).Theeditorthenneedstobeabletoreceiveandexecutecommandstoaddamenutothemenu-bar,setthecursorataspecificlocation,andhighlightorselectaregionoftext.
Targetarchitecture:
usingEclipseforbothGUIandeditors.EclipseexportsmanyGUIfeaturesthatcanbeusedtowriteplug-inandalsohasabuilt-ineditorwhichimplementstherequiredMeta-Environmenttexteditorinterface.FromanEclipsepointofview,itisinterestingtobeabletoreusethegenericlanguagetechnologyofferedbytheMeta-Environment.FromtheMeta-Environmentpointofview,itwouldbeinterestingtoseeifEclipsecouldbeusedtoimplementtheGUIandthetexteditors(thedottedrectangleinFigure2).FromaToolBuspointofview,itisinterestingtoseehowasingletool(Eclipseinthiscase)canserveastheimplementationofmultiplecomponents(bothGUIandtexteditor).
Implementation
WedescribesomeoftheimplementationdetailsofthecurrentMeta-EnvironmentGUI.InthetargetarchitecturewereplaceboththeJFC/SwingGUIandtheexternaltexteditorsbyEclipseasdescribed.
JFC/Swing-basedimplementation
TheToolBusprincipletoseparatefunctionalityleadstoagenericimplementationoftheuserinterface.TomeettheMeta-Environmentrequirementstheuserinterfaceonlyhastoimplementsomebasicfunctionality.TheJFC/SwingimplementationextendstheMeta-EnvironmentwithaGUIthatsupportsseveralcomponents:
atreepanel,graphpanel,andsomeinformationalpanels.Thetreeandgraphpanelsprovidetheuserwitharepresentationofopenedandimportedmodulesinatextualandgraphicalway,respectively.Statusmessagesandinformationaboutselectedmodulesaredisplayedindedicatedinformationalpanels.EachoftheseGUIelementsisdumb:
itiscapableofpresentingagraphicalrepresentationofitsdataanditcommunicatesevents(e.g.amouseclick)totheToolBus,butitabstractsfromthedetailsoftheseevents.Theactualimplementationofanevent(e.g.performingarefactoringoperationonaselectedmodule)ishandledelsewhereintheMeta-Environment.
TheprovidedbasicframeworkcanbeextendeddynamicallywithuserinterfaceelementsbymeansofToolBusmessagessenttotheuserinterface.Thesemessagescontainthetypeofuserinterfaceelementtobeadded(e.g.menu,tool-barbutton),thecaptiontobedisplayed,andtheactionthathastobeperformedwhenselectingthisuserinterfaceelement.ThissetupensuresthattheuserinterfacedoesnotknowaboutanyfunctionalityimplementedintheMeta-Environment
Texteditingfunctionalityisprovidedbymeansofexternaltexteditorsasdescribedbefore.Ingeneralthechoiceoftexteditorisfreeaslongasitiscapableofaddingmenusandmethodsfordisplayingafocus.AfterconnectionwiththeToolBusisestablisheditwillreceiveitsspecificmenus,menuitems,andcorrespondingactions.
Eclipse-basedimplementation
In