问题标签 [parsekit]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1859 浏览

objective-c - Adding Parsekit To An Xcode Project

I am trying to add the Parsekit framework to my OSX Xcode project. I've never added a 3rd party framework before and I can't get it to work right.

I dragged the included Xcode project into my 'Groups & Files' pane and chose to Add it to my project. I then dragged Parsekit.framework underneath the Link Binary With Libraries heading. Then I double-clicked my target app and added Parsekit as a Direct Dependency. I also added libicucore.dylib as a Linked Library (as it says to do this on their site). Finally, in the Build settings tab of my target info I set the Header Search Paths to /Users/path/to/include/directory and the Other Linker Flags to -ObjC -all_load.

Running this as a debug build work fine with no errors. However, when I build my app to release and then try to run the executable created, the app fails to load with the following error message:

MyApp cannot be opened because of a problem. Check with the developer to make sure myApp works with this version of Mac OS X.

Here is the dump from the crash reporter:

Process: MyApp [11658] Path:
/Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp Identifier: com.yourcompany.MyApp Version: ??? (???) Code Type: X86-64 (Native) Parent Process: launchd [135] Date/Time:
2010-05-24 17:08:08.475 +0100 OS Version: Mac OS X 10.6.3 (10D573) Report Version: 6Interval Since Last Report: 133300 sec Crashes Since Last Report: 3 Per-App Crashes Since Last Report: 3 Anonymous UUID:
DF0265E4-B5A0-45E1-8B71-D52A27CFDDCA

Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000002, 0x0000000000000000 Crashed Thread: 0

Dyld Error Message: Library not loaded: @executable_path/../Frameworks/ParseKit.framework/Versions/A/ParseKit Referenced from: /Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp Reason: image not found

Model: MacBookPro5,5, BootROM MBP55.00AC.B03, 2 processors, Intel Core 2 Duo, 2.53 GHz, 4 GB, SMC 1.47f2 Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB Memory Module: global_name AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.10.91.27) Bluetooth: Version 2.3.1f4, 2 service, 2 devices, 1 incoming serial ports Network Service: AirPort, AirPort, en1 Network Service: Ethernet Adaptor (en6), Ethernet, en6 Serial ATA Device: Hitachi HTS545025B9SA02, 232.89 GB Serial ATA Device: HL-DT-ST DVDRW GS23N USB Device: Built-in iSight, 0x05ac (Apple Inc.), 0x8507, 0x24400000 USB Device: Internal Memory Card Reader, 0x05ac (Apple Inc.), 0x8403, 0x26500000 USB Device: IR Receiver, 0x05ac (Apple Inc.), 0x8242, 0x04500000 USB Device: Apple Internal Keyboard / Trackpad, 0x05ac (Apple Inc.), 0x0237, 0x04600000 USB Device: BRCM2046 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0x06100000 USB Device: Bluetooth USB Host Controller, 0x05ac (Apple Inc.), 0x8213, 0x06110000

After building the app, in addition to the executable file, Xcode is also creating a file called MyApp.app.dSYM. Any idea what that is??

I am developing with Xcode 3.2.2 on an Intel MBP running 10.6.3.

Many thanks for any help offered.

Edit: New problem! Many thanks to diciu for your suggestions - initially I thought they had solved the problem. However, I copied the compiled app over to my wife's Macbook (Intel, running 10.6.3) but it won't launch. Instead I get the following error message:

You can't open the application MyApp because it is not supported on this type of Mac.

In the Build settings of MyApp, I have Valid architectures set to i386 x86_64 so it should work. What could this be caused by?

Edit: Problem solved I had inadvertently checked the Build active architecture only flag in the Build settings. Unchecking this fixed my problem. Many thanks!

0 投票
2 回答
421 浏览

objective-c - XCode 4、ParseKit 和存档目标

我正在尝试归档一个使用 ParseKit 的 iPad 应用程序。对于使用调试配置(即在设备/模拟器上运行分析分析)的任何构建,我可以使用 ParseKit 运行该应用程序。但是,当我使用发布配置时,我收到以下链接器错误:

ld:找不到-lparsekit collect2的库:ld返回1退出状态命令/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2失败,退出代码为1

0 投票
1 回答
391 浏览

objective-c - parsekit 对选择器进行了意外调用

我有以下非常简单的(测试)语法文件

然后我运行以下代码:

以及以下方法:

最后我在日志中收到这些消息:

这是有道理的,但我不明白为什么会出现 %5 。我真的很希望能够删除双重匹配,以便诸如“The”之类的关键字仅触发didMatchThe而不触发didMatchKeyword

不幸的是, parsekit 上的 doco 似乎不存在其语法语法以及它如何决定触发方法。是的,我也查看了源代码 :-)

有没有人有使用 parsekit 的经验并且可以对此有所了解?

0 投票
1 回答
260 浏览

iphone - 如何为 iPhone 下载 ParseKit?

非常基本(并且可能非常愚蠢)的问题,但我不熟悉这个下载源代码的过程。即使您从未下载过此文件,您也可以指出我遗漏的内容。

我正在尝试让 ParseKit 解析器生成器与我的 iPhone 应用程序一起使用:

说明说我需要一个名为“ParseKit.xcodeproj”的项目文件:

http://parsekit.com/iphone.html

下面的链接将我带到源文件,但我看不到从哪里获取实际的项目文件:

http://code.google.com/p/todparsekit/source/browse/#svn%2Ftags%2Frelease-1.5-tag

ParseKit.xcodeproj 在左边,但我不能自己下载它,project.pbxproj 打开包含一些源代码。如何获取项目文件本身?

为这个问题道歉,但整个事情似乎很不明显,为什么不提供一个下载链接呢?我肯定错过了什么...

谢谢!

0 投票
2 回答
942 浏览

objective-c - 这个 ParseKit BNF 有什么问题?

我将 ParseKit 用于 Objective-C,它采用类似 BNF 的语法来指定语法:

包含最后一行会导致错误。基本上我想说一个对象可以是房子或其他东西。非终结元素“other”应该能捕捉到任何不是房子的词。

我是否以错误的方式谈论“这里的任何东西”的想法?

谢谢!

0 投票
1 回答
360 浏览

objective-c - 使用 Parsekit 构造解析树

我正在为 XCode 使用 Parsekit,但这个问题很可能适用于大多数解析器生成器。我用一个游戏玩家解析一个脚本,它工作正常。但是,我在下一步遇到问题。考虑 grmmer:

@start = 行+; 线=树;

tree = 'tree' 果实分支;

fruits = 'with' 'fruits' 编号;分支 = 'with' '分支' 编号;

以及要通过的脚本:

有果子的树 8 有树枝 12

如果我随后实现匹配的方法,水果和树枝将匹配一次,这是意料之中的。

但是树会匹配两次,为什么?这阻止了我构建我想要的解析树。

谢谢你的帮助!

0 投票
1 回答
559 浏览

objective-c - 无法让简单的 ParseKit 示例正常工作

我刚刚发现 ParseKit 但似乎无法让它在一个简单的例子中运行。

我的语法文件如下所示:

但是这些方法不会触发。

0 投票
1 回答
307 浏览

objective-c - Objective-C ParseKit 返回值

在 flex/lex/bison/yacc(我刚刚开始阅读所有这些内容)中,您可以将“$$”设置为某个值($1、$2、$3),这就是返回的值。至少我认为它是这样工作的。

在 ParseKit 中,给你一个堆栈,所以我想 ($1,$2,$3) 将是堆栈上的前三个值。但是我认为您想要做的是将这些值从堆栈中弹出并将您的返回值放入堆栈中。我看到堆栈带有推送方法。在推动某些东西之前,您是否必须先弹出传入的值?

谢谢

0 投票
1 回答
226 浏览

objective-c - Objective-C ParseKit 错误

我正在浏览 ParseKit 示例并尝试对其进行修改以满足我的需要并遇到此问题。一旦我将语法文件传递给 parserFromGrammar:assembler,我就会得到一个错误:

我想可能是因为我的语法文件中有带有下划线的标记名称。ParseKit 是否支持下划线?被回调的方法名称是什么?Aka 令牌名称“foo_bar”会调用方法 didMatchFoo_bar 吗?

然后我去掉了所有带下划线的名字,它仍然给我这个错误。我正在使用 ParseKit 网站上的示例语法文件:

谢谢

0 投票
1 回答
168 浏览

objective-c - 如何在 ParseKit 中匹配从文字到行尾的所有内容?

我正在尝试使用 ParseKit 在 Objective-C 中开发UCI解析器,但我需要一种方法来匹配从文字到行尾的所有内容(可能减去尾随空格)。

例如,我要解析的行是:

我的语法看起来像:

显然打印:

如何构建以这种方式标记该字符串的语法?