• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bison/Yacc with Objective-C ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison/Yacc with Objective-C ?


  • Subject: Re: Bison/Yacc with Objective-C ?
  • From: F van der Meeren <email@hidden>
  • Date: Wed, 10 Mar 2010 00:43:38 +0100

You can just use your objc magic inside the curly braces... All you have to do is rename your file to *.ym instead of *.y
Then all your files will be named *.m

To call upon yacc with objc code is currently a no go. Therefor you still need to call the basic yyparse methods, or add a special directive for the bison compiler to generate push/pull methods. Those can be created and deallocated at will and will run next to each other without any problems.

Filip

On 10 Mar 2010, at 00:33, Graham Cox wrote:

>
> On 10/03/2010, at 9:00 AM, Thomas Wetmore wrote:
>
>> Yacc (and Bison) convert yacc files into C files. Instead I would like to generate Objective-C files so I can use Cocoa containers classes and NSString to get Unicode for free. I do see that bison can generate C++ instead of C. Does anyone know whether there is any version of yacc or bison that has been modified to generate Objective-C? Or if there is any other parser generator available that can generate Objective-C.
>
>
> I haven't tried it, so this might be nonsense, but I think that YACC simply copies the emitted code from the source file to the final C file. That means that could be Objective-C code - you'd only need to change the file extension from .c to .m to compile it. As long as the emitted code is the only Objective-C and therefore not required to be parsed by YACC, I reckon it ought to work.
>
> --Graham
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Bison/Yacc with Objective-C ?
      • From: Thomas Wetmore <email@hidden>
References: 
 >Bison/Yacc with Objective-C ? (From: Thomas Wetmore <email@hidden>)
 >Re: Bison/Yacc with Objective-C ? (From: Graham Cox <email@hidden>)

  • Prev by Date: Using a NSTextField inside a NSMenuItem?
  • Next by Date: Re: Bison/Yacc with Objective-C ?
  • Previous by thread: Re: Bison/Yacc with Objective-C ?
  • Next by thread: Re: Bison/Yacc with Objective-C ?
  • Index(es):
    • Date
    • Thread