




已阅读5页,还剩20页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
IntroductionLuaEclipse is a collection of plugins for the Eclipse platform. Its goal is to facilitate the development of programs using Lua, either as a standalone language or as an extension language.The plugins are extensible and can be used as base for other tools, but this section is a manual on using the software, not extending it.LuaEclipse is a free software and uses the same license as Lua 5.1.InstallationThe installation proccess is very simple, but needs some pre-requisites. The first one is that the user must have already installed the 3.2.* or later version of the Eclipse platform. Eclipse can be downloaded at . As a consequence, it is necessary that Java SDK is installed to run Eclipse.It is possible to install LuaEclipse with the minimal installation of Eclipse (Eclipse Platform Binaries), but we recommend a more complete distribution, such as C/C+ Development Tooling (CDT).There are two ways to install LuaEclipse. Eclipse Software Updates On the top menu, go to option Help-Find and Install, choose option Search for new features to install and click on Next. If this is the first time you are installing LuaEclipse from its update-site, click on Add Remote Site. You can name the LuaEclipse Update-site anything you want, but in field URL you must type /update-site/site.xml. Make sure the LuaEclipse Update-site is checked, then click on Finish. In the next screen, select the features to install. If you want to use the new LuaProfiler integration, select the appropriate feature. By manual download: Download the latest version of LuaEclipse at LuaForge. To install Eclipse, just decompress the zip file in the root folder of Eclipse, for example: /usr/local/eclipse. After that start Eclipse and the installation is complete. In some systems its necessary to start eclipse with the -clean command line argument. To check if the installation was correct, go to the menu option Help-About Eclipse Platform and select the Plug-ins Details option and check if LuaEclipse is installed correctly. Your window must look like the picture bellow:First Lua ProjectTo create a new Lua Project, click on menu option File-New-New Lua Project.To include a new Lua script, select the Lua project wanted, then click with the right button and select the option Lua Actions-New Lua FileNow just start coding. ;)Preferences and interpretersLua scripts need an interpreter or a host program in order to be able to run. Now the only preference option on LuaEclipse is the configuration of Lua interpreters to execute scripts. To set a interpreter go to Windows-preferences. and then the Lua-Installed Interpreters category, as in the following picture.In this window it is possible to add, edit or remove an interpreter LuaEclipse will use to execute lua scripts. The configuration of an interpreter is basically the name that identifies it and the path to its Lua executable. On the first column of the interpreter list, there is an option to select one of them as the default interpreter to execute scripts. This option is used on the script execution configuration. After the necessary configurations are made, click on Ok to save them.You must configure your host application binary as an interpreter if your project uses Lua as an extension language; otherwise, you might not be able to run your lua scripts properly.Running a Lua fileLuaEclipse uses the Eclipse Platform Lauchers to run Lua scripts. There are two ways of executing a lua script file: you can either create a run configuration for your script or you can use the Eclipse context menu on the script file, selecting Run As - Lua application. To create a Run configuration, select the menu option Run-Run.Create a new Lua Standalone Application launch configuration .On the File Tab: select the Lua project and file to be executed.On the Arguments Tab: configure the working directory, interpreter arguments and program arguments.At Environment Tab: select or add a Lua interpreter that will run th script. At Variables field, add th environment variables needed for your script.Press Run and view the script output at the Console View.LuaProfiler IntegrationLuaEclipse introduced in version 1.2 a new Lua Profiler perspective. It makes possible for the user to run a lua script using the LuaProfiler module, while seeing the results in a special ViewSince one can make use of several runtime binaries, it is necessary to select a profiler engine to use.This profiler engine will be identified by a name, and can be reused in many projects.Once the profiler is selected, any executable script can be profiled. There is no need to require or to start the profiler within the program - the plug-in will automatically work on any valid Lua scriptResults of the profiling execution can be seen in a special View, separated in columns. The first column will show all functions used in the execution; the second column will show the amount of times each function was called; A third column shows the average time spent inside the function, divided by the amount of calls; the last two columns are the total time spent inside each function and the percent of the total execution that these times represent.LuaDoc IntegrationVersion 1.2 introduced also basic integration with the LuaDoc module.It makes possible for the user to write LuaDoc-style documentation on his code and make their HTML results available in mouse hover.The plugin uses LuaDoc itself for processing documentation; the module is now included in the standard bundle of LuaEclipse, so users do not need to install it before using this feature.Documentation is processed every time a file is saved in the project, and documentation present in project is persisted and available after the project is closed and reopen.Aditionally, Lua 5.1 reference was included as a bonus documentation - so the user now can hover standard library functions for their official documentation.RemDebug IntegrationVersion 1.3 introduced the integrated Debugger using RemDebug - a remote debugger for Lua.Launching a LuaScript for debug is similar to executing a script.The Debug perspective provides several views to help debugging your scripts. One of the main features is the stack frame - a list of every call level from the launcher to the current line.Clicking any stack level loads the file where this call was made (highlighting the current line) and shows all variables from that context into the variables view.You can run your scripts step by step using either the step over or
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论