1、Eclipse外文翻译外文原文A Language Development Environment for EclipseA. T. Kookier January 2004IntroductionThe Asf+Sdf Meta-Environment are an interactive development environment with a graphical user interface written in JFC/Swing. A typical session in this environment results in an overwhelming amount of
2、windows presenting the Meta-Environment itself next to lots of editors all trying to catch the attention of the user. Although the described scene is a little bit exaggerated the several open windows and JFC/Swing graphical user interface were the reasons to take a look into Eclipse.Eclipse is a fra
3、mework for creating programming environments, wherefore currently versions are available for C / C+, java and cobol. Each version addresses a specific programming language with its own set of tools, commands and screen layout. Because Eclipse is a well developed environment the Asf+Sdf Meta-Environm
4、ent could benefit from integration with Eclipse. Eclipse offers the possibility to make your own perspective (which is a screen layout) consisting of tree views, editors and other kind of views all in one place.Eclipses on the other side can benefit from the integration with the Meta- Environment ,b
5、ecause the Meta-Environment brings generic language technology to Eclipse. Instead of developing a development environment for each programming language one development environment for the Meta-Environment is enough to provide tools for every programming language developed in the Meta-Environment.In
6、troductionEclipse is an open source framework for creating programming environments. Currently versions exist for C / C+1, java and Cobol2. New tools and languages can be added by writing java applications that perform parsing, type checking and the like for a new language. Eclipse provides a rich s
7、et of tools oriented toward user-interface construction and java compilation. The level of automation for building environments for new languages is, however, low.The Asf+Sdf Meta-Environment are a programming environments generator: given a language definition consisting of a syntax definition (gra
8、mmar) and tool descriptions (using rewrite rules) a language specific environment is generated. A language definition typically includes such features as pretty printing, type checking, analysis, transformation and execution of programs in the target language. The Asf+Sdf Meta-Environment are used t
9、o create tools for domain-specific languages and for the analysis and transformation of software systems. As the Eclipse and Meta-Environment technologies are to a large extent complementary, it is worthwhile to investigate how they can be integrated.Eclipse Plugin TechnologyThe Eclipse Platform is
10、designed for building integrated development environments .An IDE can be built by providing the Eclipse Platform with a plugin contributing to an extension point of some other plugin. In fact the Eclipse Platform is a number of plug-in itself. It consists of a small kernel which starts all necessary
11、 plug-in to run a basic instance of the Eclipse Platform. All other functionality is located in plug-in which extend these basic plug-in. In this way Eclipse provides tool providers with a mechanism that leads to seamlessly integrated tools. Eclipses plugin are written in java and consist of a manif
12、est file and java classes in a JAR archive. The manifest file declares the extension points of the plugin and which other plugin it extends. On start-up the Eclipse Platform discovers which plug-in are available and it generates a plug-in registry. The plug-in itself is loaded when it actually needs
13、 to be run.Meta-Environment Technology The Asf+Sdf formalism is used for the definition of syntactic as well as semantic aspects of a language. It can be used for the definition of a range of languages (for programming, writing specifications, querying databases, text processing, or other applicatio
14、ns). In addition it can be used for the formal specification of a wide variety of problems. Asf+Sdf can be characterized as a modular, rewriting-based, specification formalism in which syntax and semantics are completely integrated.The Asf+Sdf Meta-Environment is both a programming environment for A
15、sf+Sdf specifications and a programming environment generator which uses an Asf+Sdf specification for some (programming) language L to generate a stand-alone environment for L. The design of the Meta-Environment is based on openness, reuse, and extensibility. The Meta-Environment offers syntax-direc
16、ted editing of Asf+Sdf specifications as well as compilation of Asf+Sdf specifications into dedicated interactive stand-alone environments containing various tools such as a parser, unparser, syntax-directed editor, debugger, and interpreter or compiler.Figure1 shows the user interface developed usi
17、ng JFC/Swing. This figure shows the modular structure of the specification. Each node in the graph can be clicked and allows the invocation of a syntax, equation, or term editor.The various types of editors are decorated with different pull-down menus. All editors have functionality to invoke the pa
18、rser, view the parse tree of the focus as graph, and to move the focus. Term editors may have language specific pull-down menus.In order to achieve a strict separation between coordination and computation we use the ToolBus coordination architecture, a programmable software bus based on process alge
19、bra. Coordination is expressed by a formal description of the cooperation protocol between components while computation is expressed in components that may be written in any language. We thus obtain interoperability of heterogeneous components in a (possibly) distributed system. The components are n
20、ot allowed to communicate directly with each other, but only via the ToolBus . This leads to a rigorous separation of concerns.Architectural considerationsThe Meta-Environment consists of about 20 cooperating components, including a parse table generator, a parser and unparser, a term store (for cac
21、hing results), and an interpreter and compiler. Also, a graphical user interface and a number of text editors (such as GNU Emacs3 and Vim4) as well as a structure editor are connected to the Meta-Environment. These allow user interaction with the system, and in particular allow users to edit syntax,
22、 equations and terms.Figure2 is a (simplified) view showing these components connected to the ToolBus Current architecture: using JFC/Swing and external editors. Figure 2 shows the current implementation with separate components for the GUI and the various text editors. Currently, the GUI is impleme
23、nted in JFC/Swing. Each time a text editing session is requested by the user, a new instance of one of the supported system editors is executed to take care of the editing session. These text editors need only implement a minimal interface to be usable by the Meta-Environment. Some form of operating
24、 system level communication channel is needed (e.g. socket, pipe). The editor then needs to be able to receive and execute commands to add a menu to the menu-bar, set the cursor at a specific location, and highlight or select a region of text.Target architecture: using Eclipse for both GUI and edito
25、rs. Eclipse exports many GUI features that can be used to write plug-in and also has a built-in editor which implements the required Meta-Environment text editor interface. From an Eclipse point of view, it is interesting to be able to reuse the generic language technology offered by the Meta-Enviro
26、nment. From the Meta-Environment point of view, it would be interesting to see if Eclipse could be used to implement the GUI and the text editors (the dotted rectangle in Figure 2). From a ToolBus point of view, it is interesting to see how a single tool (Eclipse in this case) can serve as the imple
27、mentation of multiple components (both GUI and text editor).Implementation We describe some of the implementation details of the current Meta-Environment GUI .In the target architecture we replace both the JFC/Swing GUI and the external text editors by Eclipse as described.JFC/Swing-based implementa
28、tionThe ToolBus principle to separate functionality leads to a generic implementation of the user interface. To meet the Meta-Environment requirements the user interface only has to implement some basic functionality. The JFC/Swing implementation extends the Meta-Environment with a GUI that supports
29、 several components: a tree panel, graph panel, and some informational panels. The tree and graph panels provide the user with a representation of opened and imported modules in a textual and graphical way, respectively. Status messages and information about selected modules are displayed in dedicat
30、ed informational panels. Each of these GUI elements is dumb: it is capable of presenting a graphical representation of its data and it communicates events (e.g. a mouse click) to the ToolBus, but it abstracts from the details of these events. The actual implementation of an event (e.g. performing a
31、refactoring operation on a selected module) is handled elsewhere in the Meta-Environment.The provided basic framework can be extended dynamically with user interface elements by means of ToolBus messages sent to the user interface. These messages contain the type of user interface element to be adde
32、d (e.g. menu, tool-bar button), the caption to be displayed, and the action that has to be performed when selecting this user interface element. This setup ensures that the user interface does not know about any functionality implemented in the Meta-EnvironmentText editing functionality is provided
33、by means of external text editors as described before. In general the choice of text editor is free as long as it is capable of adding menus and methods for displaying a focus. After connection with the ToolBus is established it will receive its specific menus, menu items, and corresponding actions.Eclipse-based implementationIn
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1