473,396 Members | 1,970 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,396 software developers and data experts.

C tokens

Lexical generators such as Bison, Flex, Lex, &c produce C tokens for the
parser or compiler. What do these C tokens look like? According to ANSI C,
what does the standard have to say about C tokens? Does anyone know?

Bill
Nov 14 '05 #1
6 3591
Bill Cunningham wrote:

Lexical generators such as Bison, Flex, Lex, &c produce C tokens for the
parser or compiler. What do these C tokens look like? According to ANSI C,
what does the standard have to say about C tokens? Does anyone know?


The Standard defines "preprocessing token" and "token,"
but nothing called a "C token."

A "preprocessing token" is a header name, an identifier,
a "pp-number," a character constant, a string literal, or a
punctuator.

A "token" is a keyword, an identifier, a constant, a string
literal, or a punctuator.

You'll notice a certain amount of overlap. This arises from
the way the Standard describes the translation of C source code
into executable programs: in the early stages of translation
(roughly speaking, up through the point where the preprocessor
has finished its work), the translation is described in terms of
converting incoming characters into preprocessing tokens and
performing various manipulations on them. Later stages convert
the preprocessing tokens into tokens, and attach various meanings
to them. For example, the two terms make it easy to explain why
`sizeof' cannot be evaluated by the preprocessor.

What do these preprocessing tokens and tokens "look like?"
Whatever the implementor finds convenient and pleasing. The
compiler will typically build data structures describing the
preprocessing tokens and tokens constructed from the source, and
will record various bits of useful information to assist the
further actions of the translation. An "identifier," for example,
will probably carry an indication of its scope, of its linkage
(internal, external, or none), and a description of the thing
it names. It might also carry additional handy information like
"The `&' operator is never applied to this identifier, so it's
eligible to be put into a register" -- but all such decorations
are at the implementor's whim.

Personally, I favor a sort of deep teal -- long on the blue,
and not too much green.

--
Er*********@sun.com
Nov 14 '05 #2
"Bill Cunningham" <no****@nspam.net> wrote in message
news:10*************@corp.supernews.com...
Lexical generators such as Bison, Flex, Lex, &c produce C tokens for the parser or compiler. What do these C tokens look like? According to ANSI C,
what does the standard have to say about C tokens? Does anyone know?


Bill, I see your name popping up in lots of different newsgroups with *very*
confused posts.
You are learning C, win32 API, ActiveX/OLE and DirectX all at once? You
would be better off if you spend some time coding only standard C and only
when you are comfortable with it you should learn a new API. And please, one
at a time.
Nov 14 '05 #3
Bill, I see your name popping up in lots of different newsgroups with *very* confused posts.
You are learning C, win32 API, ActiveX/OLE and DirectX all at once? You
would be better off if you spend some time coding only standard C and only
when you are comfortable with it you should learn a new API. And please, one at a time.

I've given up. Atleast for now on directx. I am interested in win32 API
and COM as well as C++. <sigh> yes Ibelieve I have a little too much on my
plate. I've found a couple of good C tutorials though and I'm going to focus
on them. Then after learning C thoughly as I should've long ago, I may move
on to C++ and win32/COM programming.

Bill

Nov 14 '05 #4
kal
"Bill Cunningham" <no****@nspam.net> wrote in message news:<10*************@corp.supernews.com>...

I've given up. Atleast for now on directx. I am interested in win32 API
and COM as well as C++. <sigh> yes Ibelieve I have a little too much on my
plate. I've found a couple of good C tutorials though and I'm going to focus
on them. Then after learning C thoughly as I should've long ago, I may move
on to C++ and win32/COM programming.


FYI: "COM" is now obsolete. It has been replaced by .NET.
Nov 14 '05 #5
In <a5**************************@posting.google.com > k_*****@yahoo.com (kal) writes:
FYI: "COM" is now obsolete. It has been replaced by .NET.


Who cares?

If you feel compelled to make such a comment, use private email for this
purpose!

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #6
Dan Pop wrote:
In <a5**************************@posting.google.com > k_*****@yahoo.com (kal) writes:

FYI: "COM" is now obsolete. It has been replaced by .NET.

Who cares?

If you feel compelled to make such a comment, use private email for this
purpose!


Especially when it's not even a true statement. I'll leave it at that
since COM and .NET totally off-topic for this newsgroup.
Nov 14 '05 #7

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

Similar topics

0
by: Jonathan Fine | last post by:
I'm sort of wishing to convert TeX tokens into characters. We can assume the standard (i.e. plain) category codes. And that the characters are to be written to a file. This proceess to take...
2
by: Aurelien Mazurie | last post by:
Hello to all, I'm trying to do a weird (?) thing with regexp and MySQL. For example, i have a column with: token1|token2|token3 (three tokens separated by pipes) I'm trying to write an SQL...
10
by: Christopher Benson-Manica | last post by:
(if this is a FAQ, I apologize for not finding it) I have a C-style string that I'd like to cleanly separate into tokens (based on the '.' character) and then convert those tokens to unsigned...
7
by: Steven Woody | last post by:
in C, is there any function can be used to decompose tokens from a string? if not, can i find it in CPP? thanks! -- steven woody (id: narke) Celine: Well, who says relationships have to last...
4
by: Jay Nesbitt | last post by:
Is there a quick way to extract tokens from a string of text? I know Java provides a StringTokenizer class to do this. Is there something similar in the dot net framework? Ex. string s = "some...
0
by: kamal9 | last post by:
#include <stdio.h> #include <string.h> void string2Lines(char line, char tokens){ char *token_ptr, token; char *i=";" " " "," "." "?" "!"; token_ptr = strtok(line, i ); while(token_ptr){...
1
by: kara18 | last post by:
Hi, After splitting a string in to tokens using strtok ,how can I get the tokens in to different arrays. for example char str = "now # is the time for all # good men to come to the # aid of...
5
by: gpaps87 | last post by:
hi, i wanted to know whether we can use strtok command to mark delimiters as tokens as well.In Java,we have a command: StringTokennizer(String str, String delimiters, boolean delimAsToken) ...
14
by: mdh | last post by:
Hi all, From p 125, gives rise to this issue for me. Is it true that a "token" in C ( philisophically ) is the least amount of digits/chars/underscores/*s ( and other non blank space that I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.