Eclipse外文翻译.docx
《Eclipse外文翻译.docx》由会员分享,可在线阅读,更多相关《Eclipse外文翻译.docx(13页珍藏版)》请在冰点文库上搜索。
![Eclipse外文翻译.docx](https://file1.bingdoc.com/fileroot1/2023-5/1/48681bea-9ae5-458e-89b8-3295b51701bf/48681bea-9ae5-458e-89b8-3295b51701bf1.gif)
Eclipse外文翻译
外文原文
ALanguageDevelopmentEnvironmentforEclipse
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.
Introduction
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,and
interpreterorcompiler.
FigurelshowstheuserinterfacedevelopedusingJFC/Swing.Thisfigureshowsthemodularstructureofthespecification.Eachnodeinthegraphcanbeclickedandallowstheinvocationofasyntax,equation,ortermeditor.
Thevarioustypesofeditorsaredecoratedwithdifferentpull-downmenus.Alleditorshavefunctionalitytoinvoketheparser,viewtheparsetreeofthefocusasgraph,andtomovethefocus.TermeditorsmayhaveIanguagespecificpull-downmenus.
Inordertoachieveastrictseparationbetweencoordinationandcomputationweusethe
ToolBuscoordinationarchitecture,aprogrammablesoftwarebusbasedonprocessalgebra.
Coordinationisexpressedbyaformaldescriptionofthecooperationprotocolbetweencomponentswhilecomputationisexpressedincomponentsthatmaybewritteninany
Ianguage.Wethusobtaininteroperabilityofheterogeneouscomponentsina(possibly)distributedsystem.Thecomponentsarenotallowedtocommunicatedirectlywitheachother,butonlyviatheToolBus.Thisleadstoarigorousseparationofconcerns.
22ARCfJ/KCRflALCUV迎EIMTM网
■frrJrd"I■■■rj.Hrb-Hi4
■J--
Ipr.'1一-I■V
hr3|_|■i・;G25(■nyr
ndlQa妆*直芒bA占」rSj.-'
4UOU4®―-ftaT»*^f
—rt"■■all■,■-LI.
+如■zir!
咗:
--■l・-
IL^r汁:
「4厂“I•t~
ih
JMlX:
Il'.-1If'iTq',■
—wii虚
"I(--11-tIMI"a-rIrInI-I
"itL-hI■-Ilb-Iajii-■aI
H
I1i
■■'ll'll•:
1Id■:
I廿"WuritI'-f■I■1'
HF
■bl
二亠二匸I•■聲&皑•w二"j—GLTOBJ・
ht
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).
Unpnrtsr
HIP"护2.ny-JA/VV^RHVVLA/林M卜OP":
PArSrr
Gcnerflirr-r
imorDroitr
MetaTooIBlis
SIR諭IS
丁&斑Edllsj-
TfrrjSitiTH
BB
LEJOf
Ftlirs*
Figure2-2jArdihnc-T.umoftlv?
Mel-ftHnviroiinintirnTonlHu
Implementation
WedescribesomeoftheimplementationdetailsofthecurrentMeta-EnvironmentGUI.InthetargetarchitecturewereplaceboththeJFC/SwingGUIandtheexternaltexteditorsbyEclipseasdescribed.
JFC/Swing-basedimplementation
TheToolBusprincipietoseparatefunctionalityleadstoagenericimplementationoftheuserinterface.TomeettheMeta-Environmentrequirementstheuserinterfaceonlyhastoimplementsomebasicfunctionality.TheJFC/SwingimplementationextendstheMeta-EnvironmentwithaGUIthatsupportsseveralcomponents:
atreepanel,graphpanel,andsomeinformationalpanels.Thetreeandgraphpanelsprovidetheuserwitharepresentationofopenedandimportedmodulesinatextualandgraphicalway,respectively.Statusmessagesandinformationaboutselectedmodulesaredisplayedindedicatedinformationalpanels.EachoftheseGUIelementsisdumb:
itiscapableofpresentingagraphicalrepresentationofitsdataanditcommunicatesevents(e.g.amouseclick)totheToolBus,butitabstractsfromthedetailsoftheseevents.Theactualimplementationofanevent(e.g.performingarefactoringoperationonaselectedmodule)ishandledelsewhereintheMeta-Environment.
Theprovidedbasicframeworkcanbeextendeddynamic