ANTLR和AndroidANTLR、Android

由网友(蓝褶裙的姑娘)分享简介:有没有指导如何使用ANTLR在Android?我已经发现了一些ANTLR portation为Android,但它看起来就像是没有任何教程或手动。你知道在哪里可以找到一些? (是的,我一直在使用Google ...)THX 解决方案 从这个阅读自述的 ANTLR端口:AntlrJavaRuntime - Earl...

有没有指导如何使用ANTLR在Android?我已经发现了一些ANTLR portation为Android,但它看起来就像是没有任何教程或手动。你知道在哪里可以找到一些? (是的,我一直在使用Google ...)

THX

解决方案

从这个阅读自述的 ANTLR端口:

  

AntlrJavaRuntime - Earlence费尔南德斯,绉项目,VU阿姆斯特丹   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~

     

在运行时可作为外部库对哪些应用程序可以链接。   它提供了必要的机制来执行由ANTLR工具生成的词法分析器/分析器code。   该模型是离线的,在某种意义上说,解析器/词法生成关掉移动电话在台式计算机上。   生成的文件转移到Android项目,然后使用这个库。

     

大厦   ~~~~~~~~

        午餐相应的目标   请AntlrJavaRuntime   验证AntlrJavaRuntime.xml放置在/系统的/ etc /权限和AntlrJavaRuntime.jar放置在/系统/框架   在此,您可以运行一个正常的化妆   

在我看来,唯一的区别是,当你想在Android设备上运行的解析器(或-emulator),你必须包括AntlrJavaRuntime在你的Andr​​oid项目/应用程序。

所以,写入语法,产生一个解析器和词法分析器从所述语法将是相同的正常的机器。这里有一个previous Q&放大器; A显示了如何编写一个简单的EX pression分析器:的 ANTLR:有没有一个简单的例子

修改

另请参阅本Q&功放; A:机器人ANTLR使工作不正常的

is there any guide how to use ANTLR on Android? I have found some ANTLR portation for Android but it looks like being without any tutorial or manual. Do you know where to find some? (and yes, I have been googling...)

Thx

解决方案 Android Studio 选项菜单和动画结合 Android 应用与iOS 应用之间的设计差异对比

After reading the README from this ANTLR port:

AntlrJavaRuntime - Earlence Fernandes, The CRePE Project, VU Amsterdam ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Runtime is available as an external library against which apps can link. It provides the necessary mechanisms to execute Lexer/Parser code generated by the ANTLR tool. The model is offline, in the sense that the parser/lexer is generated off the mobile phone on a desktop computer. The resulting files are transferred to an Android project which then uses this library.

Building ~~~~~~~~

lunch the appropriate target make AntlrJavaRuntime verify that AntlrJavaRuntime.xml was placed in /system/etc/permissions and AntlrJavaRuntime.jar was placed in /system/framework after this, you can run a normal make

It seems to me that the only difference is when you want to run your parser on an Android device (or -emulator) you must include the AntlrJavaRuntime in your Android project/app.

So, writing the grammar, generating a parser and lexer from said grammar would be the same as on a "normal" machine. Here's a previous Q&A that shows how to write a simple expression parser: antlr: is there a simple example?

EDIT

Also see this Q&A: android ANTLR make not working properly

阅读全文

相关推荐

最新文章