PhoenixLecture  2.0.0
Set of tools to make lectures
PGenericParser Class Referenceabstract

Generic parser. More...

#include <PGenericParser.h>

+ Inheritance diagram for PGenericParser:
+ Collaboration diagram for PGenericParser:

Public Member Functions

void addCommentConfig (const PMultiCommentConfig &commentConfig)
 Adds a comment config for the parser. More...
 
void addCommentConfig (const PString &beginStringComment, const PString &endStringComment="\n")
 Adds a comment config for the parser. More...
 
bool checkExpectedMatch (const PString &tokenExpected, const PString &tokenBefore="")
 Check if the tokenExpected match. More...
 
bool checkExpectedToken (const PString &tokenExpected, const PString &tokenBefore="")
 Check if the p_currentToken == tokenExpected. More...
 
void clearComment ()
 Clear comment. More...
 
void errorAt ()
 Write a parsing error. More...
 
bool fullParsing ()
 Perform the full parsing pf data. More...
 
bool getBookEnableFeedback () const
 Say if the book feedback if enable or not. More...
 
const PStringgetBookGitlabUrl () const
 Get the book gitlab url. More...
 
const PStringgetBookMail () const
 Get the book mail list. More...
 
const PLatexObjgetBookMainPageLink () const
 Get the book main page link. More...
 
const PStringgetBookMasterProjectUrl () const
 Get the book master project url. More...
 
const PStringgetBookSideBarWidth () const
 Get the width of the book sidebar. More...
 
PFileParsergetCurrentParser ()
 Gets the current parser. More...
 
void getCurrentTokenWithoutComment ()
 Get the current token and skip the comment. More...
 
PStringgetLastComment ()
 Get the last comment. More...
 
const PStringgetLastComment () const
 Get the last comment. More...
 
PMapBiblioEntrygetMapBiblioEntry ()
 Get the map of all bibliography entries. More...
 
const PMapBiblioEntrygetMapBiblioEntry () const
 Get the map of all bibliography entries. More...
 
PLatexObjgetSource ()
 Get the current source. More...
 
const PLatexObjgetSource () const
 Get the current source. More...
 
PString getStrComposedOf (const PString &charset)
 Get the string composed of charset charcters. More...
 
std::vector< PString > & getVecIncludeDir ()
 Get the vector of include directories. More...
 
const std::vector< PString > & getVecIncludeDir () const
 Get the vector of include directories. More...
 
bool isMatch (const PString &patern, const PString &forbiddenCharBefore)
 Says if the patern match with the current caracters of the PFileParser. More...
 
bool isMatch (const PString &token)
 Check if the given token matches the current read file. More...
 
PString isMatch (const PVecString &vecToken)
 Check if the one entry of the vector of token matches. More...
 
bool isMatchRewind (const PString &token)
 Check if the given token matches the current read file and goes back even if the token matches. More...
 
bool isMatchSeq (const PVecString &patern, bool alwaysPopBack=false)
 Match a sequence of token in a vector. More...
 
PString isMatchToken (const PVecString &vecToken)
 Check the matching between the current caracters and all the string in the vector but treats the string as a token (cannot be part of a word) More...
 
bool load (const PPath &configFile)
 Load the PMultiFileParser with the configFile. More...
 
PGenericParseroperator= (const PGenericParser &other)
 Definition of equal operator of PGenericParser. More...
 
 PGenericParser (const PGenericParser &other)
 Copy constructor of PGenericParser. More...
 
 PGenericParser (const PString &installPrefix="")
 Default constructor of PGenericParser. More...
 
void pointAtRow ()
 Point the problem. More...
 
bool saveCss ()
 Save the css file. More...
 
void setDebugMode (bool isDebugMode)
 Set if the PGenericParser is in debug mode. More...
 
void setFileContent (const PString &fileContent)
 Set the file content to be parsed. More...
 
void skipComment ()
 Skip comment. More...
 
void stopParsing ()
 Stop the parsing of all the files. More...
 
void unexpectedToken ()
 Print unexpected token error. More...
 
virtual ~PGenericParser ()
 Destructor of PGenericParser. More...
 

Protected Member Functions

void addLatexObj (PLatexObj &parent, const PLatexObj &obj)
 Add latex obj in parent. More...
 
void clearLatexObj (PLatexObj &obj)
 Clear a latex obj. More...
 
PPath copyFile (const PPath &outputDir, const PPath &fileName)
 Copy a file. More...
 
void copyPGenericParser (const PGenericParser &other)
 Copy function of PGenericParser. More...
 
PString executeLatexCommand (const PString &inputStr)
 Execute the given latex command. More...
 
PPath getAbsoluteFileName (const PPath &fileName)
 Get the absolute path of a file. More...
 
PString getOptionStringBetweenBraces ()
 Get optional string between braces {...}. More...
 
PString getOptionStringBetweenHook ()
 Get optional string between hooks [...]. More...
 
PString getStringBetweenBraces (const PString &previousToken)
 Get the string between the braces {...}. More...
 
void incrementCurrentChar (PLatexObj &textObj)
 Increment current char position. More...
 
void loadCss (const PPath &inputDir)
 Load the css. More...
 
void loadDirExtraEnvironement (const PPath &inputDir)
 Load the extra environements. More...
 
void loadDirExtraEnvironementFile (const PPath &inputFile)
 Load the extra environements with input file. More...
 
void loadDirExtraFunction (const PPath &inputDir)
 Load the extra functions. More...
 
void loadDirExtraFunctionFile (const PPath &inputFile)
 Load the extra functions with input file. More...
 
void loadDirExtraParser (const PPath &inputDir)
 Load the extra parsers. More...
 
void loadDirExtraParserFile (const PPath &inputFile)
 Load the extra environements with input file. More...
 
void loadMapFile ()
 Load the map of copied files. More...
 
bool parseBookEnableFeedback (PLatexObj &parent, PLatexObj &textObj)
 Parse the book enable feedback mode. More...
 
bool parseBookGitlabUrl (PLatexObj &parent, PLatexObj &textObj)
 Parse the gitlab url in book mode. More...
 
bool parseBookMail (PLatexObj &parent, PLatexObj &textObj)
 Parse the mail in book mode. More...
 
bool parseBookMasterProject (PLatexObj &parent, PLatexObj &textObj)
 Parse the master project in book mode. More...
 
bool parseBookSizeBarWidth (PLatexObj &parent, PLatexObj &textObj)
 Parse the width of the book sidebar. More...
 
virtual bool parseFile ()=0
 
bool parseGenericLatexObj (PLatexObj &parent, PLatexObj &textObj)
 Parse the generic latex function which have to be used in the latex parser and the markdown parser too. More...
 
bool parseLabel (PLatexObj &parent, PLatexObj &textObj)
 Parse latex label. More...
 
bool parseMainAuthor (PLatexObj &parent, PLatexObj &textObj)
 Parse the main author of the site. More...
 
bool parseMainDate (PLatexObj &parent, PLatexObj &textObj)
 Parse the main date of the site. More...
 
bool parseMainSubTitle (PLatexObj &parent, PLatexObj &textObj)
 Parse the main title of the site. More...
 
bool parseMainTitle (PLatexObj &parent, PLatexObj &textObj)
 Parse the main title of the site. More...
 
bool parseMonoParam (PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
 Parse all the functions which have mono parameter in braces {...}. More...
 
bool parserGetEnv (PLatexObj &parent, PLatexObj &textObj)
 Parse a getenv function. More...
 
bool playTextLatexObj (PLatexObj &parent, PLatexObj &textObj, bool isRemoveFirstLastSpace=false)
 Play the text latex obj. More...
 
virtual void postLoadFile ()
 Post load file. More...
 
virtual void preLoadFile ()
 Pre load file. More...
 
void saveMapFile ()
 Save the map of copied files. More...
 

Protected Attributes

PString p_bookGitlabUrl
 Gitlab url of the current sources of the project. More...
 
PString p_bookMail
 Mail to be used to contact authors in book mode. More...
 
PLatexObj p_bookMainPageLink
 Main page definition of the full site. More...
 
PString p_bookMasterProjectUrl
 Master project url in book mode. More...
 
PString p_bookSideBarWidth
 Witdh of the book side bar. More...
 
std::map< PString, PStringp_cssContent
 Css of all the configurations. More...
 
PLatexObj p_currentSource
 Current completed source. More...
 
PLatexObj p_currentText
 Current text. More...
 
PString p_currentToken
 CurrentToken parsed. More...
 
PPath p_inputDirectory
 Input directory of the parser. More...
 
bool p_isDebugMode
 True if be parse in debug mode. More...
 
bool p_isEnableBookFeedback
 True to enable feedback in book mode. More...
 
PString p_lastComment
 last comment More...
 
std::list< PFileParserp_listFileParser
 List of all the parsers for all the loaded files. More...
 
PMapBiblioEntry p_mapBiblioEntry
 Map of all bibliography entries. More...
 
PMapFile p_mapCopiedFile
 Map of copied files. More...
 
PPath p_outputDirectory
 Output directory of the parser. More...
 
PFileParserp_parser
 Parser helper for the config file. More...
 
bool p_run
 Run the parsing if true. More...
 
PVecLatexEnv p_vecEnv
 Vector of all the environements. More...
 
PMapExtraEnv p_vecExtraEnv
 Vector of extra environements. More...
 
PMapExtraEnv p_vecExtraFunction
 Vector of extra function. More...
 
PVecParserEnv p_vecExtraParser
 Vector of extra parser. More...
 
PVecLatexFunc p_vecFunc
 Vector of all the functions. More...
 
std::vector< PStringp_vecIncludeDir
 Vector of the include directories. More...
 
std::vector< PStringp_vecNameExtraEnv
 Vector of the name of the extra environement. More...
 
std::vector< PStringp_vecNameExtraFunction
 Vector of the name of the extra function. More...
 
std::vector< PStringp_vecNameExtraParser
 Vector of the name of the extra environement. More...
 
std::vector< PStringp_vecNameFunctionExtraEnv
 Vector of the name of the extra environement. More...
 
std::vector< PStringp_vecNameFunctionExtraParser
 Vector of the function name of the extra environement. More...
 
std::vector< PStringp_vecNameMarkdownExtraEnv
 Vector of the name of the extra environement (for markdown) More...
 
std::vector< PStringp_vecNameMarkdownExtraParser
 Vector of the markdown name of the extra environement. More...
 
std::vector< PStringp_vecRemoveLatexKeyword
 Vector of removed latex functions. More...
 
std::vector< PLatexSpeakerp_vecSpeaker
 Vector of all Speakers in the project. More...
 

Private Member Functions

void initialisationPGenericParser (const PString &baseInstallPrefix)
 Initialisation function of the class PGenericParser. More...
 
void initialisationPMultiFileParser (const PPath &inputDirectory, const PPath &outputDirectory)
 Initialisation function of the class PMultiFileParser. More...
 

Private Attributes

PListMultiCommentConfig p_listCommentConfig
 Defines the differents comments we allow in the parsing. More...
 

Detailed Description

Generic parser.

Definition at line 30 of file PGenericParser.h.

Constructor & Destructor Documentation

◆ PGenericParser() [1/2]

PGenericParser::PGenericParser ( const PString installPrefix = "")

Default constructor of PGenericParser.

Parameters
installPrefix: installation prefix

Definition at line 52 of file PGenericParser.cpp.

52  {
53  initialisationPGenericParser(installPrefix);
54 }
void initialisationPGenericParser(const PString &baseInstallPrefix)
Initialisation function of the class PGenericParser.

References initialisationPGenericParser().

+ Here is the call graph for this function:

◆ PGenericParser() [2/2]

PGenericParser::PGenericParser ( const PGenericParser other)

Copy constructor of PGenericParser.

Parameters
other: class to copy

Definition at line 59 of file PGenericParser.cpp.

59  {
60  copyPGenericParser(other);
61 }
void copyPGenericParser(const PGenericParser &other)
Copy function of PGenericParser.

References copyPGenericParser().

+ Here is the call graph for this function:

◆ ~PGenericParser()

PGenericParser::~PGenericParser ( )
virtual

Destructor of PGenericParser.

Definition at line 64 of file PGenericParser.cpp.

64  {
65 
66 }

Member Function Documentation

◆ addCommentConfig() [1/2]

void PMultiFileParser::addCommentConfig ( const PMultiCommentConfig commentConfig)
inherited

Adds a comment config for the parser.

Parameters
commentConfig: comment config for the PMultiFileParser

Definition at line 84 of file PMultiFileParser.cpp.

84  {
85  p_listCommentConfig.push_back(commentConfig);
86 }
PListMultiCommentConfig p_listCommentConfig
Defines the differents comments we allow in the parsing.

References PMultiFileParser::p_listCommentConfig.

◆ addCommentConfig() [2/2]

void PMultiFileParser::addCommentConfig ( const PString beginStringComment,
const PString endStringComment = "\n" 
)
inherited

Adds a comment config for the parser.

Parameters
beginStringComment: string which defines the begining of a comment
endStringComment: string which defines the ending of a comment

Definition at line 92 of file PMultiFileParser.cpp.

92  {
93  p_listCommentConfig.push_back(PMultiCommentConfig(beginStringComment, endStringComment));
94 }
std::pair< PString, PString > PMultiCommentConfig
Describes a comment config.

References PMultiFileParser::p_listCommentConfig.

◆ addLatexObj()

void PGenericParser::addLatexObj ( PLatexObj parent,
const PLatexObj obj 
)
protected

Add latex obj in parent.

Parameters
[out]parent: parent PLatexObj
obj: PLatexObj to be added into parent

Definition at line 296 of file PGenericParser.cpp.

296  {
297  parent.getVecContent().push_back(obj);
298 }
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410

References PLatexObj::getVecContent().

Referenced by PMarkdownParser::getProperParent(), PMarkdownParser::insertItemInItemize(), PConfigParser::loadInclude(), PConfigParser::parseComment(), PMarkdownParser::parseComment(), PConfigParser::parseComplexMonoParam(), PMarkdownParser::parseComplexMonoParam(), PConfigParser::parseDebug(), PConfigParser::parseDots(), PConfigParser::parseDoubleInlineMath(), PMarkdownParser::parseEnumerate(), PMarkdownParser::parseEnvDecoration(), PConfigParser::parseEnvironementContent(), PConfigParser::parseEnvStringOnly(), PMarkdownParser::parseExtraEnvironement(), PConfigParser::parseExtraEnvironementFunction(), PConfigParser::parseExtraFunction(), PMarkdownParser::parseExtraParser(), PConfigParser::parseHref(), PMarkdownParser::parseHref(), PConfigParser::parseIncludeGraphic(), PMarkdownParser::parseIncludeGraphic(), PConfigParser::parseInlineMath(), PConfigParser::parseItem(), PMarkdownParser::parseItemize(), parseMonoParam(), PConfigParser::parseNewLine(), PMarkdownParser::parseNewLine(), PConfigParser::parseParserLanguage(), PConfigParser::parseParserLanguageFunction(), PConfigParser::parsePercent(), PMarkdownParser::parsePercent(), PConfigParser::parserCallDot(), PConfigParser::parserDetails(), PConfigParser::parseRealNewLine(), parserGetEnv(), PConfigParser::parserQuote(), PConfigParser::parserSvgToPng(), PConfigParser::parseSectionTitle(), PMarkdownParser::parseSectionTitle(), PConfigParser::parseSpaceParagraphe(), PConfigParser::parseTabular(), PMarkdownParser::parseTextDecoration(), PMarkdownParser::parseUrl(), PConfigParser::parseVideo(), and PMarkdownParser::parseWip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkExpectedMatch()

bool PMultiFileParser::checkExpectedMatch ( const PString tokenExpected,
const PString tokenBefore = "" 
)
inherited

Check if the tokenExpected match.

Parameters
tokenExpected: token we expect
tokenBefore: token before the exprected one
Returns
true if the p_currentToken == tokenExpected, false otherwise with an error message

Definition at line 166 of file PMultiFileParser.cpp.

166  {
167  if(p_parser->isMatch(tokenExpected)) return true;
168  errorAt();
169  std::cerr << "Unexpected token '"<<p_parser->getNextToken()<<"'" << std::endl;
170  std::cerr << "Expected token '"<<tokenExpected<<"'" << std::endl;
171  if(tokenBefore != "") std::cerr << " after " << tokenBefore << std::endl;
172  stopParsing();
173  return false;
174 }
PString getNextToken()
Get the next token.
bool isMatch(const PString &patern)
Says if the patern match with the current caracters of the PFileParser.
void errorAt()
Write a parsing error.
PFileParser * p_parser
Parser helper for the config file.
void stopParsing()
Stop the parsing of all the files.

References PMultiFileParser::errorAt(), PFileParser::getNextToken(), PFileParser::isMatch(), PMultiFileParser::p_parser, and PMultiFileParser::stopParsing().

+ Here is the call graph for this function:

◆ checkExpectedToken()

bool PMultiFileParser::checkExpectedToken ( const PString tokenExpected,
const PString tokenBefore = "" 
)
inherited

Check if the p_currentToken == tokenExpected.

Parameters
tokenExpected: token we expect
tokenBefore: token before the exprected one
Returns
true if the p_currentToken == tokenExpected, false otherwise with an error message

Definition at line 151 of file PMultiFileParser.cpp.

151  {
152  if(tokenExpected == p_currentToken) return true;
153  errorAt();
154  std::cerr << "Unexpected token '"<<p_currentToken<<"'" << std::endl;
155  std::cerr << "Expected token '"<<tokenExpected<<"'" << std::endl;
156  if(tokenBefore != "") std::cerr << " after " << tokenBefore << std::endl;
157  stopParsing();
158  return false;
159 }
PString p_currentToken
CurrentToken parsed.

References PMultiFileParser::errorAt(), PMultiFileParser::p_currentToken, and PMultiFileParser::stopParsing().

+ Here is the call graph for this function:

◆ clearComment()

void PMultiFileParser::clearComment ( )
inherited

Clear comment.

Definition at line 193 of file PMultiFileParser.cpp.

193  {
194  p_lastComment = "";
195 }
PString p_lastComment
last comment

References PMultiFileParser::p_lastComment.

Referenced by PMultiFileParser::initialisationPMultiFileParser().

+ Here is the caller graph for this function:

◆ clearLatexObj()

void PGenericParser::clearLatexObj ( PLatexObj obj)
protected

Clear a latex obj.

Parameters
[out]obj: PLatexObj to be cleared

Definition at line 255 of file PGenericParser.cpp.

255  {
256  obj.getVecContent().clear();
257  obj.setLabelName("");
258  obj.setText("");
259  obj.setName("");
261 }
void setLabelName(const PString &labelName)
Sets the labelName of the PLatexObj.
Definition: PLatexObj.cpp:158
void setName(const PString &name)
Sets the name of the PLatexObj.
Definition: PLatexObj.cpp:144
void setType(const PLatexType::PLatexType &type)
Sets the type of the PLatexObj.
Definition: PLatexObj.cpp:130
void setText(const PString &text)
Sets the text of the PLatexObj.
Definition: PLatexObj.cpp:137

References PLatexObj::getVecContent(), PLatexObj::setLabelName(), PLatexObj::setName(), PLatexObj::setText(), PLatexObj::setType(), and PLatexType::TEXT.

Referenced by playTextLatexObj(), PConfigParser::preLoadFile(), and PMarkdownParser::preLoadFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyFile()

PPath PGenericParser::copyFile ( const PPath outputDir,
const PPath fileName 
)
protected

Copy a file.

Parameters
outputDir: output directory where to put the input file
fileName; name of the file to be copied
Returns
the name of the copied file, empty string on fail

Definition at line 832 of file PGenericParser.cpp.

832  {
833  if(fileName == ""){
834  std::cerr << "PGenericParser::copyFile : fileName is empty" << std::endl;
835  return PPath("");
836  }
837  PPath fileToBeCopied(getAbsoluteFileName(fileName));
838  if(fileToBeCopied == ""){ //If the fileName does not exists, it is relative to the current parsed file
839  std::cerr << "PGenericParser::copyFile : file '"<<fileName<<"' does not exists, even relative to the current parsed file that gives '"<<fileToBeCopied<<"'" << std::endl;
840  return PPath("");
841  }
842 
843  PString baseFileName(fileToBeCopied.getFileName());
844  PString linkDir(fileName.getParentDirectory().replace("../", ""));
845  PPath buildFileName(outputDir + PPath("/") + linkDir + PPath("/") + baseFileName);
846 
847  //Do we know the input file (did we already copy it)
848  PMapFile::iterator it(p_mapCopiedFile.find(fileName));
849  if(it != p_mapCopiedFile.end()){
850  //Let's check if the copied file still exists
851  if(buildFileName.isFileExist()){
852  //Ok, now let's get it's last modification time to be sure
853  time_t currentModifTime = fileToBeCopied.getFileModificationTime();
854  //Now let's check if it is the same one
855  if(currentModifTime == it->second && currentModifTime > 0){ //negative value is an error
856  //Ok, no need to copy, we already did it and the file if up to date
857  std::cout << "PGenericParser::copyFile : no need to copy file '"<<fileName<<"' already updated at time " << currentModifTime << std::endl;
858  return buildFileName;
859  }
860  }
861  }
862 
863  if(linkDir != ""){ //If there is other directories
864  if(!PPath(outputDir + "/" + linkDir).createDirectory()){
865  std::cerr << "PGenericParser::copyFile : cannot create directory '"<<(outputDir + "/" + linkDir)<<"'" << std::endl;
866  return PPath("");
867  }
868  }else{
869  if(!outputDir.createDirectory()){
870  std::cerr << "PGenericParser::copyFile : cannot create directory '"<<outputDir<<"'" << std::endl;
871  return PPath("");
872  }
873  }
874 
875  //Set the modification time
876  time_t lastModifTime = fileToBeCopied.getFileModificationTime();
877 
878  PString command("cp "+fileToBeCopied+" " + buildFileName);
879  if(system(command.c_str()) != 0){
880  errorAt();
881  std::cerr << "PGenericParser::copyFile : can't copy file '"<<fileToBeCopied<<"' into '"<<buildFileName<<"' directory" << std::endl;
882  stopParsing();
883  return PPath("");
884  }
885 // std::cout << "PGenericParser::copyFile : copy file '"<<fileToBeCopied<<"' at time " << lastModifTime << std::endl;
886  p_mapCopiedFile[fileToBeCopied] = lastModifTime;
887  return buildFileName;
888 }
PPath getAbsoluteFileName(const PPath &fileName)
Get the absolute path of a file.
PMapFile p_mapCopiedFile
Map of copied files.
Path of a directory or a file.
Definition: PPath.h:17
bool createDirectory(mode_t mode=0755) const
Create the current directory.
Definition: PPath.cpp:331
PPath getParentDirectory() const
Get path of parent directory of current path.
Definition: PPath.cpp:207
Extends the std::string.
Definition: PString.h:16
PString replace(const PString &pattern, const PString &replaceStr) const
Replace a PString into an other PString.
Definition: PString.cpp:204

References PPath::createDirectory(), PMultiFileParser::errorAt(), getAbsoluteFileName(), PPath::getFileModificationTime(), PPath::getFileName(), PPath::getParentDirectory(), PPath::isFileExist(), p_mapCopiedFile, PString::replace(), and PMultiFileParser::stopParsing().

Referenced by PConfigParser::parseHref(), PMarkdownParser::parseHref(), PConfigParser::parseIncludeGraphic(), PMarkdownParser::parseIncludeGraphic(), and PConfigParser::parseVideo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyPGenericParser()

void PGenericParser::copyPGenericParser ( const PGenericParser other)
protected

Copy function of PGenericParser.

Parameters
other: class to copy

Vector of all the environements

Vector of all the functions

Vector of the include directories

Vector of the name of the extra environement

Vector of the name of the extra environement

Vector of the name of the extra environement

Vector of extra environements

Vector of the name of the extra function

Vector of extra function

Vector of the name of the extra environement

Vector of the function name of the extra environement

Vector of the markdown name of the extra environement

Vector of removed latex functions

Vector of extra parser

Css of all the configurations

Map of all bibliography entries

Map of copied files

Definition at line 201 of file PGenericParser.cpp.

201  {
203 
205  p_vecEnv = other.p_vecEnv;
207  p_vecFunc = other.p_vecFunc;
208 
211 
220 
225 
236 
238  p_cssContent = other.p_cssContent;
243 
247  p_bookMail = other.p_bookMail;
250 }
PLatexObj p_bookMainPageLink
Main page definition of the full site.
std::vector< PString > p_vecNameExtraParser
Vector of the name of the extra environement.
PMapExtraEnv p_vecExtraEnv
Vector of extra environements.
std::map< PString, PString > p_cssContent
Css of all the configurations.
PMapExtraEnv p_vecExtraFunction
Vector of extra function.
std::vector< PString > p_vecNameFunctionExtraParser
Vector of the function name of the extra environement.
PString p_bookMasterProjectUrl
Master project url in book mode.
PMapBiblioEntry p_mapBiblioEntry
Map of all bibliography entries.
std::vector< PString > p_vecIncludeDir
Vector of the include directories.
PVecLatexEnv p_vecEnv
Vector of all the environements.
PString p_bookSideBarWidth
Witdh of the book side bar.
std::vector< PString > p_vecNameExtraFunction
Vector of the name of the extra function.
std::vector< PString > p_vecNameExtraEnv
Vector of the name of the extra environement.
bool p_isEnableBookFeedback
True to enable feedback in book mode.
std::vector< PString > p_vecNameMarkdownExtraParser
Vector of the markdown name of the extra environement.
PString p_bookGitlabUrl
Gitlab url of the current sources of the project.
std::vector< PString > p_vecNameFunctionExtraEnv
Vector of the name of the extra environement.
PVecLatexFunc p_vecFunc
Vector of all the functions.
std::vector< PString > p_vecNameMarkdownExtraEnv
Vector of the name of the extra environement (for markdown)
PString p_bookMail
Mail to be used to contact authors in book mode.
bool p_isDebugMode
True if be parse in debug mode.
std::vector< PString > p_vecRemoveLatexKeyword
Vector of removed latex functions.
PVecParserEnv p_vecExtraParser
Vector of extra parser.

References p_bookGitlabUrl, p_bookMail, p_bookMainPageLink, p_bookMasterProjectUrl, p_bookSideBarWidth, p_cssContent, p_isDebugMode, p_isEnableBookFeedback, p_mapBiblioEntry, p_mapCopiedFile, p_vecEnv, p_vecExtraEnv, p_vecExtraFunction, p_vecExtraParser, p_vecFunc, p_vecIncludeDir, p_vecNameExtraEnv, p_vecNameExtraFunction, p_vecNameExtraParser, p_vecNameFunctionExtraEnv, p_vecNameFunctionExtraParser, p_vecNameMarkdownExtraEnv, p_vecNameMarkdownExtraParser, and p_vecRemoveLatexKeyword.

Referenced by PConfigParser::loadInclude(), operator=(), and PGenericParser().

+ Here is the caller graph for this function:

◆ errorAt()

void PMultiFileParser::errorAt ( )
inherited

◆ executeLatexCommand()

PString PGenericParser::executeLatexCommand ( const PString inputStr)
protected

Execute the given latex command.

Parameters
inputStr: input latex string
Returns
text string

Definition at line 304 of file PGenericParser.cpp.

304  {
305  PConfigParser parser;
306  parser.setFileContent(inputStr + "\n");
307  PString out("");
308  if(parser.fullParsing()){
309  out = platexobj_text(parser.getSource());
310  }else{
311  out = inputStr;
312  }
313  return out;
314 }
Parse the pdata confguration file.
Definition: PConfigParser.h:13
const PLatexObj & getSource() const
Get the current source.
void setFileContent(const PString &fileContent)
Set the file content to be parsed.
bool fullParsing()
Perform the full parsing pf data.
PString platexobj_text(const std::vector< PLatexObj > &vecObj)
Convert a PLatexObj in text.

References PMultiFileParser::fullParsing(), getSource(), platexobj_text(), and PMultiFileParser::setFileContent().

Referenced by parseBookEnableFeedback(), parseBookGitlabUrl(), parseBookMail(), parseBookMasterProject(), parseBookSizeBarWidth(), parseMainAuthor(), parseMainDate(), parseMainSubTitle(), and parseMainTitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fullParsing()

bool PMultiFileParser::fullParsing ( )
inherited

Perform the full parsing pf data.

Returns
true on success, false otherwise

Definition at line 57 of file PMultiFileParser.cpp.

57  {
58  if(p_parser == NULL){
59  std::cerr << "PMultiFileParser::fullParsing : the parser is not initialised, please call PMultiFileParser::load or PMultiFileParser::setFileContent before this function" << std::endl;
60  return false;
61  }
62  preLoadFile();
63  bool isParseGood(true);
64  while(!p_parser->isEndOfFile() && isParseGood && p_run){
65  long unsigned int currentPos = p_parser->getCurrentCharIdx();
66  isParseGood = parseFile();
67  if(currentPos == p_parser->getCurrentCharIdx() && !p_parser->isEndOfFile()){
68  std::cerr << "PMultiFileParser::fullParsing : the parser is stucked at the position :" << std::endl << "\t" << p_parser->getLocation() << std::endl;
70  pointAtRow();
71  p_run = false;
72  }
73  }
74  if(p_run) postLoadFile();
75  p_listFileParser.pop_back();
76  if(p_listFileParser.size() > 0lu) p_parser = &p_listFileParser.back();
77  else p_parser = NULL;
78  return p_run;
79 }
size_t getCurrentCharIdx() const
Return the index of the current character.
bool isEndOfFile() const
Dit si on est à la fin du fichier.
Definition: PFileParser.cpp:88
virtual void postLoadFile()
Post load file.
virtual bool parseFile()=0
virtual void preLoadFile()
Pre load file.
std::list< PFileParser > p_listFileParser
List of all the parsers for all the loaded files.
void unexpectedToken()
Print unexpected token error.
void pointAtRow()
Point the problem.
bool p_run
Run the parsing if true.

References PFileParser::getCurrentCharIdx(), PFileParser::getLocation(), PFileParser::isEndOfFile(), PMultiFileParser::p_listFileParser, PMultiFileParser::p_parser, PMultiFileParser::p_run, PMultiFileParser::parseFile(), PMultiFileParser::pointAtRow(), PMultiFileParser::postLoadFile(), PMultiFileParser::preLoadFile(), and PMultiFileParser::unexpectedToken().

Referenced by checkPMultiFileParser(), executeLatexCommand(), PMultiFileParser::load(), and platexobj_parseStr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAbsoluteFileName()

PPath PGenericParser::getAbsoluteFileName ( const PPath fileName)
protected

Get the absolute path of a file.

Parameters
fileName: file to be used
Returns
corresponding absolute file name

Definition at line 815 of file PGenericParser.cpp.

815  {
816  PPath fileToBeCopied(fileName);
817  if(!fileToBeCopied.isFileExist()){ //If the fileName does not exists, it is relative to the current parsed file
818  fileToBeCopied = p_parser->getFileName().getParentDirectory() / fileName;
819  if(!fileToBeCopied.isFileExist()){ //Il the fileName still does not exists, we have to complain
820  std::cerr << "PGenericParser::getAbsoluteFileName : file '"<<fileName<<"' does not exists, even relative to the current parsed file that gives '"<<fileToBeCopied<<"'" << std::endl;
821  return PPath("");
822  }
823  }
824  return fileToBeCopied;
825 }
PPath getFileName() const
Fonction qui renvoie le nom du fichier que l'on a ouvert.

References PFileParser::getFileName(), PPath::getParentDirectory(), PPath::isFileExist(), and PMultiFileParser::p_parser.

Referenced by copyFile(), and PConfigParser::parseVideo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBookEnableFeedback()

bool PGenericParser::getBookEnableFeedback ( ) const

Say if the book feedback if enable or not.

Returns
true if the book feedback if enable, false if not

Definition at line 139 of file PGenericParser.cpp.

139  {
140  return p_isEnableBookFeedback;
141 }

References p_isEnableBookFeedback.

◆ getBookGitlabUrl()

const PString & PGenericParser::getBookGitlabUrl ( ) const

Get the book gitlab url.

Returns
width of the book sidebar

Definition at line 132 of file PGenericParser.cpp.

132  {
133  return p_bookGitlabUrl;
134 }

References p_bookGitlabUrl.

◆ getBookMail()

const PString & PGenericParser::getBookMail ( ) const

Get the book mail list.

Returns
book mail list

Definition at line 146 of file PGenericParser.cpp.

146  {
147  return p_bookMail;
148 }

References p_bookMail.

◆ getBookMainPageLink()

const PLatexObj & PGenericParser::getBookMainPageLink ( ) const

Get the book main page link.

Returns
book main page link

Definition at line 160 of file PGenericParser.cpp.

160  {
161  return p_bookMainPageLink;
162 }

References p_bookMainPageLink.

◆ getBookMasterProjectUrl()

const PString & PGenericParser::getBookMasterProjectUrl ( ) const

Get the book master project url.

Returns
book master project url

Definition at line 153 of file PGenericParser.cpp.

153  {
154  return p_bookMasterProjectUrl;
155 }

References p_bookMasterProjectUrl.

◆ getBookSideBarWidth()

const PString & PGenericParser::getBookSideBarWidth ( ) const

Get the width of the book sidebar.

Returns
width of the book sidebar

Definition at line 125 of file PGenericParser.cpp.

125  {
126  return p_bookSideBarWidth;
127 }

References p_bookSideBarWidth.

◆ getCurrentParser()

PFileParser * PMultiFileParser::getCurrentParser ( )
inherited

Gets the current parser.

Returns
pointer to the current parser

Definition at line 303 of file PMultiFileParser.cpp.

303  {
304  return p_parser;
305 }

References PMultiFileParser::p_parser.

Referenced by ConfigParser::preLoadFile().

+ Here is the caller graph for this function:

◆ getCurrentTokenWithoutComment()

void PMultiFileParser::getCurrentTokenWithoutComment ( )
inherited

Get the current token and skip the comment.

Definition at line 280 of file PMultiFileParser.cpp.

280  {
281  if(!p_run) return;
282  p_lastComment = "";
283  if(p_listCommentConfig.size() != 0lu){
284  bool currentTokenIsComment(true);
285  while(currentTokenIsComment && p_run && !p_parser->isEndOfFile()){
286  PListMultiCommentConfig::iterator it(p_listCommentConfig.begin());
287  currentTokenIsComment = false;
288  while(it != p_listCommentConfig.end() && !currentTokenIsComment){
289  if(p_parser->isMatch(it->first)){
290  p_lastComment = p_parser->getUntilKey(it->second);
291  currentTokenIsComment = true;
292  }
293  ++it;
294  }
295  }
296  }
298 }
PString getUntilKey(const PString &patern)
Renvoie la chaine de caractère du caractère courant jusqu'à patern comprise.

References PFileParser::getNextToken(), PFileParser::getUntilKey(), PFileParser::isEndOfFile(), PFileParser::isMatch(), PMultiFileParser::p_currentToken, PMultiFileParser::p_lastComment, PMultiFileParser::p_listCommentConfig, PMultiFileParser::p_parser, and PMultiFileParser::p_run.

+ Here is the call graph for this function:

◆ getLastComment() [1/2]

PString & PMultiFileParser::getLastComment ( )
inherited

Get the last comment.

Returns
last comment

Definition at line 106 of file PMultiFileParser.cpp.

106  {
107  return p_lastComment;
108 }

References PMultiFileParser::p_lastComment.

◆ getLastComment() [2/2]

const PString & PMultiFileParser::getLastComment ( ) const
inherited

Get the last comment.

Returns
last comment

Definition at line 99 of file PMultiFileParser.cpp.

99  {
100  return p_lastComment;
101 }

References PMultiFileParser::p_lastComment.

◆ getMapBiblioEntry() [1/2]

PMapBiblioEntry & PGenericParser::getMapBiblioEntry ( )

Get the map of all bibliography entries.

Returns
map of all bibliography entries

Definition at line 120 of file PGenericParser.cpp.

120 {return p_mapBiblioEntry;}

References p_mapBiblioEntry.

◆ getMapBiblioEntry() [2/2]

const PMapBiblioEntry & PGenericParser::getMapBiblioEntry ( ) const

Get the map of all bibliography entries.

Returns
map of all bibliography entries

Definition at line 115 of file PGenericParser.cpp.

115 {return p_mapBiblioEntry;}

References p_mapBiblioEntry.

◆ getOptionStringBetweenBraces()

PString PGenericParser::getOptionStringBetweenBraces ( )
protected

Get optional string between braces {...}.

Returns
string between braces or empty string if there is no hook

Definition at line 335 of file PGenericParser.cpp.

335  {
336  if(!isMatch("{")){ //No hook => empty string
337  return "";
338  }
340  return link;
341 }
PString getUntilKeyWithoutPaternRecurse(const PString &patern, const PString &beginPatern, const PString &allowedCharAfterBegin)
Get the string until end sequence and take account recursive patern (embeded strings)
bool isMatch(const PString &token)
Check if the given token matches the current read file.

References PFileParser::getUntilKeyWithoutPaternRecurse(), PMultiFileParser::isMatch(), and PMultiFileParser::p_parser.

Referenced by PConfigParser::parseAddSpeaker(), PConfigParser::parseDots(), PConfigParser::parseSaveSpeaker(), PConfigParser::parseSpaceParagraphe(), PConfigParser::parseTabular(), PConfigParser::parseTimeTable(), and PConfigParser::skipMonoParam().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOptionStringBetweenHook()

PString PGenericParser::getOptionStringBetweenHook ( )
protected

Get optional string between hooks [...].

Returns
string between hooks or empty string if there is no hook

Definition at line 346 of file PGenericParser.cpp.

346  {
348  char ch = p_parser->getCurrentCh();
349  if(ch != '['){ //No hook => empty string
350  return "";
351  }
354  return link;
355 }
#define PARSER_SKIP_SPACE
Macro to skip space.
PString getUntilKeyWithoutPatern(const PString &patern)
Renvoie la chaine de caractère du caractère courant jusqu'à patern exclu.
char getCurrentCh() const
Renvoie le caractère courant.
char getNextChar()
Fonction qui renvoie le prochain caractère du fichier courant.

References PFileParser::getCurrentCh(), PFileParser::getNextChar(), PFileParser::getUntilKeyWithoutPatern(), PMultiFileParser::p_parser, and PARSER_SKIP_SPACE.

Referenced by PConfigParser::parseComplexMonoParam(), PMarkdownParser::parseComplexMonoParam(), parseMonoParam(), PConfigParser::parseSectionTitle(), and PConfigParser::skipMonoParam().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSource() [1/2]

PLatexObj & PGenericParser::getSource ( )

Get the current source.

Returns
current source

Definition at line 94 of file PGenericParser.cpp.

94  {
95  return p_currentSource;
96 }
PLatexObj p_currentSource
Current completed source.

References p_currentSource.

◆ getSource() [2/2]

const PLatexObj & PGenericParser::getSource ( ) const

Get the current source.

Returns
current source

Definition at line 87 of file PGenericParser.cpp.

87  {
88  return p_currentSource;
89 }

References p_currentSource.

Referenced by executeLatexCommand(), PConfigParser::loadInclude(), and platexobj_parseStr().

+ Here is the caller graph for this function:

◆ getStrComposedOf()

PString PMultiFileParser::getStrComposedOf ( const PString charset)
inherited

Get the string composed of charset charcters.

Parameters
charset: set of allowed characters
Returns
corresponding string composed of characters in the given charset

Definition at line 272 of file PMultiFileParser.cpp.

272  {
273  //Remove comments
274  skipComment();
275  //Check if the token matches
276  return p_parser->getStrComposedOf(charset);
277 }
PString getStrComposedOf(const PString &charset)
Get string composed of the characters in the string charset.
void skipComment()
Skip comment.

References PFileParser::getStrComposedOf(), PMultiFileParser::p_parser, and PMultiFileParser::skipComment().

+ Here is the call graph for this function:

◆ getStringBetweenBraces()

PString PGenericParser::getStringBetweenBraces ( const PString previousToken)
protected

Get the string between the braces {...}.

Parameters
previousToken: previous token to be used
Returns
string between {...}

Definition at line 320 of file PGenericParser.cpp.

320  {
321  if(!isMatch("{")){
322  errorAt();
323  std::cerr << "PGenericParser::getStringBetweenBraces : expect '{' after '"<<previousToken<<"' instead of '"<<p_parser->getNextChar()<<"'" << std::endl;
324  stopParsing();
325  return "";
326  }
327 // PString link(p_parser->getUntilKeyWithoutPatern("}"));
329  return link;
330 }

References PMultiFileParser::errorAt(), PFileParser::getNextChar(), PFileParser::getUntilKeyWithoutPaternRecurse(), PMultiFileParser::isMatch(), PMultiFileParser::p_parser, and PMultiFileParser::stopParsing().

Referenced by parseBookEnableFeedback(), parseBookGitlabUrl(), parseBookMail(), parseBookMasterProject(), parseBookSizeBarWidth(), PConfigParser::parseDebug(), PConfigParser::parseEnvStringOnly(), PConfigParser::parseHref(), PConfigParser::parseIncludeFile(), PConfigParser::parseInputFile(), parseLabel(), parseMainAuthor(), parseMainDate(), parseMainSubTitle(), parseMainTitle(), parseMonoParam(), and parserGetEnv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getVecIncludeDir() [1/2]

PVecString & PGenericParser::getVecIncludeDir ( )

Get the vector of include directories.

Returns
vector of include directories

Definition at line 108 of file PGenericParser.cpp.

108  {
109  return p_vecIncludeDir;
110 }

References p_vecIncludeDir.

◆ getVecIncludeDir() [2/2]

const PVecString & PGenericParser::getVecIncludeDir ( ) const

Get the vector of include directories.

Returns
vector of include directories

Definition at line 101 of file PGenericParser.cpp.

101  {
102  return p_vecIncludeDir;
103 }

References p_vecIncludeDir.

◆ incrementCurrentChar()

void PGenericParser::incrementCurrentChar ( PLatexObj textObj)
protected

Increment current char position.

Parameters
[out]textObj: obh to be used to store text

Definition at line 266 of file PGenericParser.cpp.

266  {
267  //If nothing is known I need to save the current char in the MACRO TEXT
268  char ch = p_parser->getCurrentCh();
269  textObj.getText() += ch;
271 }
const PString & getText() const
Gets the text of the PLatexObj.
Definition: PLatexObj.cpp:312

References PFileParser::getCurrentCh(), PFileParser::getNextChar(), PLatexObj::getText(), and PMultiFileParser::p_parser.

Referenced by PConfigParser::loadInclude(), PMarkdownParser::parseEnumerateItem(), PConfigParser::parseEnvironementContent(), PMarkdownParser::parseExtraEnvironement(), PConfigParser::parseFile(), PMarkdownParser::parseFile(), PConfigParser::parseItem(), PMarkdownParser::parseItem(), PConfigParser::parserDetails(), PConfigParser::parserQuote(), PConfigParser::parseTabular(), PConfigParser::parseVecLatexObj(), PMarkdownParser::parseVecLatexObj(), and PMarkdownParser::parseWip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialisationPGenericParser()

void PGenericParser::initialisationPGenericParser ( const PString baseInstallPrefix)
private

Initialisation function of the class PGenericParser.

Parameters
baseInstallPrefix: installation prefix

Definition at line 893 of file PGenericParser.cpp.

893  {
894  p_isDebugMode = false;
897 
898  PString installPrefix(CMAKE_INSTALL_PREFIX);
899  if(baseInstallPrefix != ""){
900  installPrefix = baseInstallPrefix;
901  }
902 
903  PPath dirExtraEnv(installPrefix+"/share/PhoenixTex2Html/ENVIRONEMENT");
904  loadDirExtraEnvironement(dirExtraEnv);
905 
906  PPath dirExtraFunction(installPrefix+"/share/PhoenixTex2Html/FUNCTION");
907  loadDirExtraFunction(dirExtraFunction);
908 
909  PPath dirExtraParser(installPrefix+"/share/PhoenixTex2Html/PARSER");
910  loadDirExtraParser(dirExtraParser);
911 
912  PPath dirCss(installPrefix+"/share/PhoenixTex2Html/STYLE");
913  loadCss(dirCss);
914 
915  p_vecRemoveLatexKeyword.push_back("\\toprule");
916  p_vecRemoveLatexKeyword.push_back("\\midrule");
917  p_vecRemoveLatexKeyword.push_back("\\bottomrule");
918  p_vecRemoveLatexKeyword.push_back("\\hline");
919  loadMapFile();
920 
921  p_bookSideBarWidth = "300px";
922  p_isEnableBookFeedback = false;
923 
924  p_bookMainPageLink.setType(PLatexType::NONE); //None by default, type will be updated on update
925 }
void loadDirExtraParser(const PPath &inputDir)
Load the extra parsers.
void loadDirExtraFunction(const PPath &inputDir)
Load the extra functions.
PLatexObj p_currentText
Current text.
void loadCss(const PPath &inputDir)
Load the css.
void loadMapFile()
Load the map of copied files.
void loadDirExtraEnvironement(const PPath &inputDir)
Load the extra environements.

References PLatexType::FILE, loadCss(), loadDirExtraEnvironement(), loadDirExtraFunction(), loadDirExtraParser(), loadMapFile(), PLatexType::NONE, p_bookMainPageLink, p_bookSideBarWidth, p_currentSource, p_currentText, p_isDebugMode, p_isEnableBookFeedback, p_vecRemoveLatexKeyword, PLatexObj::setType(), and PLatexType::TEXT.

Referenced by PGenericParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialisationPMultiFileParser()

void PMultiFileParser::initialisationPMultiFileParser ( const PPath inputDirectory,
const PPath outputDirectory 
)
privateinherited

Initialisation function of the class PMultiFileParser.

Parameters
inputDirectory: input directory of the PMultiFileParser
outputDirectory: output directory of the PMultiFileParser

Definition at line 311 of file PMultiFileParser.cpp.

311  {
312  p_run = true;
313  p_inputDirectory = inputDirectory;
314  p_outputDirectory = outputDirectory;
315  p_currentToken = "";
316  clearComment();
317  p_parser = NULL;
318 }
PPath p_inputDirectory
Input directory of the parser.
void clearComment()
Clear comment.
PPath p_outputDirectory
Output directory of the parser.

References PMultiFileParser::clearComment(), PMultiFileParser::p_currentToken, PMultiFileParser::p_inputDirectory, PMultiFileParser::p_outputDirectory, PMultiFileParser::p_parser, and PMultiFileParser::p_run.

Referenced by PMultiFileParser::PMultiFileParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMatch() [1/3]

bool PMultiFileParser::isMatch ( const PString patern,
const PString forbiddenCharBefore 
)
inherited

Says if the patern match with the current caracters of the PFileParser.

Parameters
patern: patern we want to check (this patern should not begin with white caracters)
forbiddenCharBefore: lisr of characters which cannot be just before the first character of the patern
Returns
true if the patern match, false otherwise If the patern match, the current char will be in the next char of the patern

Definition at line 239 of file PMultiFileParser.cpp.

239  {
240  //Remove comments
241  skipComment();
242  //Check if the token matches
243  return p_parser->isMatch(patern, forbiddenCharBefore);
244 }

References PFileParser::isMatch(), PMultiFileParser::p_parser, and PMultiFileParser::skipComment().

+ Here is the call graph for this function:

◆ isMatch() [2/3]

bool PMultiFileParser::isMatch ( const PString token)
inherited

Check if the given token matches the current read file.

Parameters
token: token to be checked
Returns
true on success, false otherwise This function isMatch takes account the comments

Definition at line 202 of file PMultiFileParser.cpp.

202  {
203  //Remove comments
204  skipComment();
205  //Check if the token matches
206  return p_parser->isMatch(token);
207 }

References PFileParser::isMatch(), PMultiFileParser::p_parser, and PMultiFileParser::skipComment().

Referenced by getOptionStringBetweenBraces(), getStringBetweenBraces(), ConfigParser::parseDocString(), PConfigParser::parseDots(), ConfigParser::parseFile(), and PConfigParser::parseSpaceParagraphe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMatch() [3/3]

PString PMultiFileParser::isMatch ( const PVecString vecToken)
inherited

Check if the one entry of the vector of token matches.

Parameters
vecToken: vector of token
Returns
matched string, or empty string if there is no match

Definition at line 250 of file PMultiFileParser.cpp.

250  {
251  //Remove comments
252  skipComment();
253  //Check if the token matches
254  return p_parser->isMatch(vecToken);
255 }

References PFileParser::isMatch(), PMultiFileParser::p_parser, and PMultiFileParser::skipComment().

+ Here is the call graph for this function:

◆ isMatchRewind()

bool PMultiFileParser::isMatchRewind ( const PString token)
inherited

Check if the given token matches the current read file and goes back even if the token matches.

Parameters
token: token to be checked
Returns
true on success, false otherwise This function isMatch takes account the comments

Definition at line 214 of file PMultiFileParser.cpp.

214  {
215  //Remove comments
216  skipComment();
217  //Check if the token matches
218  return p_parser->isMatchRewind(token);
219 }
bool isMatchRewind(const PString &patern)
Do a isMatch and then go back at the previous position.

References PFileParser::isMatchRewind(), PMultiFileParser::p_parser, and PMultiFileParser::skipComment().

Referenced by PConfigParser::parseExtraFunction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMatchSeq()

bool PMultiFileParser::isMatchSeq ( const PVecString patern,
bool  alwaysPopBack = false 
)
inherited

Match a sequence of token in a vector.

Parameters
patern: set of token to match in this order and totally
alwaysPopBack: true to make the PFileParser at the exact same place before the check even is the sequence matches
Returns
true if the full sequence matches, false otherwise

Definition at line 226 of file PMultiFileParser.cpp.

226  {
227  //Remove comments
228  skipComment();
229  //Check if the token matches
230  return p_parser->isMatchSeq(patern, alwaysPopBack);
231 }
bool isMatchSeq(const PVecString &patern, bool alwaysPopBack=false)
Match a sequence of token in a vector.

References PFileParser::isMatchSeq(), PMultiFileParser::p_parser, and PMultiFileParser::skipComment().

+ Here is the call graph for this function:

◆ isMatchToken()

PString PMultiFileParser::isMatchToken ( const PVecString vecToken)
inherited

Check the matching between the current caracters and all the string in the vector but treats the string as a token (cannot be part of a word)

Parameters
vecToken: vector of token
Returns
matched string, or empty string if there is no match

Definition at line 261 of file PMultiFileParser.cpp.

261  {
262  //Remove comments
263  skipComment();
264  //Check if the token matches
265  return p_parser->isMatchToken(vecToken);
266 }
bool isMatchToken(const PString &patern)
Says if the patern match with the current caracters of the PFileParser but treats the string as a tok...

References PFileParser::isMatchToken(), PMultiFileParser::p_parser, and PMultiFileParser::skipComment().

+ Here is the call graph for this function:

◆ load()

bool PMultiFileParser::load ( const PPath configFile)
inherited

Load the PMultiFileParser with the configFile.

Parameters
configFile: file name of the cnofiguration file
Returns
true on success, false otherwise

Definition at line 27 of file PMultiFileParser.cpp.

27  {
28  if(configFile == "") return false;
29  PFileParser parser;
30  p_listFileParser.push_back(parser);
32  p_parser = &p_listFileParser.back();
33  if(!p_parser->open(configFile)){
34  std::cerr << "PMultiFileParser::load : can't open file '" << configFile << "'" << std::endl;
35  return false;
36  }
37  return fullParsing();
38 }
#define MULTI_PARSER_SEPARATORS_STRING
classe qui permet de parser des fichiers texte en renvoyant les tokens les uns après les autres
Definition: PFileParser.h:20
bool open(const PPath &fileName)
Fonction qui ouvre le fichier que l'on va parser.
Definition: PFileParser.cpp:24

References PMultiFileParser::fullParsing(), MULTI_PARSER_SEPARATORS_STRING, PFileParser::open(), PMultiFileParser::p_listFileParser, and PMultiFileParser::p_parser.

Referenced by checkPMultiFileParser(), and PConfigParser::loadInclude().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadCss()

void PGenericParser::loadCss ( const PPath inputDir)
protected

Load the css.

Parameters
inputDir: input directory

Definition at line 786 of file PGenericParser.cpp.

786  {
787  PListFile listInputFile = inputDir.getAllElementInDir();
788  if(listInputFile.size() == 0lu){
789  std::cerr << "PGenericParser::loadCss : can't read directory '"<<inputDir<<"'" << std::endl;
790  return;
791  }
792  for(PListFile::iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
793  PString styleName(it->getFileName().eraseExtension());
794  PPath tmpFile(inputDir / (*it));
795  p_cssContent[styleName] = tmpFile.loadFileContent();
796  }
797 }
std::vector< PPath > getAllElementInDir() const
Get the list of all elements in a directory.
Definition: PPath.cpp:503
PVecPath PListFile
List of file.

References PPath::getAllElementInDir(), PPath::loadFileContent(), and p_cssContent.

Referenced by initialisationPGenericParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadDirExtraEnvironement()

void PGenericParser::loadDirExtraEnvironement ( const PPath inputDir)
protected

Load the extra environements.

Parameters
inputDir: input directory

Definition at line 622 of file PGenericParser.cpp.

622  {
623  PListFile listInputFile = inputDir.getAllElementInDir();
624  if(listInputFile.size() == 0lu){
625  std::cerr << "PGenericParser::loadDirExtraEnvironement : can't read directory '"<<inputDir<<"'" << std::endl;
626  return;
627  }
628  for(PListFile::iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
629  loadDirExtraEnvironementFile(inputDir / (*it));
630  }
631 }
void loadDirExtraEnvironementFile(const PPath &inputFile)
Load the extra environements with input file.

References PPath::getAllElementInDir(), and loadDirExtraEnvironementFile().

Referenced by initialisationPGenericParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadDirExtraEnvironementFile()

void PGenericParser::loadDirExtraEnvironementFile ( const PPath inputFile)
protected

Load the extra environements with input file.

Parameters
inputFile: input directory

Definition at line 572 of file PGenericParser.cpp.

572  {
573  PXml root;
574  if(!pxml_parserFile(root, inputFile)){
575  std::cerr << "PGenericParser::loadDirExtraEnvironementFile : can't read file '"<<inputFile<<"'" << std::endl;
576  return;
577  }
578  PXml & childXml = root.getVecChild().front();
579  if(!pxml_getChildIfExist(childXml, root, "environement")){
580  std::cerr << "PGenericParser::loadDirExtraEnvironementFile : can't find <environement> </environement> balise in file '"<<inputFile<<"'" << std::endl;
581  return;
582  }
583  PVecXml listEnv;
584  if(pxml_getVecChildIfExist(listEnv, childXml, "env")){
585  for(PVecXml::iterator it(listEnv.begin()); it != listEnv.end(); ++it){
586  PXmlAttr attrName;
587  if(!pxml_getAttrIfExist(attrName, *it, "name")){continue;}
588  PString name(attrName.getValue());
589  if(name == ""){
590  std::cerr << "PGenericParser::loadDirExtraEnvironementFile : expect name in balise" << std::endl;
591  continue;
592  }
593  PString balise("div");
594  PXmlAttr attr;
595  if(pxml_getAttrIfExist(attr, *it, "balise")){
596  balise = attr.getValue();
597  }
598  bool isAllowComment(true), isAllowMath(true);
599  setBoolFromAttr(isAllowComment, *it, "comment");
600  setBoolFromAttr(isAllowMath, *it, "math");
601 
602  PString contentStr(pxml_getFullContent(*it));
603 
604  PEnvironement tmp;
605  tmp.setName(name);
606  tmp.setBalise(balise);
607  tmp.setCss(contentStr);
608  tmp.setIsAllowComment(isAllowComment);
609  tmp.setIsAlloxMath(isAllowMath);
610 
611  p_vecExtraEnv[name] = tmp;
612  p_vecNameExtraEnv.push_back(name);
613  p_vecNameFunctionExtraEnv.push_back("\\" + name);
614  p_vecNameMarkdownExtraEnv.push_back("```" + name);
615  }
616  }
617 }
void setBoolFromAttr(bool &isAllowComment, const PXml &xml, const PString &name)
Get a boolean from xml attribute.
describe a CSS environement for latex
Definition: PLatexObj.h:272
void setName(const PString &name)
Sets the name of the PEnvironement.
Definition: PLatexObj.cpp:1082
void setCss(const PString &css)
Sets the css of the PEnvironement.
Definition: PLatexObj.cpp:1089
void setBalise(const PString &balise)
Sets the balise of the PEnvironement.
Definition: PLatexObj.cpp:1096
void setIsAllowComment(bool isAllowComment)
Sets the isAllowComment of the PEnvironement.
Definition: PLatexObj.cpp:1103
void setIsAlloxMath(bool isAlloxMath)
Sets the isAlloxMath of the PEnvironement.
Definition: PLatexObj.cpp:1110
Attribute from xml.
Definition: PXml.h:30
const PString & getValue() const
Get the variable p_value.
Definition: PXml.cpp:82
Class used to parse xml.
Definition: PXml.h:54
const std ::vector< PXml > & getVecChild() const
Get the variable p_vecChild.
Definition: PXml.cpp:264
bool pxml_getVecChildIfExist(PVecXml &vecMatch, const PXml &xml, const PString &childName)
Get the vector of childs with given name if exist.
Definition: pxml_utils.cpp:197
bool pxml_getAttrIfExist(PXmlAttr &attr, const PXml &xml, const PString &attrName)
Get the attribute with given name if exist.
Definition: pxml_utils.cpp:251
PString pxml_getFullContent(const PXml &xml)
Get the content of the PXml (children or value)
Definition: pxml_utils.cpp:395
bool pxml_parserFile(PXml &xml, const PPath &fileName, bool isSvg)
Parse a PXml with a file.
Definition: pxml_utils.cpp:38
bool pxml_getChildIfExist(PXml &match, const PXml &xml, const PString &childName)
Get the child with given name if exist.
Definition: pxml_utils.cpp:215
std::vector< PXml > PVecXml
Vector of PXml.
Definition: pxml_utils.h:14

References PXmlAttr::getValue(), PXml::getVecChild(), p_vecExtraEnv, p_vecNameExtraEnv, p_vecNameFunctionExtraEnv, p_vecNameMarkdownExtraEnv, pxml_getAttrIfExist(), pxml_getChildIfExist(), pxml_getFullContent(), pxml_getVecChildIfExist(), pxml_parserFile(), PEnvironement::setBalise(), setBoolFromAttr(), PEnvironement::setCss(), PEnvironement::setIsAllowComment(), PEnvironement::setIsAlloxMath(), and PEnvironement::setName().

Referenced by loadDirExtraEnvironement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadDirExtraFunction()

void PGenericParser::loadDirExtraFunction ( const PPath inputDir)
protected

Load the extra functions.

Parameters
inputDir: input directory

Definition at line 677 of file PGenericParser.cpp.

677  {
678  PListFile listInputFile = inputDir.getAllElementInDir();
679  if(listInputFile.size() == 0lu){
680  std::cerr << "PGenericParser::loadDirExtraFunction : can't read directory '"<<inputDir<<"'" << std::endl;
681  return;
682  }
683  for(PListFile::iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
684  loadDirExtraFunctionFile(inputDir / (*it));
685  }
686 }
void loadDirExtraFunctionFile(const PPath &inputFile)
Load the extra functions with input file.

References PPath::getAllElementInDir(), and loadDirExtraFunctionFile().

Referenced by initialisationPGenericParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadDirExtraFunctionFile()

void PGenericParser::loadDirExtraFunctionFile ( const PPath inputFile)
protected

Load the extra functions with input file.

Parameters
inputFile: input directory

Definition at line 636 of file PGenericParser.cpp.

636  {
637  PXml root;
638  if(!pxml_parserFile(root, inputFile)){
639  std::cerr << "PGenericParser::loadDirExtraFunctionFile : can't read file '"<<inputFile<<"'" << std::endl;
640  return;
641  }
642  PXml & childXml = root.getVecChild().front();
643  if(!pxml_getChildIfExist(childXml, root, "function")){
644  std::cerr << "PGenericParser::loadDirExtraFunctionFile : can't find <function> </function> balise in file '"<<inputFile<<"'" << std::endl;
645  return;
646  }
647  PVecXml listEnv;
648  if(pxml_getVecChildIfExist(listEnv, childXml, "fct")){
649  for(PVecXml::iterator it(listEnv.begin()); it != listEnv.end(); ++it){
650  PXmlAttr attrName;
651  if(!pxml_getAttrIfExist(attrName, *it, "name")){continue;}
652  PString name(attrName.getValue());
653  if(name == ""){
654  std::cerr << "PGenericParser::loadDirExtraFunctionFile : expect name in balise" << std::endl;
655  continue;
656  }
657  PString balise("span");
658  PXmlAttr attr;
659  if(pxml_getAttrIfExist(attr, *it, "balise")){
660  balise = attr.getValue();
661  }
662  PString contentStr(pxml_getFullContent(*it));
663  PEnvironement tmp;
664  tmp.setName(name);
665  tmp.setBalise(balise);
666  tmp.setCss(contentStr);
667 
668  p_vecExtraFunction[name] = tmp;
669  p_vecNameExtraFunction.push_back("\\" + name);
670  }
671  }
672 }

References PXmlAttr::getValue(), PXml::getVecChild(), p_vecExtraFunction, p_vecNameExtraFunction, pxml_getAttrIfExist(), pxml_getChildIfExist(), pxml_getFullContent(), pxml_getVecChildIfExist(), pxml_parserFile(), PEnvironement::setBalise(), PEnvironement::setCss(), and PEnvironement::setName().

Referenced by loadDirExtraFunction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadDirExtraParser()

void PGenericParser::loadDirExtraParser ( const PPath inputDir)
protected

Load the extra parsers.

Parameters
inputDir: input directory

Definition at line 772 of file PGenericParser.cpp.

772  {
773  PListFile listInputFile = inputDir.getAllElementInDir();
774  if(listInputFile.size() == 0lu){
775  std::cerr << "PGenericParser::loadDirExtraParser : can't read directory '"<<inputDir<<"'" << std::endl;
776  return;
777  }
778  for(PListFile::iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
779  loadDirExtraParserFile(inputDir / (*it));
780  }
781 }
void loadDirExtraParserFile(const PPath &inputFile)
Load the extra environements with input file.

References PPath::getAllElementInDir(), and loadDirExtraParserFile().

Referenced by initialisationPGenericParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadDirExtraParserFile()

void PGenericParser::loadDirExtraParserFile ( const PPath inputFile)
protected

Load the extra environements with input file.

Parameters
inputFile: input directory

Definition at line 691 of file PGenericParser.cpp.

691  {
692  PXml root;
693  if(!pxml_parserFile(root, inputFile)){
694  std::cerr << "PGenericParser::loadDirExtraParserFile : can't read file '"<<inputFile<<"'" << std::endl;
695  return;
696  }
697  PXml & childXml = root.getVecChild().front();
698  if(!pxml_getChildIfExist(childXml, root, "highlighting")){
699  std::cerr << "PGenericParser::loadDirExtraParserFile : can't find <highlighting> </highlighting> balise in file '"<<inputFile<<"'" << std::endl;
700  return;
701  }
702  PString environementName(inputFile.getFileName().eraseExtension());
703  p_vecNameExtraParser.push_back(environementName);
704  p_vecNameFunctionExtraParser.push_back("\\" + environementName);
705  p_vecNameMarkdownExtraParser.push_back("```" + environementName);
706 
707  PParserEnv parserEnv;
708  parserEnv.setName(environementName);
709 
710  PXml matchPlainText;
711  if(pxml_getChildIfExist(matchPlainText, childXml, "plainText")){
712  parserEnv.setPlainText(convertBackSlahedStr(pxml_getFullContent(matchPlainText)));
713  }
714  PVecXml listEnv;
715  if(pxml_getVecChildIfExist(listEnv, childXml, "context")){
716  for(PVecXml::iterator itBalise(listEnv.begin()); itBalise != listEnv.end(); ++itBalise){
717  PXmlAttr attrClass;
718  if(!pxml_getAttrIfExist(attrClass, *itBalise, "class")){continue;}
719  PString nameClass(attrClass.getValue());
720  if(nameClass == ""){
721  std::cerr << "PGenericParser::loadDirExtraEnvironementFile : expect 'class' in balise" << std::endl;
722  continue;
723  }
724  PContext tmp;
725  tmp.setName(nameClass);
726 
727  PXml matchBegin;
728  if(pxml_getChildIfExist(matchBegin, *itBalise, "begin")){
730  }
731  PXml matchEnd;
732  if(pxml_getChildIfExist(matchEnd, *itBalise, "end")){
734  }
735  PXml matchNotBeforeBegin;
736  if(pxml_getChildIfExist(matchNotBeforeBegin, *itBalise, "notBeforeBegin")){
738  }
739  PXml matchNotAfterBegin;
740  if(pxml_getChildIfExist(matchNotAfterBegin, *itBalise, "notAfterBegin")){
742  }
743  PXml matchNotBeforEnd;
744  if(pxml_getChildIfExist(matchNotBeforEnd, *itBalise, "notBeforeEnd")){
746  }
747  PVecXml listKw;
748  if(pxml_getVecChildIfExist(listKw, *itBalise, "keyword")){
749  for(PVecXml::iterator it(listKw.begin()); it != listKw.end(); ++it){
751  }
752  }
753 
754  PXml matchSequence;
755  if(pxml_getChildIfExist(matchSequence, *itBalise, "sequence")){
756  PParseSeq seq;
757  if(loadParserSeq(seq, matchSequence)){
758  tmp.setSeq(seq);
759  }else{
760  std::cerr << "PGenericParser::loadDirExtraParserFile : can't initialise sequence with balise in file '"<<inputFile<<"'" << std::endl;
761  }
762  }
763  parserEnv.getVecContext().push_back(tmp);
764  }
765  p_vecExtraParser.getVecEnv().push_back(parserEnv);
766  }
767 }
bool loadParserSeq(PParseSeq &seq, const PXml &xmlSeq)
Load a ParseSeq with a XML balise.
Context for parser environement.
Definition: PLatexObj.h:310
void setBegin(const PString &begin)
Sets the begin of the PContext.
Definition: PLatexObj.cpp:1240
void setNotBeforeBegin(const PString &notBeforeBegin)
Sets the notBeforeBegin of the PContext.
Definition: PLatexObj.cpp:1254
void setSeq(const PParseSeq &seq)
Sets the seq of the PContext.
Definition: PLatexObj.cpp:1282
void setNotBeforeEnd(const PString &notBeforeEnd)
Sets the notBeforeEnd of the PContext.
Definition: PLatexObj.cpp:1268
const std::vector< PString > & getVecKeyword() const
Gets the vecKeyword of the PContext.
Definition: PLatexObj.cpp:1373
void setEnd(const PString &end)
Sets the end of the PContext.
Definition: PLatexObj.cpp:1247
void setNotAfterBegin(const PString &notAfterBegin)
Sets the notAfterBegin of the PContext.
Definition: PLatexObj.cpp:1261
void setName(const PString &name)
Sets the name of the PContext.
Definition: PLatexObj.cpp:1233
Parsing sequence.
Definition: PParseSeq.h:77
Parser environement.
Definition: PLatexObj.h:363
void setName(const PString &name)
Sets the name of the PParserEnv.
Definition: PLatexObj.cpp:1451
void setPlainText(const PString &plainText)
Sets the plainText of the PParserEnv.
Definition: PLatexObj.cpp:1458
const std::vector< PContext > & getVecContext() const
Gets the vecContext of the PParserEnv.
Definition: PLatexObj.cpp:1500
PPath & eraseExtension()
Erase the extension of the PPath.
Definition: PPath.cpp:292
PPath getFileName() const
Get the name of the file, from last char to /.
Definition: PPath.cpp:172
const std::vector< PParserEnv > & getVecEnv() const
Gets the vecEnv of the PVecParserEnv.
Definition: PLatexObj.cpp:1562
PString convertBackSlahedStr(const PString &str)
Convert all the echaped char.

References convertBackSlahedStr(), PPath::eraseExtension(), PPath::getFileName(), PXmlAttr::getValue(), PXml::getVecChild(), PParserEnv::getVecContext(), PVecParserEnv::getVecEnv(), PContext::getVecKeyword(), loadParserSeq(), p_vecExtraParser, p_vecNameExtraParser, p_vecNameFunctionExtraParser, p_vecNameMarkdownExtraParser, pxml_getAttrIfExist(), pxml_getChildIfExist(), pxml_getFullContent(), pxml_getVecChildIfExist(), pxml_parserFile(), PContext::setBegin(), PContext::setEnd(), PContext::setName(), PParserEnv::setName(), PContext::setNotAfterBegin(), PContext::setNotBeforeBegin(), PContext::setNotBeforeEnd(), PParserEnv::setPlainText(), and PContext::setSeq().

Referenced by loadDirExtraParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadMapFile()

void PGenericParser::loadMapFile ( )
protected

Load the map of copied files.

Definition at line 800 of file PGenericParser.cpp.

800  {
801  PString fileName(COPIED_RECOVER_FILE);
802  if(!data_load(fileName, p_mapCopiedFile)){return;}
803 }
#define COPIED_RECOVER_FILE
Define the name of the file which contains the formulae and the path to the created file.
bool data_load(FILE *iter, T &data)
Load data from a message.
Definition: data_file.h:39

References COPIED_RECOVER_FILE, data_load(), and p_mapCopiedFile.

Referenced by initialisationPGenericParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

PGenericParser & PGenericParser::operator= ( const PGenericParser other)

Definition of equal operator of PGenericParser.

Parameters
other: class to copy
Returns
copied class

Definition at line 72 of file PGenericParser.cpp.

72  {
73  copyPGenericParser(other);
74  return *this;
75 }

References copyPGenericParser().

+ Here is the call graph for this function:

◆ parseBookEnableFeedback()

bool PGenericParser::parseBookEnableFeedback ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the book enable feedback mode.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 521 of file PGenericParser.cpp.

521  {
522  if(!p_parser->isMatchToken("\\bookEnableFeedback")){return false;}
523  playTextLatexObj(parent, textObj);
524  PString title(getStringBetweenBraces("\\bookEnableFeedback").toLower());
525  title = executeLatexCommand(title);
526  p_isEnableBookFeedback = (title == "true" || title == "yes" || title == "1");
527  return true;
528 }
bool playTextLatexObj(PLatexObj &parent, PLatexObj &textObj, bool isRemoveFirstLastSpace=false)
Play the text latex obj.
PString executeLatexCommand(const PString &inputStr)
Execute the given latex command.
PString getStringBetweenBraces(const PString &previousToken)
Get the string between the braces {...}.

References executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), p_isEnableBookFeedback, PMultiFileParser::p_parser, and playTextLatexObj().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseBookGitlabUrl()

bool PGenericParser::parseBookGitlabUrl ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the gitlab url in book mode.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 508 of file PGenericParser.cpp.

508  {
509  if(!p_parser->isMatchToken("\\bookGitlabUrl")){return false;}
510  playTextLatexObj(parent, textObj);
511  PString title(getStringBetweenBraces("\\bookGitlabUrl"));
513  return true;
514 }
PString eraseLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:521

References PString::eraseLastChar(), executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), p_bookGitlabUrl, PMultiFileParser::p_parser, and playTextLatexObj().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseBookMail()

bool PGenericParser::parseBookMail ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the mail in book mode.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 535 of file PGenericParser.cpp.

535  {
536  if(!p_parser->isMatchToken("\\bookMail")){return false;}
537  playTextLatexObj(parent, textObj);
538  PString title(getStringBetweenBraces("\\bookMail"));
540  return true;
541 }

References executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), p_bookMail, PMultiFileParser::p_parser, and playTextLatexObj().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseBookMasterProject()

bool PGenericParser::parseBookMasterProject ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the master project in book mode.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 548 of file PGenericParser.cpp.

548  {
549  if(!p_parser->isMatchToken("\\bookMasterProject")){return false;}
550  playTextLatexObj(parent, textObj);
551  PString title(getStringBetweenBraces("\\bookMasterProject"));
553  return true;
554 }

References PString::eraseLastChar(), executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), p_bookMasterProjectUrl, PMultiFileParser::p_parser, and playTextLatexObj().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseBookSizeBarWidth()

bool PGenericParser::parseBookSizeBarWidth ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the width of the book sidebar.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 495 of file PGenericParser.cpp.

495  {
496  if(!p_parser->isMatchToken("\\bookSizebarWidth")){return false;}
497  playTextLatexObj(parent, textObj);
498  PString title(getStringBetweenBraces("\\bookSizebarWidth"));
500  return true;
501 }

References executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), p_bookSideBarWidth, PMultiFileParser::p_parser, and playTextLatexObj().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseFile()

virtual bool PMultiFileParser::parseFile ( )
protectedpure virtualinherited

Implemented in PMarkdownParser, PConfigParser, and ConfigParser.

Referenced by PMultiFileParser::fullParsing().

+ Here is the caller graph for this function:

◆ parseGenericLatexObj()

bool PGenericParser::parseGenericLatexObj ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the generic latex function which have to be used in the latex parser and the markdown parser too.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 385 of file PGenericParser.cpp.

385  {
386  if(parseMonoParam(parent, textObj, "\\updateStyle", PLatexType::UPDATESTYLE)){}
387  else if(parseMonoParam(parent, textObj, "\\ref", PLatexType::REF)){}
388  else if(parseMonoParam(parent, textObj, "\\cite", PLatexType::CITATION)){}
389  else if(parseLabel(parent, textObj)){}
390  else if(parserGetEnv(parent, textObj)){}
391  else if(parseMainTitle(parent, textObj)){}
392  else if(parseMainSubTitle(parent, textObj)){}
393  else if(parseMainAuthor(parent, textObj)){}
394  else if(parseMainDate(parent, textObj)){}
395  else if(parseBookSizeBarWidth(parent, textObj)){}
396  else if(parseBookGitlabUrl(parent, textObj)){}
397  else if(parseBookEnableFeedback(parent, textObj)){}
398  else if(parseBookMail(parent, textObj)){}
399  else if(parseBookMasterProject(parent, textObj)){}
400  else{return false;}
401  return true;
402 }
bool parserGetEnv(PLatexObj &parent, PLatexObj &textObj)
Parse a getenv function.
bool parseBookMail(PLatexObj &parent, PLatexObj &textObj)
Parse the mail in book mode.
bool parseBookSizeBarWidth(PLatexObj &parent, PLatexObj &textObj)
Parse the width of the book sidebar.
bool parseBookGitlabUrl(PLatexObj &parent, PLatexObj &textObj)
Parse the gitlab url in book mode.
bool parseMainDate(PLatexObj &parent, PLatexObj &textObj)
Parse the main date of the site.
bool parseMainSubTitle(PLatexObj &parent, PLatexObj &textObj)
Parse the main title of the site.
bool parseMainAuthor(PLatexObj &parent, PLatexObj &textObj)
Parse the main author of the site.
bool parseBookEnableFeedback(PLatexObj &parent, PLatexObj &textObj)
Parse the book enable feedback mode.
bool parseMainTitle(PLatexObj &parent, PLatexObj &textObj)
Parse the main title of the site.
bool parseBookMasterProject(PLatexObj &parent, PLatexObj &textObj)
Parse the master project in book mode.
bool parseMonoParam(PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
Parse all the functions which have mono parameter in braces {...}.
bool parseLabel(PLatexObj &parent, PLatexObj &textObj)
Parse latex label.

References PLatexType::CITATION, parseBookEnableFeedback(), parseBookGitlabUrl(), parseBookMail(), parseBookMasterProject(), parseBookSizeBarWidth(), parseLabel(), parseMainAuthor(), parseMainDate(), parseMainSubTitle(), parseMainTitle(), parseMonoParam(), parserGetEnv(), PLatexType::REF, and PLatexType::UPDATESTYLE.

Referenced by PConfigParser::parseAllLatexObj(), and PMarkdownParser::parseAllLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseLabel()

bool PGenericParser::parseLabel ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse latex label.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 409 of file PGenericParser.cpp.

409  {
410  if(!p_parser->isMatchToken("\\label")){return false;}
411  playTextLatexObj(parent, textObj);
412  PString link(getStringBetweenBraces("\\label"));
413 
414  PLatexObj* ptrLatex = getLastPLatexObj(parent);
415  if(ptrLatex != NULL){
416  ptrLatex->setLabelName(link);
417  }
418  return true;
419 }
Describe a latex object.
Definition: PLatexObj.h:40
PLatexObj * getLastPLatexObj(PLatexObj &obj)
Get the last PLatexObj of the given one.

References getLastPLatexObj(), getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, playTextLatexObj(), and PLatexObj::setLabelName().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseMainAuthor()

bool PGenericParser::parseMainAuthor ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the main author of the site.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 469 of file PGenericParser.cpp.

469  {
470  if(!p_parser->isMatchToken("\\author")){return false;}
471  playTextLatexObj(parent, textObj);
472  PString title(getStringBetweenBraces("\\author"));
473  parent.setAuthor(executeLatexCommand(title));
474  return true;
475 }
void setAuthor(const PString &author)
Sets the author of the PLatexObj.
Definition: PLatexObj.cpp:235

References executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, playTextLatexObj(), and PLatexObj::setAuthor().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseMainDate()

bool PGenericParser::parseMainDate ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the main date of the site.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 482 of file PGenericParser.cpp.

482  {
483  if(!p_parser->isMatchToken("\\date")){return false;}
484  playTextLatexObj(parent, textObj);
485  PString title(getStringBetweenBraces("\\date"));
486  parent.setDate(executeLatexCommand(title));
487  return true;
488 }
void setDate(const PString &date)
Sets the date of the PLatexObj.
Definition: PLatexObj.cpp:242

References executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, playTextLatexObj(), and PLatexObj::setDate().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseMainSubTitle()

bool PGenericParser::parseMainSubTitle ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the main title of the site.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 456 of file PGenericParser.cpp.

456  {
457  if(!p_parser->isMatchToken("\\subtitle")){return false;}
458  playTextLatexObj(parent, textObj);
459  PString title(getStringBetweenBraces("\\subtitle"));
460  parent.setSubTitle(executeLatexCommand(title));
461  return true;
462 }
void setSubTitle(const PString &subTitle)
Sets the subTitle of the PLatexObj.
Definition: PLatexObj.cpp:151

References executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, playTextLatexObj(), and PLatexObj::setSubTitle().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseMainTitle()

bool PGenericParser::parseMainTitle ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse the main title of the site.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 443 of file PGenericParser.cpp.

443  {
444  if(!p_parser->isMatchToken("\\title")){return false;}
445  playTextLatexObj(parent, textObj);
446  PString title(getStringBetweenBraces("\\title"));
447  parent.setName(executeLatexCommand(title));
448  return true;
449 }

References executeLatexCommand(), getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, playTextLatexObj(), and PLatexObj::setName().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseMonoParam()

bool PGenericParser::parseMonoParam ( PLatexObj parent,
PLatexObj textObj,
const PString functionName,
PLatexType::PLatexType  type 
)
protected

Parse all the functions which have mono parameter in braces {...}.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
functionName: name of the expected function
type: type of the expected function
Returns
true on success, false otherwise

Definition at line 364 of file PGenericParser.cpp.

364  {
365  if(!p_parser->isMatch(functionName)){return false;}
366  playTextLatexObj(parent, textObj);
367  PLatexObj tmp;
368  tmp.setType(type);
369 
370  PString textOption(getOptionStringBetweenHook());
371  tmp.setText(textOption);
372 
373  PString title(getStringBetweenBraces(functionName));
374  tmp.setName(title);
375 
376  addLatexObj(parent, tmp);
377  return true;
378 }
void addLatexObj(PLatexObj &parent, const PLatexObj &obj)
Add latex obj in parent.
PString getOptionStringBetweenHook()
Get optional string between hooks [...].

References addLatexObj(), getOptionStringBetweenHook(), getStringBetweenBraces(), PFileParser::isMatch(), PMultiFileParser::p_parser, playTextLatexObj(), PLatexObj::setName(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by PConfigParser::parseAllLatexObj(), and parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parserGetEnv()

bool PGenericParser::parserGetEnv ( PLatexObj parent,
PLatexObj textObj 
)
protected

Parse a getenv function.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
Returns
true on success, false otherwise

Definition at line 426 of file PGenericParser.cpp.

426  {
427  if(!p_parser->isMatchToken("\\getenv")){return false;}
428  playTextLatexObj(parent, textObj);
429  PString title(getStringBetweenBraces("\\getenv"));
430  PLatexObj tmp;
432  tmp.setName(title);
433  addLatexObj(parent, tmp);
434 
435  return true;
436 }

References addLatexObj(), PLatexType::GETENV, getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, playTextLatexObj(), PLatexObj::setName(), and PLatexObj::setType().

Referenced by parseGenericLatexObj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playTextLatexObj()

bool PGenericParser::playTextLatexObj ( PLatexObj parent,
PLatexObj textObj,
bool  isRemoveFirstLastSpace = false 
)
protected

Play the text latex obj.

Parameters
[out]parent: parent PMacro
[out]textObj: PLatexObj to deal with text
isRemoveFirstLastSpace: true to remove first and last spaces (tabs and newline) before added the text object
Returns
true if the textObj is added, false otherwise

Definition at line 279 of file PGenericParser.cpp.

279  {
280  if(isRemoveFirstLastSpace){
281  textObj.setText(textObj.getText().eraseFirstLastChar(" \t\n"));
282  }
283  if(textObj.getText() != ""){
284  parent.getVecContent().push_back(textObj);
285  clearLatexObj(textObj);
286  return true;
287  }
288  return false;
289 }
void clearLatexObj(PLatexObj &obj)
Clear a latex obj.
PString eraseFirstLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:545

References clearLatexObj(), PString::eraseFirstLastChar(), PLatexObj::getText(), PLatexObj::getVecContent(), and PLatexObj::setText().

Referenced by PConfigParser::loadInclude(), PConfigParser::parseAddSpeaker(), parseBookEnableFeedback(), parseBookGitlabUrl(), parseBookMail(), parseBookMasterProject(), parseBookSizeBarWidth(), PConfigParser::parseComment(), PMarkdownParser::parseComment(), PConfigParser::parseComplexMonoParam(), PMarkdownParser::parseComplexMonoParam(), PConfigParser::parseDebug(), PConfigParser::parseDots(), PConfigParser::parseDoubleInlineMath(), PMarkdownParser::parseEnumerate(), PMarkdownParser::parseEnumerateItem(), PMarkdownParser::parseEnvDecoration(), PConfigParser::parseEnvironementContent(), PConfigParser::parseEnvStringOnly(), PMarkdownParser::parseExtraEnvironement(), PConfigParser::parseExtraEnvironementFunction(), PConfigParser::parseExtraFunction(), PMarkdownParser::parseExtraParser(), PConfigParser::parseFile(), PMarkdownParser::parseFile(), PConfigParser::parseHref(), PMarkdownParser::parseHref(), PConfigParser::parseIncludeFile(), PConfigParser::parseIncludeGraphic(), PMarkdownParser::parseIncludeGraphic(), PConfigParser::parseInlineMath(), PConfigParser::parseInputFile(), PConfigParser::parseItem(), PMarkdownParser::parseItem(), PMarkdownParser::parseItemize(), parseLabel(), parseMainAuthor(), parseMainDate(), parseMainSubTitle(), parseMainTitle(), parseMonoParam(), PConfigParser::parseNewLine(), PMarkdownParser::parseNewLine(), PConfigParser::parseParserLanguage(), PConfigParser::parseParserLanguageFunction(), PConfigParser::parsePercent(), PMarkdownParser::parsePercent(), PConfigParser::parserCallDot(), PConfigParser::parserDetails(), PConfigParser::parseRealNewLine(), parserGetEnv(), PConfigParser::parserQuote(), PConfigParser::parserSvgToPng(), PConfigParser::parseSaveSpeaker(), PConfigParser::parseSectionTitle(), PMarkdownParser::parseSectionTitle(), PConfigParser::parseSpaceParagraphe(), PConfigParser::parseTabular(), PMarkdownParser::parseTextDecoration(), PConfigParser::parseTimeTable(), PMarkdownParser::parseUrl(), PConfigParser::parseVecLatexObj(), PMarkdownParser::parseVecLatexObj(), PConfigParser::parseVideo(), and PMarkdownParser::parseWip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pointAtRow()

void PMultiFileParser::pointAtRow ( )
inherited

Point the problem.

Definition at line 138 of file PMultiFileParser.cpp.

138  {
139  std::cerr << "\tAt row :\n" << p_parser->getCurrentRow() << std::endl;
140  for(size_t i(0lu); i < p_parser->getColumn(); ++i){
141  std::cerr << " ";
142  }
143  std::cerr << "^" << std::endl;
144 }
PString getCurrentRow() const
Get the current parsed row.
size_t getColumn() const
Fonction qui renvoie le numéro de la colonne du caractère courant.

References PFileParser::getColumn(), PFileParser::getCurrentRow(), and PMultiFileParser::p_parser.

Referenced by PMultiFileParser::fullParsing(), and ConfigParser::parseFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ postLoadFile()

void PMultiFileParser::postLoadFile ( )
protectedvirtualinherited

Post load file.

Reimplemented in PMarkdownParser, PConfigParser, and ConfigParser.

Definition at line 116 of file PMultiFileParser.cpp.

116  {
117 
118 }

Referenced by PMultiFileParser::fullParsing().

+ Here is the caller graph for this function:

◆ preLoadFile()

void PMultiFileParser::preLoadFile ( )
protectedvirtualinherited

Pre load file.

Reimplemented in PMarkdownParser, PConfigParser, and ConfigParser.

Definition at line 111 of file PMultiFileParser.cpp.

111  {
112 
113 }

Referenced by PMultiFileParser::fullParsing().

+ Here is the caller graph for this function:

◆ saveCss()

bool PGenericParser::saveCss ( )

Save the css file.

Returns
true on success, false otherwise

Definition at line 167 of file PGenericParser.cpp.

167  {
168  PVecString vecTheme;
169  for(std::map<PString, PString>::iterator itStyle(p_cssContent.begin()); itStyle != p_cssContent.end(); ++itStyle){
170  vecTheme.push_back(itStyle->first);
171  }
172 
173  for(std::map<PString, PString>::iterator itStyle(p_cssContent.begin()); itStyle != p_cssContent.end(); ++itStyle){
174  PString cssStyle(itStyle->second), cssThemeName(itStyle->first);
175  if(p_vecExtraEnv.size() != 0lu){
176  for(PMapExtraEnv::iterator it(p_vecExtraEnv.begin()); it != p_vecExtraEnv.end(); ++it){
177  cssStyle += "." + it->second.getName() + "Style{\n";
178  cssStyle += select_css_theme(vecTheme, cssThemeName, it->second.getCss());
179  cssStyle += "}\n\n";
180  }
181  }
182  if(p_vecExtraFunction.size() != 0lu){
183  for(PMapExtraEnv::iterator it(p_vecExtraFunction.begin()); it != p_vecExtraFunction.end(); ++it){
184  cssStyle += "." + it->second.getName() + "Style{\n";
185  cssStyle += select_css_theme(vecTheme, cssThemeName, it->second.getCss());
186  cssStyle += "}\n\n";
187  }
188  }
189  PPath fileName(cssThemeName + "_style.css");
190  if(!fileName.saveFileContent(cssStyle)){
191  std::cerr << "PGenericParser::saveCss : can't save the file '"<<fileName<<"'" << std::endl;
192  return false;
193  }
194  }
195  return true;
196 }
std::vector< PString > PVecString
Definition: PString.h:96
PString select_css_theme(const PVecString &vecTheme, const PString &themeName, const PString &css)
Select the right css option by respect to the given theme.

References p_cssContent, p_vecExtraEnv, p_vecExtraFunction, PPath::saveFileContent(), and select_css_theme().

+ Here is the call graph for this function:

◆ saveMapFile()

void PGenericParser::saveMapFile ( )
protected

Save the map of copied files.

Definition at line 806 of file PGenericParser.cpp.

806  {
807  PString fileName(COPIED_RECOVER_FILE);
808  if(!data_save(fileName, p_mapCopiedFile)){return;}
809 }
bool data_save(FILE *iter, const T &data)
Save data in a message.
Definition: data_file.h:18

References COPIED_RECOVER_FILE, data_save(), and p_mapCopiedFile.

Referenced by PConfigParser::~PConfigParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDebugMode()

void PGenericParser::setDebugMode ( bool  isDebugMode)

Set if the PGenericParser is in debug mode.

Parameters
isDebugMode: true if the PGenericParser is in debug mode, false if not

Definition at line 80 of file PGenericParser.cpp.

80  {
81  p_isDebugMode = isDebugMode;
82 }

References p_isDebugMode.

◆ setFileContent()

void PMultiFileParser::setFileContent ( const PString fileContent)
inherited

Set the file content to be parsed.

Parameters
fileContent: file content to be parsed

Definition at line 43 of file PMultiFileParser.cpp.

43  {
44  if(p_parser == NULL){
45  PFileParser parser;
46  p_listFileParser.push_back(parser);
48  p_parser = &p_listFileParser.back();
49  }
50  p_parser = &p_listFileParser.back();
51  p_parser->setFileContent(fileContent);
52 }
void setFileContent(const PString &fileContent)
Set the file content.
Definition: PFileParser.cpp:50

References MULTI_PARSER_SEPARATORS_STRING, PMultiFileParser::p_listFileParser, PMultiFileParser::p_parser, and PFileParser::setFileContent().

Referenced by checkPMultiFileParser(), executeLatexCommand(), and platexobj_parseStr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skipComment()

void PMultiFileParser::skipComment ( )
inherited

Skip comment.

Definition at line 177 of file PMultiFileParser.cpp.

177  {
178  bool isCommentFound(false);
179  do{
180  isCommentFound = false;
181  PListMultiCommentConfig::iterator it(p_listCommentConfig.begin());
182  while(it != p_listCommentConfig.end() && !isCommentFound && p_run && !p_parser->isEndOfFile()){
183  if(p_parser->isMatch(it->first)){
184  p_lastComment += it->first + p_parser->getUntilKey(it->second);
185  isCommentFound = true;
186  }
187  ++it;
188  }
189  }while(isCommentFound && p_run && !p_parser->isEndOfFile());
190 }

References PFileParser::getUntilKey(), PFileParser::isEndOfFile(), PFileParser::isMatch(), PMultiFileParser::p_lastComment, PMultiFileParser::p_listCommentConfig, PMultiFileParser::p_parser, and PMultiFileParser::p_run.

Referenced by PMultiFileParser::getStrComposedOf(), PMultiFileParser::isMatch(), PMultiFileParser::isMatchRewind(), PMultiFileParser::isMatchSeq(), and PMultiFileParser::isMatchToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stopParsing()

◆ unexpectedToken()

void PMultiFileParser::unexpectedToken ( )
inherited

Print unexpected token error.

Definition at line 131 of file PMultiFileParser.cpp.

131  {
132  errorAt();
133  std::cerr << "PMultiFileParser::parseFile : unexpected token '"<<p_parser->getNextToken()<<"'" << std::endl;
134  stopParsing();
135 }

References PMultiFileParser::errorAt(), PFileParser::getNextToken(), PMultiFileParser::p_parser, and PMultiFileParser::stopParsing().

Referenced by PMultiFileParser::fullParsing(), and ConfigParser::parseFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ p_bookGitlabUrl

PString PGenericParser::p_bookGitlabUrl
protected

Gitlab url of the current sources of the project.

Definition at line 156 of file PGenericParser.h.

Referenced by copyPGenericParser(), getBookGitlabUrl(), and parseBookGitlabUrl().

◆ p_bookMail

PString PGenericParser::p_bookMail
protected

Mail to be used to contact authors in book mode.

Definition at line 160 of file PGenericParser.h.

Referenced by copyPGenericParser(), getBookMail(), and parseBookMail().

◆ p_bookMainPageLink

PLatexObj PGenericParser::p_bookMainPageLink
protected

Main page definition of the full site.

Definition at line 164 of file PGenericParser.h.

Referenced by copyPGenericParser(), getBookMainPageLink(), initialisationPGenericParser(), and PConfigParser::parseBookMainPageLink().

◆ p_bookMasterProjectUrl

PString PGenericParser::p_bookMasterProjectUrl
protected

Master project url in book mode.

Definition at line 162 of file PGenericParser.h.

Referenced by copyPGenericParser(), getBookMasterProjectUrl(), and parseBookMasterProject().

◆ p_bookSideBarWidth

PString PGenericParser::p_bookSideBarWidth
protected

Witdh of the book side bar.

Definition at line 154 of file PGenericParser.h.

Referenced by copyPGenericParser(), getBookSideBarWidth(), initialisationPGenericParser(), and parseBookSizeBarWidth().

◆ p_cssContent

std::map<PString, PString> PGenericParser::p_cssContent
protected

Css of all the configurations.

Definition at line 146 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadCss(), and saveCss().

◆ p_currentSource

PLatexObj PGenericParser::p_currentSource
protected

◆ p_currentText

PLatexObj PGenericParser::p_currentText
protected

◆ p_currentToken

PString PMultiFileParser::p_currentToken
protectedinherited

◆ p_inputDirectory

PPath PMultiFileParser::p_inputDirectory
protectedinherited

Input directory of the parser.

Definition at line 80 of file PMultiFileParser.h.

Referenced by PMultiFileParser::initialisationPMultiFileParser().

◆ p_isDebugMode

bool PGenericParser::p_isDebugMode
protected

True if be parse in debug mode.

Definition at line 103 of file PGenericParser.h.

Referenced by copyPGenericParser(), initialisationPGenericParser(), PConfigParser::parseDebug(), and setDebugMode().

◆ p_isEnableBookFeedback

bool PGenericParser::p_isEnableBookFeedback
protected

True to enable feedback in book mode.

Definition at line 158 of file PGenericParser.h.

Referenced by copyPGenericParser(), getBookEnableFeedback(), initialisationPGenericParser(), and parseBookEnableFeedback().

◆ p_lastComment

PString PMultiFileParser::p_lastComment
protectedinherited

◆ p_listCommentConfig

PListMultiCommentConfig PMultiFileParser::p_listCommentConfig
privateinherited

Defines the differents comments we allow in the parsing.

Definition at line 88 of file PMultiFileParser.h.

Referenced by PMultiFileParser::addCommentConfig(), PMultiFileParser::getCurrentTokenWithoutComment(), and PMultiFileParser::skipComment().

◆ p_listFileParser

std::list<PFileParser> PMultiFileParser::p_listFileParser
protectedinherited

List of all the parsers for all the loaded files.

Definition at line 72 of file PMultiFileParser.h.

Referenced by PMultiFileParser::fullParsing(), PMultiFileParser::load(), PConfigParser::loadInclude(), and PMultiFileParser::setFileContent().

◆ p_mapBiblioEntry

PMapBiblioEntry PGenericParser::p_mapBiblioEntry
protected

Map of all bibliography entries.

Definition at line 148 of file PGenericParser.h.

Referenced by copyPGenericParser(), and getMapBiblioEntry().

◆ p_mapCopiedFile

PMapFile PGenericParser::p_mapCopiedFile
protected

Map of copied files.

Definition at line 150 of file PGenericParser.h.

Referenced by copyFile(), copyPGenericParser(), loadMapFile(), and saveMapFile().

◆ p_outputDirectory

PPath PMultiFileParser::p_outputDirectory
protectedinherited

Output directory of the parser.

Definition at line 82 of file PMultiFileParser.h.

Referenced by PMultiFileParser::initialisationPMultiFileParser().

◆ p_parser

PFileParser* PMultiFileParser::p_parser
protectedinherited

Parser helper for the config file.

Definition at line 70 of file PMultiFileParser.h.

Referenced by PMultiFileParser::checkExpectedMatch(), PMultiFileParser::errorAt(), PMultiFileParser::fullParsing(), getAbsoluteFileName(), PMultiFileParser::getCurrentParser(), PMultiFileParser::getCurrentTokenWithoutComment(), getOptionStringBetweenBraces(), getOptionStringBetweenHook(), PMultiFileParser::getStrComposedOf(), getStringBetweenBraces(), incrementCurrentChar(), PMultiFileParser::initialisationPMultiFileParser(), PMarkdownParser::isEnumerateItem(), PMarkdownParser::isItem(), PMultiFileParser::isMatch(), PMultiFileParser::isMatchRewind(), PMultiFileParser::isMatchSeq(), PMultiFileParser::isMatchToken(), PMultiFileParser::load(), PConfigParser::loadInclude(), PConfigParser::parseAddSpeaker(), PConfigParser::parseAllLatexObj(), parseBookEnableFeedback(), parseBookGitlabUrl(), parseBookMail(), parseBookMasterProject(), parseBookSizeBarWidth(), PConfigParser::parseComment(), PMarkdownParser::parseComment(), PConfigParser::parseComplexMonoParam(), PMarkdownParser::parseComplexMonoParam(), PConfigParser::parseDebug(), ConfigParser::parseDocString(), PConfigParser::parseDoubleInlineMath(), PMarkdownParser::parseEnumerate(), PMarkdownParser::parseEnumerateItem(), PMarkdownParser::parseEnvDecoration(), PConfigParser::parseEnvironement(), PConfigParser::parseEnvironementContent(), PConfigParser::parseEnvStringOnly(), PConfigParser::parseExtraEnvironement(), PMarkdownParser::parseExtraEnvironement(), PConfigParser::parseExtraEnvironementFunction(), PConfigParser::parseExtraFunction(), PMarkdownParser::parseExtraParser(), ConfigParser::parseFile(), PConfigParser::parseFile(), PMarkdownParser::parseFile(), PConfigParser::parseHref(), PMarkdownParser::parseHref(), PConfigParser::parseIncludeFile(), PConfigParser::parseIncludeGraphic(), PMarkdownParser::parseIncludeGraphic(), PConfigParser::parseInlineMath(), PConfigParser::parseInputFile(), PConfigParser::parseItem(), PMarkdownParser::parseItem(), PMarkdownParser::parseItemize(), parseLabel(), parseMainAuthor(), parseMainDate(), parseMainSubTitle(), parseMainTitle(), parseMonoParam(), PConfigParser::parseNewLine(), PMarkdownParser::parseNewLine(), PConfigParser::parseParserLanguage(), PConfigParser::parseParserLanguageFunction(), PConfigParser::parsePercent(), PMarkdownParser::parsePercent(), PConfigParser::parserCallDot(), PConfigParser::parserDetails(), PConfigParser::parseRealNewLine(), parserGetEnv(), PConfigParser::parserQuote(), PConfigParser::parserSvgToPng(), PConfigParser::parseSaveSpeaker(), PConfigParser::parseSectionTitle(), PMarkdownParser::parseSectionTitle(), PConfigParser::parseStringAndGoBack(), PConfigParser::parseTabular(), PMarkdownParser::parseTextDecoration(), PConfigParser::parseTimeTable(), PMarkdownParser::parseUrl(), PConfigParser::parseVecLatexObj(), PMarkdownParser::parseVecLatexObj(), PConfigParser::parseVideo(), PMarkdownParser::parseWip(), PMultiFileParser::pointAtRow(), PConfigParser::preLoadFile(), PMarkdownParser::preLoadFile(), PMultiFileParser::setFileContent(), PMultiFileParser::skipComment(), PConfigParser::skipMonoParam(), and PMultiFileParser::unexpectedToken().

◆ p_run

◆ p_vecEnv

PVecLatexEnv PGenericParser::p_vecEnv
protected

Vector of all the environements.

Definition at line 112 of file PGenericParser.h.

Referenced by copyPGenericParser().

◆ p_vecExtraEnv

◆ p_vecExtraFunction

PMapExtraEnv PGenericParser::p_vecExtraFunction
protected

Vector of extra function.

Definition at line 131 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadDirExtraFunctionFile(), PConfigParser::parseExtraFunction(), and saveCss().

◆ p_vecExtraParser

◆ p_vecFunc

PVecLatexFunc PGenericParser::p_vecFunc
protected

Vector of all the functions.

Definition at line 114 of file PGenericParser.h.

Referenced by copyPGenericParser().

◆ p_vecIncludeDir

std::vector<PString> PGenericParser::p_vecIncludeDir
protected

Vector of the include directories.

Definition at line 117 of file PGenericParser.h.

Referenced by copyPGenericParser(), and getVecIncludeDir().

◆ p_vecNameExtraEnv

std::vector<PString> PGenericParser::p_vecNameExtraEnv
protected

Vector of the name of the extra environement.

Definition at line 120 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadDirExtraEnvironementFile(), and PConfigParser::parseExtraEnvironement().

◆ p_vecNameExtraFunction

std::vector<PString> PGenericParser::p_vecNameExtraFunction
protected

Vector of the name of the extra function.

Definition at line 129 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadDirExtraFunctionFile(), and PConfigParser::parseExtraFunction().

◆ p_vecNameExtraParser

std::vector<PString> PGenericParser::p_vecNameExtraParser
protected

Vector of the name of the extra environement.

Definition at line 134 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadDirExtraParserFile(), and PConfigParser::parseParserLanguage().

◆ p_vecNameFunctionExtraEnv

std::vector<PString> PGenericParser::p_vecNameFunctionExtraEnv
protected

Vector of the name of the extra environement.

Definition at line 122 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadDirExtraEnvironementFile(), and PConfigParser::parseExtraEnvironementFunction().

◆ p_vecNameFunctionExtraParser

std::vector<PString> PGenericParser::p_vecNameFunctionExtraParser
protected

Vector of the function name of the extra environement.

Definition at line 136 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadDirExtraParserFile(), and PConfigParser::parseParserLanguageFunction().

◆ p_vecNameMarkdownExtraEnv

std::vector<PString> PGenericParser::p_vecNameMarkdownExtraEnv
protected

Vector of the name of the extra environement (for markdown)

Definition at line 124 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadDirExtraEnvironementFile(), and PMarkdownParser::parseExtraEnvironement().

◆ p_vecNameMarkdownExtraParser

std::vector<PString> PGenericParser::p_vecNameMarkdownExtraParser
protected

Vector of the markdown name of the extra environement.

Definition at line 138 of file PGenericParser.h.

Referenced by copyPGenericParser(), loadDirExtraParserFile(), and PMarkdownParser::parseExtraParser().

◆ p_vecRemoveLatexKeyword

std::vector<PString> PGenericParser::p_vecRemoveLatexKeyword
protected

Vector of removed latex functions.

Definition at line 141 of file PGenericParser.h.

Referenced by copyPGenericParser(), initialisationPGenericParser(), and PConfigParser::parseAllLatexObj().

◆ p_vecSpeaker

std::vector<PLatexSpeaker> PGenericParser::p_vecSpeaker
protected

Vector of all Speakers in the project.

Definition at line 166 of file PGenericParser.h.

Referenced by PConfigParser::parseAddSpeaker(), PConfigParser::parseSaveSpeaker(), and PConfigParser::parseTimeTable().


The documentation for this class was generated from the following files: