My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
doctokenizer.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id: $
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #ifndef _DOCTOKENIZER_H
20 #define _DOCTOKENIZER_H
21 
22 #include <qcstring.h>
23 #include <qlist.h>
24 #include <stdio.h>
25 #include "htmlattrib.h"
26 
27 class Definition;
28 class MemberGroup;
29 
30 enum Tokens
31 {
32  TK_WORD = 1,
39  TK_SYMBOL = 8,
41  TK_RCSTAG = 10,
42  TK_URL = 11,
43 
44  RetVal_OK = 0x10000,
45  RetVal_SimpleSec = 0x10001,
46  RetVal_ListItem = 0x10002,
47  RetVal_Section = 0x10003,
48  RetVal_Subsection = 0x10004,
50  RetVal_Paragraph = 0x10006,
52  RetVal_EndList = 0x10008,
53  RetVal_EndPre = 0x10009,
54  RetVal_DescData = 0x1000A,
55  RetVal_DescTitle = 0x1000B,
56  RetVal_EndDesc = 0x1000C,
57  RetVal_TableRow = 0x1000D,
58  RetVal_TableCell = 0x1000E,
59  RetVal_TableHCell = 0x1000F,
60  RetVal_EndTable = 0x10010,
61  RetVal_Internal = 0x10011,
62  RetVal_SwitchLang = 0x10012,
63  RetVal_CloseXml = 0x10013,
65  RetVal_CopyDoc = 0x10015,
66  RetVal_EndInternal = 0x10016,
68 };
69 
71 struct TokenInfo
72 {
73  // unknown token
75 
76  // command token
77  QCString name;
78 
79  // command text (RCS tag)
80  QCString text;
81 
82  // comment blocks
83 
84  // list token info
85  bool isEnumList;
86  int indent;
87 
88  // sections
89  QCString sectionId;
90 
91  // simple section
92  QCString simpleSectName;
93  QCString simpleSectText;
94 
95  // verbatim fragment
96  QCString verb;
97 
98  // xrefitem
99  int id;
100 
101  // html tag
103  bool endTag;
104  bool emptyTag;
105 
106  // whitespace
107  QCString chars;
108 
109  // url
111 
112  // param attributes
113  enum ParamDir { In=1, Out=2, InOut=3, Unspecified=0 };
115 };
116 
117 // globals
118 extern TokenInfo *g_token;
119 extern int doctokenizerYYlineno;
120 extern FILE *doctokenizerYYin;
121 
122 // helper functions
123 const char *tokToString(int token);
124 
125 // operations on the scanner
126 void doctokenizerYYFindSections(const char *input,Definition *d,
127  MemberGroup *mg,const char *fileName);
128 void doctokenizerYYinit(const char *input,const char *fileName);
129 void doctokenizerYYcleanup();
132 int doctokenizerYYlex();
158 void doctokenizerYYsetInsidePre(bool b);
159 void doctokenizerYYpushBackHtmlTag(const char *tag);
166 
167 #endif