A function for parsing complex declaration's

Discussion in 'C Programming' started by Rav, Sep 1, 2006.

  1. Rav

    Rav Guest

    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.
     
    Rav, Sep 1, 2006
    #1
    1. Advertising

  2. 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)
     
    Richard Heathfield, Sep 1, 2006
    #2
    1. Advertising

  3. Rav

    CBFalconer Guest

    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
     
    CBFalconer, Sep 1, 2006
    #3
  4. Rav

    Malcolm Guest

    "Rav" <> 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.
     
    Malcolm, Sep 1, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.amnet.net.au
    Replies:
    1
    Views:
    581
    =?UTF-8?b?TMSByrtpZSBUZWNoaWU=?=
    Apr 13, 2004
  2. Ovidesvideo
    Replies:
    4
    Views:
    518
    Andrey Tarasevich
    Dec 10, 2004
  3. Replies:
    4
    Views:
    1,082
    Richard Tobin
    Dec 12, 2006
  4. Bolin
    Replies:
    4
    Views:
    411
  5. Luca Forlizzi
    Replies:
    4
    Views:
    464
    Luca Forlizzi
    Nov 14, 2010
Loading...

Share This Page