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 6206589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:28:38+00:00 2026-05-24T05:28:38+00:00

In compiler construction, when you talk about tokens, is a token the same like

  • 0

In compiler construction, when you talk about tokens, is a token the same like a symbol / just another term for a symbol? After some research I think to understand, that a token is a symbol with a reference to the symbol table, therefore some kind of attributed symbol / a symbol with some additional informations? Thanks for any clearfication 🙂

  • 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-24T05:28:38+00:00Added an answer on May 24, 2026 at 5:28 am

    A token is not necessarily a symbol in the symbol table.
    For example, if a token is a reserved word, then it is not entered in the symbol table. If a token is an identifier, then it will likely be entered in the symbol table.

    Take for example the following declaration:

    char s[100];
    

    A lexical analyzer could output the following tokens:

    <"char", IDENTIFIER>
    

    depending on the implementation it could be recognized as a reserved word or be entered in the symbol table as a predefined type name (I am not 100% sure here),

    <"s", IDENTIFIER>
    

    “s” is entered in symbol table as a variable identifier,

    <"[", OPEN_SQUARE_BRACKET>
    

    not entered in symbol table,

    <"100", INTEGER_LITERAL>
    

    not entered in symbol table,

    <"]", CLOSE_SQUARE_BRACKET>
    

    not entered in symbol table,

    <";", SEMI_COLON>
    

    not entered in symbol table.

    So you basically enter in the symbol table only those tokens that you need to reference later during the compilation process. E.g., later in the function body, when you find

    strcpy(s, "Hello, world\n");
    

    you recognize again the token <“s”, IDENTIFIER> and look it up in the symbol table. The symbol table will say that “s” has been declared as a variable of type char [].

    So , I would say a token is any chunk of input that is recognized by the lexical analizer, and that only certain tokens with a special meaning are entered as symbols in the symbol table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my graduate class on compiler construction we've been introduced to the concept of
After viewing lots of posts about the difference between compilers and interpreters, I'm still
So, copying the code from Introduction to Compiler Construction in Unix I wind up
I'm trying to read Compiler Construction by Niklaus Wirth. On page 23 he starts
Microsoft Visual C++ compiler has the property declaration construction __declspec( property( get=get_func_name, put=put_func_name )
If there is a POD structure, with some member variables, for example like this:
Compiler error CS0283 indicates that only the basic POD types (as well as strings,
Compiler Error Keyword 'this' is not available in the current context delegate void CallBack(int
What compiler (I'm using gcj 4.x) options should I use to generate an exe
My compiler behaves oddly when I try to pass a fixed-size array to a

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.