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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:46:32+00:00 2026-05-17T23:46:32+00:00

I am currently writing a token recognizer for XML. I am going along the

  • 0

I am currently writing a token recognizer for XML. I am going along the basis of FSA’s to do so. So I have a Header file that has the following code…

#define MAX_LENGTH    512
#define  MAX_NAME  25

struct token 
{
  char name[MAX_NAME + 1];
  int type;
  unsigned char str[MAX_LENGTH + 1];
 };

 #define TOKEN_TYPES 8

 #define SPACES  0
 #define NEWLINE  1
 #define WORD  2
 #define BEGINTAG  3
 #define ENDTAG  4
 #define EMPTYTAG 5
 #define ERROR 6
 #define ENDFILE 7

With this I am getting the error:

error C2011: 'token' : 'struct' type redefinition

I am also getting another strange error in my gettoken.cpp file. Where I actually implement the FSA. The File is far to long to display the entire contents. But with this I am getting the error…

error C1014: too many include files : depth = 1024

And here is part of the code for that .cpp file. I will only include my imports in this.

#include  <iostream>
#include  <fstream>
#include  <stdlib.h>
#include  <string>
#include  "Token.h"

using namespace std;

I am sure it is something silly as it usually is for me. But please help me out! Thanks!

  • 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-17T23:46:33+00:00Added an answer on May 17, 2026 at 11:46 pm

    I assume you’re somehow including your header file twice. Do you have a guard against that? Every header file should have this:

    #ifndef TOKEN_H
    #define TOKEN_H
    
    [your header file code]
    
    #endif
    

    If that’s not it, make sure you’re not defining token twice somewhere else.

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

Sidebar

Related Questions

I'm writing an application in Python that is going to have a lot of
I have an endpoint in an API I'm currently writing that is meant to
I am currently writing an HTML token recognizer in c++. I am using stacks
I am currently writing a program that reads records from a txt file and
I am currently writing a program using Weka that builds a model (using one
I'm currently writing a simple app that performs a series of requests to the
I'm currently writing a function what would create a zip file, which will be
I am currently writing a simple IOS app that saves tasks into a table.
I'm currently writing a Powershell script that's used to select a user from Active
I am currently writing a Java compiler and have implemented section 15.12.2.7. of the

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.