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 
70 /** @brief Data associated with a token used by the comment block parser. */
71 struct TokenInfo
72 {
73  // unknown token
75 
76  // command token
78 
79  // command text (RCS tag)
81 
82  // comment blocks
83 
84  // list token info
85  bool isEnumList;
86  int indent;
87 
88  // sections
90 
91  // simple section
94 
95  // verbatim fragment
97 
98  // xrefitem
99  int id;
100 
101  // html tag
103  bool endTag;
104  bool emptyTag;
105 
106  // whitespace
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
void doctokenizerYYsetStateDbOnly()
void doctokenizerYYsetStatePattern()
void doctokenizerYYsetStateAnchor()
TokenInfo * g_token
void doctokenizerYYsetStateSnippet()
void doctokenizerYYpushBackHtmlTag(const char *tag)
void doctokenizerYYsetStateRef()
void doctokenizerYYsetStatePlantUML()
QCString simpleSectText
Definition: doctokenizer.h:93
ParamDir paramDir
Definition: doctokenizer.h:114
void doctokenizerYYcleanup()
void doctokenizerYYsetStateDot()
void doctokenizerYYsetStateTitle()
QCString sectionId
Definition: doctokenizer.h:89
static constexpr double mg
Definition: Units.h:145
void doctokenizerYYsetStateManOnly()
bool emptyTag
Definition: doctokenizer.h:104
void doctokenizerYYsetStateVerbatim()
int doctokenizerYYlex()
void doctokenizerYYsetStateLink()
static int input(void)
Definition: code.cpp:15695
fileName
Definition: dumpTree.py:9
QCString chars
Definition: doctokenizer.h:107
QCString simpleSectName
Definition: doctokenizer.h:92
void doctokenizerYYsetStatePlantUMLOpt()
void doctokenizerYYstartAutoList()
char unknownChar
Definition: doctokenizer.h:74
void doctokenizerYYsetStateHtmlOnly()
void doctokenizerYYFindSections(const char *input, Definition *d, MemberGroup *mg, const char *fileName)
Tokens
Definition: doctokenizer.h:30
QCString text
Definition: doctokenizer.h:80
void doctokenizerYYsetStateSkipTitle()
void doctokenizerYYsetStateLatexOnly()
HtmlAttribList attribs
Definition: doctokenizer.h:102
void doctokenizerYYsetInsidePre(bool b)
Data associated with a token used by the comment block parser.
Definition: doctokenizer.h:71
FILE * doctokenizerYYin
QCString verb
Definition: doctokenizer.h:96
QCString name
Definition: doctokenizer.h:77
void doctokenizerYYinit(const char *input, const char *fileName)
void doctokenizerYYsetStateCite()
void doctokenizerYYsetStateCode()
void doctokenizerYYsetStateFile()
int doctokenizerYYlineno
bool doctokenizerYYpopContext()
bool isEnumList
Definition: doctokenizer.h:85
static bool * b
Definition: config.cpp:1043
void doctokenizerYYendAutoList()
void doctokenizerYYsetStateXRefItem()
void doctokenizerYYsetStateInternalRef()
bool isEMailAddr
Definition: doctokenizer.h:110
void doctokenizerYYsetStateXmlCode()
void doctokenizerYYsetStateXmlOnly()
void doctokenizerYYsetStatePara()
A list of Html attributes.
Definition: htmlattrib.h:32
void doctokenizerYYsetStateText()
void doctokenizerYYsetStateRtfOnly()
void doctokenizerYYsetStateParam()
void doctokenizerYYsetStateMsc()
const char * tokToString(int token)
void doctokenizerYYpushContext()
void doctokenizerYYsetStateSetScope()
void doctokenizerYYsetStateTitleAttrValue()