Functions
code.h File Reference
#include "types.h"

Go to the source code of this file.

Functions

void parseCCode (CodeOutputInterface &, const char *, const QCString &, SrcLangExt lang, bool isExample, const char *exName, FileDef *fd, int startLine, int endLine, bool inlineFragment, MemberDef *memberDef, bool showLineNumbers, Definition *searchCtx, bool collectXRefs)
 
void resetCCodeParserState ()
 
void codeFreeScanner ()
 

Function Documentation

void codeFreeScanner ( )

Definition at line 16505 of file code.cpp.

16506 {
16507 #if defined(YY_FLEX_SUBMINOR_VERSION)
16508  if (g_lexInit)
16509  {
16511  }
16512 #endif
16513 }
static bool g_lexInit
Definition: code.cpp:10660
int codeYYlex_destroy(void)
Definition: code.cpp:16257
void parseCCode ( CodeOutputInterface ,
const char *  ,
const QCString ,
SrcLangExt  lang,
bool  isExample,
const char *  exName,
FileDef fd,
int  startLine,
int  endLine,
bool  inlineFragment,
MemberDef memberDef,
bool  showLineNumbers,
Definition searchCtx,
bool  collectXRefs 
)

Definition at line 16397 of file code.cpp.

16402 {
16403  //printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n",
16404  // exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>");
16405 
16406  if (s.isEmpty()) return;
16407 
16408  printlex(codeYY_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
16409 
16411  if (g_codeClassSDict==0)
16412  {
16414  }
16415  g_code = &od;
16416  g_inputString = s;
16417  g_inputPosition = 0;
16418  g_currentFontClass = 0;
16420  g_searchCtx = searchCtx;
16423  if (endLine!=-1)
16424  g_inputLines = endLine+1;
16425  else
16427 
16428  if (startLine!=-1)
16429  g_yyLineNr = startLine;
16430  else
16431  g_yyLineNr = 1;
16432 
16433  g_curlyCount = 0;
16434  g_bodyCurlyCount = 0;
16435  g_bracketCount = 0;
16436  g_sharpCount = 0;
16439  g_scopeStack.clear();
16441  //printf("parseCCode %s\n",className);
16442  g_exampleBlock = exBlock;
16443  g_exampleName = exName;
16444  g_sourceFileDef = fd;
16445  g_lineNumbers = fd!=0 && showLineNumbers;
16446  bool cleanupSourceDef = FALSE;
16447  if (fd==0)
16448  {
16449  // create a dummy filedef for the example
16450  g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
16451  cleanupSourceDef = TRUE;
16452  }
16453  g_insideObjC = lang==SrcLangExt_ObjC;
16454  g_insideJava = lang==SrcLangExt_Java;
16455  g_insideCS = lang==SrcLangExt_CSharp;
16456  g_insidePHP = lang==SrcLangExt_PHP;
16457  if (g_sourceFileDef)
16458  {
16459  setCurrentDoc("l00001");
16460  }
16461  g_currentDefinition = 0;
16462  g_currentMemberDef = 0;
16463  g_searchingForBody = exBlock;
16464  g_insideBody = FALSE;
16465  g_bracketCount = 0;
16466  if (!g_exampleName.isEmpty())
16467  {
16469  //printf("g_exampleFile=%s\n",g_exampleFile.data());
16470  }
16471  g_includeCodeFragment = inlineFragment;
16472  //printf("** exBlock=%d exName=%s include=%d\n",exBlock,exName,inlineFragment);
16473  startCodeLine();
16474  g_type.resize(0);
16475  g_name.resize(0);
16476  g_args.resize(0);
16477  g_parmName.resize(0);
16478  g_parmType.resize(0);
16479  if (memberDef) setParameterList(memberDef);
16481  BEGIN( Body );
16482  codeYYlex();
16483  g_lexInit=TRUE;
16484  if (g_needsTermination)
16485  {
16486  endFontClass();
16487  DBG_CTX((stderr,"endCodeLine(%d)\n",g_yyLineNr));
16488  g_code->endCodeLine();
16489  }
16490  if (fd)
16491  {
16493  }
16494  if (cleanupSourceDef)
16495  {
16496  // delete the temporary file definition used for this example
16497  delete g_sourceFileDef;
16498  g_sourceFileDef=0;
16499  }
16500 
16501  printlex(codeYY_flex_debug, FALSE, __FILE__, fd ? fd->fileName().data(): NULL);
16502  return;
16503 }
void codeYYrestart(FILE *input_file)
Definition: code.cpp:15772
bool resize(uint newlen)
Definition: qcstring.h:225
static const char * g_inputString
the code fragment as text
Definition: code.cpp:10606
static int g_sharpCount
Definition: code.cpp:10641
static ClassSDict * g_codeClassSDict
Definition: code.cpp:10599
static int g_curlyCount
Definition: code.cpp:10640
int codeYY_flex_debug
Definition: code.cpp:10514
bool isEmpty() const
Definition: qcstring.h:189
static QCString g_classScope
Definition: code.cpp:10621
void printlex(int dbg, bool enter, const char *lexName, const char *fileName)
Definition: message.cpp:242
static int g_inputLines
number of line in the code fragment
Definition: code.cpp:10608
static bool g_insideBody
Definition: code.cpp:10633
static int g_bracketCount
Definition: code.cpp:10639
static void endFontClass()
Definition: code.cpp:11962
int codeYYlex(void)
static bool g_collectXRefs
Definition: code.cpp:10665
static void startCodeLine()
Definition: code.cpp:11021
static CallContext g_theCallContext
Definition: code.cpp:10930
static QCString g_exampleName
Definition: code.cpp:10614
const bool FALSE
Definition: qglobal.h:370
static QCString className
Definition: declinfo.cpp:669
static bool g_lexInit
Definition: code.cpp:10660
void clearTooltips()
Definition: tooltip.cpp:54
#define Body
Definition: code.cpp:12357
void resetCCodeParserState()
Definition: code.cpp:16382
static bool g_exampleBlock
Definition: code.cpp:10613
static int g_inputPosition
read offset during parsing
Definition: code.cpp:10607
static QCString g_parmName
Definition: code.cpp:10604
static int countLines()
Definition: code.cpp:11943
static bool g_needsTermination
Definition: code.cpp:10611
static FileDef * g_sourceFileDef
Definition: code.cpp:10626
static QCString g_parmType
Definition: code.cpp:10603
static Definition * g_searchCtx
Definition: code.cpp:10664
static QStack< int > g_scopeStack
1 if bracket starts a scope,
Definition: code.cpp:10623
void clear()
Definition: code.cpp:10914
static void setParameterList(MemberDef *md)
Definition: code.cpp:11206
static QCString g_args
Definition: code.cpp:10620
static int g_yyLineNr
current line number
Definition: code.cpp:10609
static bool g_insideTemplate
Definition: code.cpp:10617
static bool g_inFunctionTryBlock
Definition: code.cpp:10642
static MemberDef * g_currentMemberDef
Definition: code.cpp:10629
static bool g_insideJava
Definition: code.cpp:10655
static QCString g_name
Definition: code.cpp:10619
const char * data() const
Definition: qcstring.h:207
static QCString g_exampleFile
Definition: code.cpp:10615
#define DBG_CTX(x)
Definition: code.cpp:10585
#define BEGIN
Definition: code.cpp:144
FILE * codeYYin
Definition: code.cpp:359
static bool g_lineNumbers
Definition: code.cpp:10627
void writeTooltips(CodeOutputInterface &ol)
Definition: tooltip.cpp:93
static bool g_searchingForBody
Definition: code.cpp:10632
static TooltipManager * instance()
Definition: tooltip.cpp:45
QCString fileName() const
Definition: filedef.h:81
static bool g_insideObjC
Definition: code.cpp:10654
QCString convertNameToFile(const char *name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:5354
static int g_bodyCurlyCount
Definition: code.cpp:10634
static void setCurrentDoc(const QCString &anchor)
Definition: code.cpp:10966
static CodeOutputInterface * g_code
Definition: code.cpp:10597
virtual void endCodeLine()=0
static bool g_insideCS
Definition: code.cpp:10656
static const char * g_currentFontClass
Definition: code.cpp:10631
static bool g_insidePHP
Definition: code.cpp:10657
static bool g_includeCodeFragment
Definition: code.cpp:10630
static QCString g_type
Definition: code.cpp:10618
static QCString * s
Definition: config.cpp:1042
const bool TRUE
Definition: qglobal.h:371
bool collectXRefs
static Definition * g_currentDefinition
Definition: code.cpp:10628
void resetCCodeParserState ( )

Definition at line 16382 of file code.cpp.

16383 {
16384  //printf("***initParseCodeContext()\n");
16387  g_classScopeLengthStack.setAutoDelete(TRUE);
16388  g_classScopeLengthStack.clear();
16389  delete g_codeClassSDict;
16390  g_codeClassSDict = new ClassSDict(17);
16394  g_anchorCount = 0;
16395 }
bool resize(uint newlen)
Definition: qcstring.h:225
void clear()
Definition: sortdict.h:276
static ClassSDict * g_codeClassSDict
Definition: code.cpp:10599
void clear()
Definition: code.cpp:10745
static VariableContext g_theVarContext
Definition: code.cpp:10860
void setAutoDelete(bool val)
Definition: sortdict.h:222
static QCString g_forceTagReference
Definition: code.cpp:10697
static QStrList g_curClassBases
Definition: code.cpp:10601
static int g_anchorCount
Definition: code.cpp:10625
static QStack< int > g_classScopeLengthStack
Definition: code.cpp:10662
const bool TRUE
Definition: qglobal.h:371