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

Go to the source code of this file.

Functions

void parsePythonCode (CodeOutputInterface &, const char *, const QCString &, bool, const char *, FileDef *fd, int startLine, int endLine, bool inlineFragment, MemberDef *memberDef, bool showLineNumbers, Definition *searchCtx, bool collectXRefs)
 
void resetPythonCodeParserState ()
 

Function Documentation

void parsePythonCode ( CodeOutputInterface ,
const char *  ,
const QCString ,
bool  ,
const char *  ,
FileDef fd,
int  startLine,
int  endLine,
bool  inlineFragment,
MemberDef memberDef,
bool  showLineNumbers,
Definition searchCtx,
bool  collectXRefs 
)

Definition at line 4164 of file pycode.cpp.

4168 {
4169 
4170  //printf("***parseCode()\n");
4171 
4172  //--------------------------------------
4173  if (s.isEmpty()) return;
4174  printlex(pycodeYY_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
4176  g_code = &od;
4177  g_inputString = s;
4178  g_inputPosition = 0;
4179  g_currentFontClass = 0;
4181  g_searchCtx=searchCtx;
4183  if (endLine!=-1)
4184  g_inputLines = endLine+1;
4185  else
4187 
4188  if (startLine!=-1)
4189  g_yyLineNr = startLine;
4190  else
4191  g_yyLineNr = 1;
4192 
4193  g_exampleBlock = exBlock;
4194  g_exampleName = exName;
4195  g_sourceFileDef = fd;
4196 
4197  bool cleanupSourceDef = FALSE;
4198  if (fd==0)
4199  {
4200  // create a dummy filedef for the example
4201  g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
4202  cleanupSourceDef = TRUE;
4203  }
4204  if (g_sourceFileDef)
4205  {
4206  setCurrentDoc("l00001");
4207  }
4208 
4209  // Starts line 1 on the output
4210  startCodeLine();
4211 
4213 
4214  pycodeYYlex();
4215 
4216  if (!g_indents.isEmpty())
4217  {
4218  // printf("Exited pysourceparser in inconsistent state!\n");
4219  }
4220 
4221  if (g_needsTermination)
4222  {
4223  endCodeLine();
4224  }
4225  if (fd)
4226  {
4228  }
4229  if (cleanupSourceDef)
4230  {
4231  // delete the temporary file definition used for this example
4232  delete g_sourceFileDef;
4233  g_sourceFileDef=0;
4234  }
4235  printlex(pycodeYY_flex_debug, FALSE, __FILE__, fd ? fd->fileName().data(): NULL);
4236  return;
4237 }
static int g_inputLines
number of line in the code fragment
Definition: pycode.cpp:1236
bool isEmpty() const
Definition: qcstring.h:189
void printlex(int dbg, bool enter, const char *lexName, const char *fileName)
Definition: message.cpp:242
static const char * g_inputString
the code fragment as text
Definition: pycode.cpp:1230
static int countLines()
Definition: pycode.cpp:1448
static CodeOutputInterface * g_code
Definition: pycode.cpp:1229
static Definition * g_searchCtx
Definition: pycode.cpp:1234
const bool FALSE
Definition: qglobal.h:370
static bool g_exampleBlock
Definition: pycode.cpp:1250
void clearTooltips()
Definition: tooltip.cpp:54
void pycodeYYrestart(FILE *input_file)
Definition: pycode.cpp:3514
int pycodeYY_flex_debug
Definition: pycode.cpp:1147
static void setCurrentDoc(const QCString &anchor)
Definition: pycode.cpp:1467
static int g_inputPosition
read offset during parsing
Definition: pycode.cpp:1231
FILE * pycodeYYin
Definition: pycode.cpp:359
const char * data() const
Definition: qcstring.h:207
static void startCodeLine()
Definition: pycode.cpp:1525
static int g_yyLineNr
current line number
Definition: pycode.cpp:1237
void writeTooltips(CodeOutputInterface &ol)
Definition: tooltip.cpp:93
int pycodeYYlex(void)
static FileDef * g_sourceFileDef
Definition: pycode.cpp:1238
static TooltipManager * instance()
Definition: tooltip.cpp:45
QCString fileName() const
Definition: filedef.h:81
static const char * g_currentFontClass
Definition: pycode.cpp:1232
static void endCodeLine()
Definition: pycode.cpp:1585
static QCString g_exampleName
Definition: pycode.cpp:1251
static bool g_collectXRefs
Definition: pycode.cpp:1235
static QCString * s
Definition: config.cpp:1042
static QValueStack< uint > g_indents
Tracks indentation levels for scoping in python.
Definition: pycode.cpp:1261
const bool TRUE
Definition: qglobal.h:371
bool collectXRefs
static bool g_needsTermination
Definition: pycode.cpp:1233
void resetPythonCodeParserState ( )

Definition at line 4123 of file pycode.cpp.

4124 {
4125  g_currentDefinition = 0;
4126  g_currentMemberDef = 0;
4128  g_paramParens = 0;
4129  g_indents.clear();
4130  BEGIN( Body );
4131 }
const bool FALSE
Definition: qglobal.h:370
static Definition * g_currentDefinition
Definition: pycode.cpp:1239
static MemberDef * g_currentMemberDef
Definition: pycode.cpp:1240
static int g_paramParens
Definition: pycode.cpp:1247
#define BEGIN
Definition: pycode.cpp:144
#define Body
Definition: pycode.cpp:2042
static bool g_doubleStringIsDoc
Definition: pycode.cpp:1256
static QValueStack< uint > g_indents
Tracks indentation levels for scoping in python.
Definition: pycode.cpp:1261