20%option never-interactive
 
   21%option prefix="xmlcodeYY"
 
   23%option extra-type="struct xmlcodeYY_state *"
 
   30#define YY_TYPEDEF_YY_SCANNER_T 
   53#define YY_NEVER_INTERACTIVE 1 
   55#define YY_NO_UNISTD_H 1 
  105#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size); 
The common base class of all entity definitions found in the sources.
 
A model of a file symbol.
 
A model of a class/file/namespace member symbol.
 
Class representing a list of different code generators.
 
This is an alternative implementation of QCString.
 
Web server based search engine.
 
const char * currentFontClass
 
const Definition * currentDefinition
 
const FileDef * sourceFileDef
 
const MemberDef * currentMemberDef
 
int yyLineNr
current line number
 
int inputPosition
read offset during parsing
 
std::unique_ptr< FileDef > exampleFileDef
 
const char * inputString
the code fragment as text
 
int inputLines
number of line in the code fragment
 
const Definition * searchCtx
 
A bunch of utility functions.
 
static void endCodeLine(yyscan_t yyscanner)
 
static void nextCodeLine(yyscan_t yyscanner)
 
static void startCodeLine(yyscan_t yyscanner)
 
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
 
static int countLines(yyscan_t yyscanner)
 
static const char * stateToString(int state)
 
static void startFontClass(yyscan_t yyscanner, const char *s)
 
static void codifyLines(yyscan_t yyscanner, const char *text)
 
static const char * getLexerFILE()
 
static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor)
 
static void codify(yyscan_t yyscanner, const char *text)
 
static void endFontClass(yyscan_t yyscanner)
 
  117namestart   [A-Za-z\200-\377_]
 
  118namechar    [:A-Za-z\200-\377_0-9.-]
 
  119esc         "&#"[0-9]+";"|"&#x"[0-9a-fA-F]+";"
 
  120name        {namestart}{namechar}*
 
  121comment     {open}"!--"([^-]|"-"[^-])*"--"{close}
 
  122cdata       {open}"![CDATA["([^\]]|"\]"[^\]])*"]]"{close}
 
  123string      \"([^\"&]|{esc})*\"|\'([^'&]|{esc})*\'
 
static void codifyLines(yyscan_t yyscanner, const QCString &text)
 
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
 
static void codify(yyscan_t yyscanner, const QCString &text)
 
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
 
  163                        char openBracket[] = { yytext[0], 
'\0' };
 
  164                        codify(yyscanner,openBracket);
 
  174{open}{ws}?"/"{name} {
 
  176                        char closeBracket[] = { yytext[0], yytext[1], 
'\0' };
 
  178                        codify(yyscanner,closeBracket);
 
  213  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  214  int inputPosition = yyextra->inputPosition;
 
  215  const char *s = yyextra->inputString + inputPosition;
 
  217  while( c < max_size && *s)
 
  222  yyextra->inputPosition += c;
 
 
  228  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  229  yyextra->code->codify(text);
 
 
  234  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  237    if (yyextra->searchCtx)
 
 
  254  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  255  if (yyextra->sourceFileDef)
 
  257    const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
 
  261      yyextra->currentDefinition = d;
 
  262      yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
 
  264      yyextra->classScope = d->
name();
 
  266      lineAnchor.
sprintf(
"l%05d",yyextra->yyLineNr);
 
  267      if (yyextra->currentMemberDef)
 
  269        yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
 
  270                            yyextra->currentMemberDef->getOutputFileBase(),
 
  271                            yyextra->currentMemberDef->anchor(),yyextra->yyLineNr,
 
  272                            !yyextra->includeCodeFragment);
 
  280                            !yyextra->includeCodeFragment);
 
  287                                     !yyextra->includeCodeFragment);
 
  291  yyextra->code->startCodeLine(yyextra->yyLineNr);
 
  292  yyextra->insideCodeLine = 
true;
 
  294  if (yyextra->currentFontClass)
 
  296    yyextra->code->startFontClass(yyextra->currentFontClass);
 
 
  302  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  303  if (yyextra->currentFontClass)
 
  305    yyextra->code->endFontClass();
 
  306    yyextra->currentFontClass=0;
 
 
  312  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  314  yyextra->code->endCodeLine();
 
  315  yyextra->insideCodeLine = 
false;
 
 
  320  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  321  const char *fc = yyextra->currentFontClass;
 
  322  if (yyextra->insideCodeLine)
 
  326  if (yyextra->yyLineNr<yyextra->inputLines)
 
  328    yyextra->currentFontClass = fc;
 
 
  335  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  336  const char *p=text,*sp=p;
 
  342    while ((c=*p++) && c!=
'\n') { }
 
  346      size_t l = 
static_cast<size_t>(p-sp-1);
 
  347      yyextra->code->codify(
QCString(sp,l));
 
  352      yyextra->code->codify(sp);
 
 
  360  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  362  yyextra->code->startFontClass(s);
 
  363  yyextra->currentFontClass=s;
 
 
  369  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  370  const char *p=yyextra->inputString;
 
  376    if (c==
'\n') count++;
 
  378  if (p>yyextra->inputString && *(p-1)!=
'\n')
 
 
  396  xmlcodeYYlex_init_extra(&
p->state,&
p->yyscanner);
 
 
  405  xmlcodeYYlex_destroy(
p->yyscanner);
 
 
  410  struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
 
  411  yyextra->currentDefinition = 
nullptr;
 
  412  yyextra->currentMemberDef = 
nullptr;
 
 
  419               bool stripCodeComments,
 
  433  struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
 
  438  yyextra->fileName      = fileDef ? fileDef->
fileName():
"";
 
  440  yyextra->code = &codeOutIntf;
 
  441  yyextra->inputString   = input.
data();
 
  442  yyextra->inputPosition = 0;
 
  443  yyextra->currentFontClass = 
nullptr;
 
  444  yyextra->insideCodeLine = 
false;
 
  445  yyextra->searchCtx = searchCtx;
 
  448    yyextra->yyLineNr    = startLine;
 
  450    yyextra->yyLineNr    = 1;
 
  453    yyextra->inputLines  = endLine+1;
 
  455    yyextra->inputLines  = yyextra->yyLineNr + 
countLines(yyscanner) - 1;
 
  457  yyextra->stripCodeComments = stripCodeComments;
 
  458  yyextra->exampleBlock  = isExampleBlock;
 
  459  yyextra->exampleName   = exampleName;
 
  460  yyextra->sourceFileDef = fileDef;
 
  462  if (isExampleBlock && fileDef==0)
 
  466    yyextra->sourceFileDef = yyextra->exampleFileDef.get();
 
  469  if (yyextra->sourceFileDef)
 
  474  yyextra->includeCodeFragment = inlineFragment;
 
  478  xmlcodeYYrestart( 
nullptr, yyscanner );
 
  480  xmlcodeYYlex(yyscanner);
 
  482  if (yyextra->insideCodeLine)
 
  486  if (yyextra->exampleFileDef)
 
  489    yyextra->exampleFileDef.reset();
 
  490    yyextra->sourceFileDef=
nullptr;
 
 
  495#include "xmlcode.l.h" 
static bool isFlagSet(const DebugMask mask)
 
virtual bool isLinkableInProject() const =0
 
virtual QCString getReference() const =0
 
virtual QCString getOutputFileBase() const =0
 
virtual const QCString & name() const =0
 
static SearchIndexIntf searchIndex
 
virtual QCString fileName() const =0
 
bool isEmpty() const
Returns TRUE iff the string is empty.
 
QCString & sprintf(const char *format,...)
 
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
 
std::unique_ptr< Private > p
 
void parseCode(OutputCodeList &codeOutIntf, const QCString &scopeName, const QCString &input, SrcLangExt, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE) override
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
 
~XMLCodeParser() override
 
void resetCodeParserState() override
Resets the state of the code parser.
 
static void endCodeLine(yyscan_t yyscanner)
 
static void nextCodeLine(yyscan_t yyscanner)
 
static void startCodeLine(yyscan_t yyscanner)
 
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
 
static int countLines(yyscan_t yyscanner)
 
static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor)
 
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
 
const char * qPrint(const char *s)