|
Packit |
1c1d7e |
/******************************************************************************
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* Copyright (C) 1997-2015 by Dimitri van Heesch.
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* Permission to use, copy, modify, and distribute this software and its
|
|
Packit |
1c1d7e |
* documentation under the terms of the GNU General Public License is hereby
|
|
Packit |
1c1d7e |
* granted. No representations are made about the suitability of this software
|
|
Packit |
1c1d7e |
* for any purpose. It is provided "as is" without express or implied warranty.
|
|
Packit |
1c1d7e |
* See the GNU General Public License for more details.
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* Documents produced by Doxygen are derivative works derived from the
|
|
Packit |
1c1d7e |
* input used in their production; they are not affected by this license.
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#include "fileparser.h"
|
|
Packit |
1c1d7e |
#include "outputgen.h"
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
void FileParser::parseCode(CodeOutputInterface &codeOutIntf,
|
|
Packit |
1c1d7e |
const char *, // scopeName
|
|
Packit |
1c1d7e |
const QCString & input,
|
|
Packit |
1c1d7e |
SrcLangExt, // lang
|
|
Packit |
1c1d7e |
bool, // isExampleBlock
|
|
Packit |
1c1d7e |
const char *, // exampleName
|
|
Packit |
1c1d7e |
FileDef * fileDef,
|
|
Packit |
1c1d7e |
int startLine,
|
|
Packit |
1c1d7e |
int endLine,
|
|
Packit |
1c1d7e |
bool, // inlineFragment
|
|
Packit |
1c1d7e |
MemberDef *, // memberDef
|
|
Packit |
1c1d7e |
bool showLineNumbers,
|
|
Packit |
1c1d7e |
Definition *, // searchCtx,
|
|
Packit |
1c1d7e |
bool // collectXRefs
|
|
Packit |
1c1d7e |
)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
int lineNr = startLine!=-1 ? startLine : 1;
|
|
Packit |
1c1d7e |
int length = input.length();
|
|
Packit |
1c1d7e |
int i=0;
|
|
Packit |
1c1d7e |
while (i
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
int j=i;
|
|
Packit |
1c1d7e |
while (j
|
|
Packit |
1c1d7e |
QCString lineStr = input.mid(i,j-i);
|
|
Packit |
1c1d7e |
codeOutIntf.startCodeLine(fileDef != 0 && showLineNumbers);
|
|
Packit |
1c1d7e |
if (fileDef != 0 && showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr);
|
|
Packit |
1c1d7e |
if (!lineStr.isEmpty()) codeOutIntf.codify(lineStr);
|
|
Packit |
1c1d7e |
codeOutIntf.endCodeLine();
|
|
Packit |
1c1d7e |
lineNr++;
|
|
Packit |
1c1d7e |
i=j+1;
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|