Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > A function for parsing complex declaration's

Reply
Thread Tools

A function for parsing complex declaration's

 
 
Rav
Guest
Posts: n/a
 
      09-01-2006
hi, i need a function, preferably a program for parsing the complex
declarations in C. Can anyone help me in this regard...i appreciate.
i work on Turbo C++ 3.0 in windows environment.
Also, plz explain the meaning and use of cdecl.
thnx in advance.

 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      09-01-2006
Rav said:

> hi, i need a function, preferably a program for parsing the complex
> declarations in C.


cdecl can do this. I refer you to FAQ 18.1, which can be found easily enough
at http://c-faq.com - the comp.lang.c FAQ site.

> Also, plz explain the meaning and use of cdecl.


See "The C Programming Language", 2nd edition, by Brian W Kernighan and
Dennis M Ritchie, Chapter 5, section 5.12, for a simplified version called
"dcl", together with source code and a full explanation of its workings.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
 
Reply With Quote
 
 
 
 
CBFalconer
Guest
Posts: n/a
 
      09-01-2006
Rav wrote:
>
> hi, i need a function, preferably a program for parsing the complex
> declarations in C. Can anyone help me in this regard...i appreciate.
> i work on Turbo C++ 3.0 in windows environment.
> Also, plz explain the meaning and use of cdecl.


Pasted as quote to avoid line wraps:

> [1] c:\c\toksplit>cdecl --help
> Type `help' or `?' for help
> cdecl> ?
> [] means optional; {} means 1 or more; <> means defined elsewhere
> commands are separated by ';' and newlines
> command:
> declare <name> as <english>
> cast <name> into <english>
> explain <gibberish>
> set or set options
> help, ?
> quit or exit
> english:
> function [( <decl-list> )] returning <english>
> array [<number>] of <english>
> [{ const | volatile | noalias }] pointer to <english>
> <type>
> type:
> {[<storage-class>] [{<modifier>}] [<C-type>]}
> { struct | union | enum } <name>
> decllist: a comma separated list of <name>, <english> or <name> as <english>
> name: a C identifier
> gibberish: a C declaration, like 'int *x', or cast, like '(int *)x'
> storage-class: extern, static, auto, register
> C-type: int, char, float, double, or void
> modifier: short, long, signed, unsigned, const, volatile, or noalias
> cdecl>


--
Some informative links:
news:news.announce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
Malcolm
Guest
Posts: n/a
 
      09-01-2006

"Rav" <(E-Mail Removed)> wrote in message .
> hi, i need a function, preferably a program for parsing the complex
> declarations in C. Can anyone help me in this regard...i appreciate.
> i work on Turbo C++ 3.0 in windows environment.
> Also, plz explain the meaning and use of cdecl.
> thnx in advance.
>

Check out my website.
There's the full source to a BASIC interpreter there. It will tell you how
to set about the parser-building problem.
Be warned that adapting it to parse C rather than BASIC will be non-trivial,
though not hard in principle.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How complex is complex? Kottiyath Python 22 03-28-2009 10:11 PM
Parsing with complex regular expressions kevin cline Java 1 04-25-2007 02:51 AM
wsdl2java: method parameter a complex type that extends another complex type Robert Mark Bram Java 0 02-04-2007 10:06 AM
[XML Schema] Content type of complex type definition with complex content Stanimir Stamenkov XML 2 10-25-2005 10:16 AM
For expert on complex loops (reposted) - complex looping problem news.amnet.net.au Java 1 04-13-2004 07:10 AM



Advertisments