answersLogoWhite

0

Explain c tokens

Updated: 8/10/2023
User Avatar

Wiki User

11y ago

Best Answer

In a C source program, the basic element recognized by the compiler is the "token." A token is source-program text that the compiler does not break down into component elements. Syntax

; token: : keyword identifierconstant string-literal operatorpunctuator The keywords, identifiers, constants, string literals, and operators described in this section are examples of tokens. Punctuation characters such as brackets ([ ]), braces ({ }), parentheses ( ( ) ), and commas (,) are also tokens.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

In software engineering, a token is commonly understood to be a segment of textual input data, separated from similar segments by one or more separators. For example, all text that is not a space, tab or newline character in C language code makes a token.

For example, this is a list of tokens, separated by semicolon: 123;321;ABC

The term token is frequently used in context with lexical analysis, an early stage in language compilers and interpreters.

A C compiler, for example, subjects the input (source code) to the preprocessor first. This removes all source code comments, makes "macro" substitutions and evaluates sections of conditional compilation.

The preprocessor's results are then subject to lexical analysis, which consists of separating the source into tokens, then classifying them into categories such as "keyword," "decimal number," "variable reference," etc.

The standard C runtime library also contains a strtok() API that helps breaking textual input into tokens.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

c tokens include keywords,identifiers,constants,string,special symbols & operators

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Explain c tokens
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is main by c tokens?

smallest individual units in a c program is called tokens.


What are the operators in c tokens?

All arithmetic, logical operators are operators in c tokens. As: +, - , ++, --, %, &&, &, >>, << etc.


What has the author Cecil C Tannahill written?

Cecil C. Tannahill has written: 'Trade tokens of Saskatchewan and their history' -- subject(s): Saskatchewan, Tokens, Money


What are tokens in c language?

in c program the smallest individual unit is called c-token


What has the author C W Stainsfield written?

C. W. Stainsfield has written: 'Descriptive catalogue of Australian tradesmen's tokens' -- subject(s): Accessible book, Tokens


What are the 6 types of c tokens?

A Token is the basic and the smallest unit of a programThere are 6 types of tokens in 'C'. They are:1) Keywords2) Identifiers3) Constants4) Strings5) Special symbols6) Operators


What is the token in c plus plus language?

A token in C++, and in many other computer languages as well, is the largest set of characters in the source code that meets the criteria of a single language element. Often, tokens are separated by white space, but if the context is clear, this is not required. The expression a=b+c, for instance, contains 5 tokens, a, =, b, +, and c. The expression a = b + c is identical in meaning. The "largest set" rule can be shown with the example a=b+++c. The tokens are a, =, b, ++, +, and c. This expression means to add b and c, store the result in a, and then increment b.


How many tokens are present in C?

There are 6 types of Tokens in C which are as follows:- 1. Keyword 2. Identifier 3. Constants/Literals 4. Variable 5. Operator 6. Punctuator


What has the author William C Wells written?

William C. Wells has written: 'Seventeenth Century tokens of Northamptonshire'


What has the author Alan C Henderson written?

Alan C. Henderson has written: 'Hop tokens of Kent and Sussex & their issuers'


What is token in c prog?

In a passage of text,Individual word and punctuation marks are called tokens.


How do you get super fan swag tokens in adventure quest worlds?

you have to do the quests around the globe and the quests would give D or C (if you're lucky) tokens, then you go inside the house (the place next to the Johns and Drakath) and talk to the girl in the window. the girl will have two options, QUESTS or MERGE SHOP, the merge shop is where you go. This is where it get frustrating. 1. D to C token= 10 D tokens 2. C to B token= 10 C tokens 3. B to A token= 20 B tokens then with the A token you can complete the quests given to you by Malorie, or whoever, Some good quests that you could do is: 1. For Science (Drakath), i think you need upgrade to go to the lab though 2. the giant hamster wheel in the house, click in the middle of it 3. the catapult in the far left area 4. dunno... #2 and #3 is what i do