Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6974243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:12:44+00:00 2026-05-27T17:12:44+00:00

I study source codes of programs, (written in c++) that operate on file streams.

  • 0

I study source codes of programs, (written in c++) that operate on file streams. But every now and then i stumble upon something called tokens. Can you please explain to me, what tokens do and why are they useful? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:12:44+00:00Added an answer on May 27, 2026 at 5:12 pm

    Stream refers to a sequence of data elements made available over time. Data elements in streams could be of any kind: characters, strings, special-purpose data structures, etc. A text file could be trivially interpreted as a stream of characters.

    In the context of programming languages, the word token usually refers to a sequence of one or more related characters from a stream of characters. Tokens offer a level of abstraction on top of character streams, and are often themselves grouped in streams for further processing.

    The usual processing sequence in compilers of programming languages starts with lexical analyzers converting streams of characters into streams of tokens, which are then passed on to parsers. Typical representation of a token consists of a type indicator and the content of the token.

    Here is an example: consider this fragment of C++ program:

    class MyClass {
    public:
        string name;
    };
    

    A lexer analyzer groups this program into a stream of ten tokens:

    'class' (keyword)
    'MyClass' (identifier)
    '{' (opening brace)
    'public' (keyword)
    ':' (colon)
    'string' (identifier)
    'name' (identifier)
    ';' (semicolon)
    '}' (closing brace)
    ';' (semicolon)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting study java2me. But I have some source study about it like
Are there any good resources that would help me study Hadoop's source code? I'm
I would like to use an open source library that's written in Java to
I'm looking for source code for a web based study group. I'd prefer something
I like to study languages outside my comfort zone, but I've had a hard
I've been developing GPL'd software for years, but now I need a more restrictive
I know that Android is an open source system, so all the code should
I want to study the changes made to Google Chrome's source code which is
I'm study java.util.concurrent library and find many infinite loops in the source code, like
Downloaded a few open source php scripts such as Wordpress and Moodle to study

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.