Re: [UPDATE] Lex/Yacc and Cocoa
Re: [UPDATE] Lex/Yacc and Cocoa
- Subject: Re: [UPDATE] Lex/Yacc and Cocoa
- From: Sherm Pendley <email@hidden>
- Date: Fri, 19 Aug 2005 23:56:04 -0400
On Aug 19, 2005, at 10:15 PM, Miguel Arroz wrote:
I noticed that it I remove the include Cocoa/Cocoa.h directive,
gcc will signal all the expected errors (my errors, and the errors
related to ObjC classes not found). So it's the Cocoa/Cocoa.h
directiva that is causing the problem... i'm lost here!
By default, both Lex & Yacc generate files with a .c extension, so
they're compiled as C instead of Objective-C.
I worked around that by adding two custom build rules to my target:
1. Process: Lex source files
using: Custom script:
/usr/bin/flex -o${DERIVED_FILES_DIR}/$
{INPUT_FILE_BASE}.yy.cpp -P${INPUT_FILE_BASE}_ ${INPUT_FILE_PATH}
with output files:
$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).yy.cpp
2. Process: Yacc source files
using: Custom script:
/usr/bin/yacc -d -b ${INPUT_FILE_BASE} -o $
{DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.tab.cpp -p ${INPUT_FILE_BASE}_
${INPUT_FILE_PATH}
with output files:
$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).tab.cpp
$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).tab.h
Note that I'm using C++, not Objective-C, so the above has .cpp
extensions. And, I needed more than one parser in my app, and I
wanted Yacc to generate my token #defines for me, and the relevant
options are included above.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden