Click here to Skip to main content
15,881,588 members
Articles / Desktop Programming / MFC

Include File Hierarchy Viewer

Rate me:
Please Sign up or sign in to vote.
4.84/5 (108 votes)
29 Jul 2003CPOL8 min read 379.8K   4.5K   151  
A tool to view the include file hierarchy of your source code.
//====================================================================
// Although great care has gone into developing this software,
// it is provided without any guarantee of reliability, accuracy
// of information, or correctness of operation.  I am not responsible
// for any damages that may occur as a result of using this software.
// Use this software entirely at your own risk.
// Copyright 2003, Chris Richardson
//
// Description: Source level token.
//
//====================================================================

#if !defined(AFX_TOKEN_H__DA57A798_7787_49F3_9D0D_71F08C889D77__INCLUDED_)
#define AFX_TOKEN_H__DA57A798_7787_49F3_9D0D_71F08C889D77__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

enum ParseTokens
{
   TOKEN_NONE,
   TOKEN_EOF,
   TOKEN_IDENTIFIER,
   TOKEN_QUOTED_STRING,
   TOKEN_BRACKET_STRING,
   TOKEN_INTEGER,
   TOKEN_DECIMAL,
   TOKEN_STRING_LIT,
   TOKEN_CHAR_LIT,
   TOKEN_COLON_COLON,
   TOKEN_COMMA,
   TOKEN_SEMICOLON,
   TOKEN_COLON,
   TOKEN_PLUS,
   TOKEN_MINUS,
   TOKEN_MULTIPLY,
   TOKEN_DIVIDE,
   TOKEN_MODULUS,
   TOKEN_EQUAL_EQUAL,
   TOKEN_EQUAL,
   TOKEN_LBRACKET,
   TOKEN_RBRACKET,
   TOKEN_LCURLY,
   TOKEN_RCURLY,
   TOKEN_LPAREN,
   TOKEN_RPAREN,
   TOKEN_DOT,
   TOKEN_DOT_STAR,
   TOKEN_EXCLAMATION,
   TOKEN_AMPERSAND,
   TOKEN_BAR,
   TOKEN_HAT,
   TOKEN_TILDE,
   TOKEN_QUESTION,
   TOKEN_POUND,
   TOKEN_RIGHT,
   TOKEN_LEFT,
   TOKEN_RIGHT_EQUALS,
   TOKEN_LEFT_EQUALS,
   TOKEN_RIGHT_POINTER,
   TOKEN_RIGHT_POINTER_STAR,
   TOKEN_PLUS_PLUS,
   TOKEN_MINUS_MINUS,
   TOKEN_MULTIPLY_EQUALS,
   TOKEN_DIVIDE_EQUALS,
   TOKEN_MODULUS_EQUALS,
   TOKEN_PLUS_EQUALS,
   TOKEN_MINUS_EQUALS,
   TOKEN_AMPERSAND_EQUALS,
   TOKEN_AMPERSAND_AMPERSAND,
   TOKEN_BAR_EQUALS,
   TOKEN_BAR_BAR,
   TOKEN_HAT_EQUALS,
   TOKEN_EXCLAMATION_EQUALS,
   TOKEN_RIGHT_RIGHT,
   TOKEN_RIGHT_RIGHT_EQUALS,
   TOKEN_LEFT_LEFT,
   TOKEN_LEFT_LEFT_EQUALS,
};

enum UTIL_TokenFlags
{
   TOKEN_FLAG_CONST     = 1<<0,
   TOKEN_FLAG_HEX       = 1<<1,
   TOKEN_FLAG_OCT       = 1<<2,
   TOKEN_FLAG_LONG      = 1<<3,
   TOKEN_FLAG_ULONG     = 1<<4,
   TOKEN_FLAG_FLOAT     = 1<<5,
};

class CToken  
{
public:
	CToken();
	virtual ~CToken();

   void                 Reset();
   void                 Set( const TCHAR * p_pszID, unsigned long p_ulPos, ParseTokens p_eType = TOKEN_NONE );
   void                 Set( const TCHAR p_cC, unsigned long p_ulPos, ParseTokens p_eType = TOKEN_NONE );

   enum                 { MAX_TOKEN = 512 };
   TCHAR                c_szID[MAX_TOKEN];
   ParseTokens          c_eType;
   unsigned long        c_ulFlags;
   unsigned long        c_ulPos;
};

#endif // !defined(AFX_TOKEN_H__DA57A798_7787_49F3_9D0D_71F08C889D77__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
I like to program, I like to sail.

Comments and Discussions