123
返回列表 发新帖
楼主: Sky-Tiger

HTML5 postMessage 和 onmessage API 详细应用

[复制链接]
论坛徽章:
350
2006年度最佳版主
日期:2007-01-24 12:56:49NBA大富翁
日期:2008-04-21 22:57:29地主之星
日期:2008-11-17 19:37:352008年度最佳版主
日期:2009-03-26 09:33:53股神
日期:2009-04-01 10:05:56NBA季后赛大富翁
日期:2009-06-16 11:48:01NBA季后赛大富翁
日期:2009-06-16 11:48:01ITPUB年度最佳版主
日期:2011-04-08 18:37:09ITPUB年度最佳版主
日期:2011-12-28 15:24:18ITPUB年度最佳技术原创精华奖
日期:2012-03-13 17:12:05
21#
 楼主| 发表于 2014-8-16 21:54 | 只看该作者
At the end of Chapter 1, Implementing a DSL, we saw how to run the Xtext generator; you should follow the same steps, but instead of right-clicking on the .xtext file and navigating to Run As | Generate Xtext Artifacts, we right-click on the .mwe2 file (in our example it is GenerateEntities.mwe2) and navigate to Run As | MWE2 Workflow. (Remember to accept the request for downloading the ANTLR generator, as explained in Chapter 1, Implementing a DSL).
Before you start the new Eclipse instance, you must make sure that the launch configuration has enough PermGen size, otherwise you will experience "out of memory" errors.
You need to specify the following value as VM arguments in your launch configuration: -XX:MaxPermSize=256m.
You can also simply use the launch configuration that Xtext created for you in your org.example.entities project in the directory .launch; you might not be able to see that directory, since by default the workbench hides resources starting with a dot, so make sure to remove that filter in your workspace preferences. Alternatively, you can right-click on that project and navigate to Run As | Run Configurations...; in the dialog, you can see Launch Runtime Eclipse under Eclipse Application; select it and click on Run.

使用道具 举报

回复
论坛徽章:
350
2006年度最佳版主
日期:2007-01-24 12:56:49NBA大富翁
日期:2008-04-21 22:57:29地主之星
日期:2008-11-17 19:37:352008年度最佳版主
日期:2009-03-26 09:33:53股神
日期:2009-04-01 10:05:56NBA季后赛大富翁
日期:2009-06-16 11:48:01NBA季后赛大富翁
日期:2009-06-16 11:48:01ITPUB年度最佳版主
日期:2011-04-08 18:37:09ITPUB年度最佳版主
日期:2011-12-28 15:24:18ITPUB年度最佳技术原创精华奖
日期:2012-03-13 17:12:05
22#
 楼主| 发表于 2014-8-16 21:54 | 只看该作者
The ( )? operator declares an optional part. Therefore, after the ID, you can write the keyword 'extends' and the name of an Entity. This illustrates one of the powerful features of Xtext, that is, cross-references. In fact, what we want after the keyword 'extends' is not just a name, but the name of an existing Entity. This can be expressed in the grammar using square brackets and the type we want to refer to. Xtext will automatically resolve the cross-reference by searching in the program for an element of that type (in our case an Entity) with the given name. If it cannot find it, it will automatically issue an error. Note that in order for this mechanism to work, the referred element must have a feature called name. As we will see in the following section, the automatic code completion mechanism will also take into consideration cross-references, thus proposing elements to refer to.

使用道具 举报

回复
论坛徽章:
350
2006年度最佳版主
日期:2007-01-24 12:56:49NBA大富翁
日期:2008-04-21 22:57:29地主之星
日期:2008-11-17 19:37:352008年度最佳版主
日期:2009-03-26 09:33:53股神
日期:2009-04-01 10:05:56NBA季后赛大富翁
日期:2009-06-16 11:48:01NBA季后赛大富翁
日期:2009-06-16 11:48:01ITPUB年度最佳版主
日期:2011-04-08 18:37:09ITPUB年度最佳版主
日期:2011-12-28 15:24:18ITPUB年度最佳技术原创精华奖
日期:2012-03-13 17:12:05
23#
 楼主| 发表于 2014-8-16 21:54 | 只看该作者
Most generated stub classes in the src folder are actually Xtend classes; the Xtend programming language will be introduced in the next chapter, thus, for the moment, we will not look at these stub classes.
There is one exception to the previously described generation strategy, which concerns the file plugin.xml (in the runtime and in the UI plug-ins): further Xtext generations will generate the file plugin.xml_gen in the root directory of your projects. It is up to you to check whether something has changed by comparing it with plugin.xml. In that case you should manually merge the differences. This can be easily done by using Eclipse: select the two files, right-click and navigate to Compare With | Each Other..., as illustrated in the following screenshot:

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表