RE: Is Objective-C now a strict superset of C99?
RE: Is Objective-C now a strict superset of C99?
- Subject: RE: Is Objective-C now a strict superset of C99?
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Mon, 29 Aug 2005 08:21:53 -0400
- Thread-topic: Is Objective-C now a strict superset of C99?
Thanks! I'll get to work on using it ASAP.
Others have asked me what I plan on using this for; there are several answers.
1) I want a better texteditor than any I've run into so far. Basically, I want to be able to search not just for words that match, but for symbols + their attributes that match. E.g. search for all functions with the word 'foo' in their name, or for all variables that are of type unsigned short within functions that have the suffix 'rec' in their names. Doing so would save me a lot of time.
2) I want to be able to batch process a blob of files that someone dumps on me so that I can see whats going on. Doxygen (www.doxygen.org) can get me part way there, but need more.
3) I want to be able to combine grammars. Doxygen is equivalent to headerdoc in that it is another markup language within comments. I want to have a text editor that can understand doxygen (or any other embedded language in my source files) so that it can do context sensitive tab-completion. Currently, every time I hit the @ within a block comment, there is a 50-50 chance that I'll get a headerdoc comment or something completely different. I'd like to be able to control that.
All of this means that I'm now in the process of learning about, and designing an interactive, incremental, dynamic parser.
interactive - As you type, it parses.
incremental - You can go back and make changes to any part of the text, and the parser only needs to parse the minimal amount needed update the parse tree; this makes it much faster.
dynamic - the language can be updated while the program is running. E.g. I could be going through a bunch of C files without paying attention to the contents of block comments, but then decided that I want to start parsing doxygen or headerdoc comments. At that point the blockcomments need to be parsed rather than stripped out, which requires a change to the current grammar (the change could be very simple; just enough to have the parser call a different parser that understands doxygen. But there will need to be a dynamic change.)
The reason I wanted to know about Objective-C is because 99% of what I do is in either C99 or Objective-C.
Thanks,
Cem Karan
-----Original Message-----
From: Ladd Van Tol [mailto:email@hidden]
Sent: Fri 26-Aug-05 02:40 PM
To: Karan, Cem (Civ, ARL/CISD)
Cc: Xcode Users
Subject: Re: Is Objective-C now a strict superset of C99?
I have written such a grammar based on a pre-existing ANSI C grammar,
and Apple's documented grammar for Objective-C.
Feel free to use/modify/redistribute this grammar:
http://spiny.com/software/objc.g
It requires DParser, which you can get here:
http://dparser.sourceforge.net/
I found working with DParser a lot easier than lex/yacc, since you
don't have to clumsily fumble around with ambiguities all the time.
Also note that my grammar does not handle C99 extensions, or
Objective-C++. C99 support would be relatively easy to add, but
Objective-C++ is considerably trickier.
- Ladd
On Aug 26, 2005, at 11:29 AM, Karan, Cem (Civ, ARL/CISD) wrote:
> Unfortunately, that doesn't really answer the question. You see, I
> want to write a lex/yacc file to parse in modern Objective-C code;
> that means that I REALLY need to learn what the modern grammar for
> Objective C is.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden