473,387 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

A function for parsing complex declaration's

Rav
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.

Sep 1 '06 #1
3 3257
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)
Sep 1 '06 #2
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 <nameas <english>
cast <nameinto <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>, <englishor <nameas <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

Sep 1 '06 #3

"Rav" <ra*********@gmail.comwrote 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.
Sep 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: franklini | last post by:
hello people, just wanted to say thanks again for the help in the past. i have a new problem which am wondering if any body can help me with. i have written this abtract class shape and its...
2
by: Peter Cusack | last post by:
I'm getting error C2062: type 'float' unexpected and error C2065: 'complex' : undeclared identifier when I try to compile this #include "stdafx.h #include <iostream> //Consol I/ #include <time.h>...
9
by: cmk128 | last post by:
Hi Why put * in front of the function name in the declaration? int (*write)(struct inode *, struct file *, const char *, int); thanks from Peter (cmk128@hotmail.com)
12
by: purushotammr | last post by:
Hi Can anyone guide me by providing me the code ,for the following requirement: desining parser for fortran language(parsing fortran)
5
by: Dhurandhar Bhatvadekar | last post by:
I am not sure if this is a naive question. But I have an arbitrarily long document where I know that a DOCTYPE declaration exists. I am not interested in "parsing" the document. All I am...
16
by: arne | last post by:
Hi all, imagine I call a function, but omit one of the parameters, like: foo.c: void foo( int a, int b ) { /* do something with a and b */ return; }
3
by: davebaty | last post by:
I'm relatively new to VB programming (VB 2005), and have come across a problem parsing complex text files. Basically I have a file which has lines something like the following: max_gross_weight...
1
by: wtu | last post by:
function Declaration&Definition -------------------------------------------------------------------------------- " Geroty (const vector<Point3D>& poly, const Plane& Tr)" As i'm c++ beginner...
26
by: aruna.mysore | last post by:
Hi all, I have a specific problem passing a function pointer array as a parameter to a function. I am trying to use a function which takes a function pointer array as an argument. I am too sure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.