]> git.saurik.com Git - wxWidgets.git/blame - utils/HelpGen/src/cjparser.h
fixed mouse input handling in wxUniv: the static boxes ust be transparent
[wxWidgets.git] / utils / HelpGen / src / cjparser.h
CommitLineData
cecfc5e7
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: No names yet.
3// Purpose: Implementation of C++/Java parser
4// compatible with SourceParserBase interface
5// Author: Aleksandras Gluchovas
6// Modified by:
7// Created: 22/09/98
8// RCS-ID: $Id$
9// Copyright: (c) Aleskandars Gluchovas
d12e3536 10// Licence: wxWindows licence
cecfc5e7
VZ
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef __CJPARSESR_G__
14#define __CJPARSESR_G__
15
16#include "srcparser.h"
17
cecfc5e7
VZ
18#include <memory.h>
19#include <stdlib.h>
20#include <stdio.h>
21
a7adaeda
VZ
22#if wxUSE_IOSTREAMH
23 #include <iostream.h>
24#else
25 #include <iostream>
26#endif
27
cecfc5e7
VZ
28// class parses given "memory-resident" Java or C++ source code
29// and captures information about classes/attrubutes/methods/
d12e3536 30// arguments/etc into structures. Conforms with SourceParserBase
cecfc5e7
VZ
31// interface requirements.
32
33class CJSourceParser : public SourceParserBase
34{
35protected:
d12e3536
VZ
36 // begining of the full-text area of the source file
37 char* mpStart;
cecfc5e7 38
d12e3536
VZ
39 // points to first character after the end
40 // of teh full-text area
41 char* mpEnd;
cecfc5e7 42
d12e3536
VZ
43 // current "privacy level"
44 int mCurVis;
cecfc5e7 45
d12e3536
VZ
46 // current parsing position int full-text area
47 char* cur;
cecfc5e7 48
d12e3536
VZ
49 // about the current class
50 bool mIsVirtual;
51 bool mIsTemplate;
52 size_t mNestingLevel;
cecfc5e7 53
d12e3536
VZ
54 // context data for which is currently being collected
55 spContext* mpCurCtx;
cecfc5e7 56
d12e3536 57 int mCurCtxType; // type of the current context
cecfc5e7 58
d12e3536
VZ
59 bool mCommentsOn;
60 bool mMacrosOn;
cecfc5e7
VZ
61
62protected:
63
d12e3536
VZ
64 void AttachComments( spContext& ctx, char* cur );
65 void ParseKeyword( char*& cur );
66 bool ParseNameAndRetVal( char*& cur, bool& isAMacro );
67 bool ParseArguments( char*& cur );
68 void ParseMemberVar( char*& cur );
69 void SkipFunction( char*& cur );
70 void SkipFunctionBody( char*& cur );
71 bool CheckVisibilty( char*& cur );
cecfc5e7 72
d12e3536
VZ
73 void AddClassNode( char*& cur );
74 void AddMacroNode( char*& cur );
75 void AddEnumNode( char*& cur );
76 void AddTypeDefNode( char*& cur );
cecfc5e7 77
dd107c50
VZ
78 void DumpOperationInfo( spOperation& info, const string& tab, wxSTD ostream& os );
79 void DumpClassHeader( spClass& info, wxSTD ostream& os );
80 void DumpClassBody( spClass& info, wxSTD ostream& os );
cecfc5e7
VZ
81
82public:
83
d12e3536
VZ
84 // NOTE:: discarding of macros or comments improves performance and
85 // decreases memory usage
cecfc5e7 86
d12e3536
VZ
87 CJSourceParser(bool collectCommnets = 1,
88 bool collectMacros = 1);
cecfc5e7 89
d12e3536
VZ
90 // returns the root-node of the created context tree
91 // (user is responsible for releasing it from the heep)
92 // "end" should point to the last (character + 1) of the
93 // source text
cecfc5e7 94
d12e3536 95 virtual spFile* Parse( char* start, char* end );
cecfc5e7
VZ
96};
97
98// inline'ed helpers used (just info):
99/*
100static inline void skip_to_eol( char*& cur );
101static inline void skip_eol( char*& cur );
102static inline bool skip_to_next_comment_in_the_line( char*& cur );
103static void skip_to_prev_line( char*& cur );
104static inline void skip_comments( char*& cur );
105static inline void clear_commets_queue();
106static inline void skip_quoted_string( char*& cur );
107static inline bool get_next_token( char*& cur );
108static inline void skip_preprocessor_dir( char*& cur );
109static void skip_token( char*& cur );
110static inline size_t get_token_len( char* tok );
111static inline bool cmp_tokens( char* tok1, char* tok2 );
112static inline bool cmp_tokens_fast( char* tok1, char* tok2, size_t len );
113static inline void skip_tempalate_statement( char*& cur );
114static inline void skip_statement( char*& cur );
115static inline void skip_token_back( char*& cur );
116static inline void skip_next_token_back( char*& cur );
117static string get_token_str( char* cur );
118static size_t skip_block( char*& cur );
119static inline bool skip_imp_block( char*& cur );
120static bool is_class_token( char*& cur );
121inline static bool is_forward_decl( char* cur );
122inline static bool is_function( char* cur, bool& isAMacro );
123static inline void skip_scope_block( char*& cur );
124static void arrange_indirection_tokens_between( string& type, string& identifier );
125static bool is_keyword( char* cur );
126static inline void get_string_between( char* start, char* end, string* pStr );
127static char* set_comment_text( string& text, char* start );
128*/
129
130#endif