• 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: What is a "parse error"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is a "parse error"?


  • Subject: Re: What is a "parse error"?
  • From: Brian Hill <email@hidden>
  • Date: Fri, 3 Aug 2001 11:50:52 -0500

On Friday, August 3, 2001, at 11:09 AM, Itrat Khan wrote:

On Thursday, August 2, 2001, at 11:19 PM, Scott Steinman wrote:

Upon building, I got an error stating that there was a "parse error" before NSHashTable. Removing that line of code removes the compilation error.

What is a "parse error"?

- (id) initWithContentRect: (NSRect) contentRect
styleMask: (unsigned int) aStyle
backing: (NSBackingStoreType) bufferingType
defer: (BOOL) flag
{
keyTable = [ [ NSHashTable alloc ] initKeyDesc: "i" ];
return [ super initWithContentRect: contentRect
styleMask: aStyle
backing: bufferingType
defer: flag ];
}

A parse error means the compiler couldn't parse your source file (i.e. syntax error). I can't see anything obvious in your code. In the past, I've had the compiler complain because I accidentally typed option-space instead of a space. If the code compiles without that one line, try typing that line in again (instead of pasting the line back).

Another reason you'd have parse errors is if your brackets don't match or if there's a semi-colon missing, but I don't see anything like that in your code snippet.

Another reason I've seen a parse error is if the compiler doesn't recognize a class type (for example, NSHashTable). This is happening because NSHashTable is not a class, it is a struct. Where did you find the 'initKeyDesc' method? I can't find it anywhere in Foundation.

Brian


email@hidden http://personalpages.tds.net/~brian_hill
___________________________________________________________
"Why? I came into this game for adventure - go anywhere, travel
light, get in, get out, wherever there's trouble, a man alone.
Now they've got the whole country sectioned off and you can't
move without a form. I'm the last of a breed."
-- Archibald "Harry" Tuttle, Rogue HVAC Repairman
___________________________________________________________


  • Prev by Date: Re: Vectors?
  • Next by Date: International strings
  • Previous by thread: Re: What is a "parse error"?
  • Next by thread: Re: What is a "parse error"?
  • Index(es):
    • Date
    • Thread