使用 xtext 不是作为插件 [英] working with xtext not as plugin

查看:15
本文介绍了使用 xtext 不是作为插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

总的来说,我有我的 dsl 作为插件,我想创建一个使用我的 dsl 的新应用

In general I have my dsl as plugin and I want to create a new app that use my dsl

所以我尝试编写此代码:

so i tried to write this code:

JsonParser p = new JsonParser();
IParseResult r = p.parse(new StringReader("{}")); 
//once that work it will be the file data instead of {}

但是当我进行解析时,节点模型构建器为空并且以下行有异常:return doParse(ruleName, in, nodeModelBuilder.get(), 0);

but when i do the parse the node model builder is null and the following line has exception: return doParse(ruleName, in, nodeModelBuilder.get(), 0);

我不知道如何初始化 nodeModelBuilder

and i'm not sure how to init nodeModelBuilder

我确定我遗漏了一些步骤,但我对 xtext 过程不太熟悉.谢谢!

i'm sure i missing some steps but i'm not quite familiar with the xtext process. thanks!

推荐答案

您需要使用 StandaloneSetup 以独立模式运行.

You need to use StandaloneSetup to run in standalone mode.

请参阅本教程以获得帮助

这篇关于使用 xtext 不是作为插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆