PhoenixLecture  2.0.0
Set of tools to make lectures
PConfigParser Class Reference

Parse the pdata confguration file. More...

#include <PConfigParser.h>

+ Inheritance diagram for PConfigParser:
+ Collaboration diagram for PConfigParser:

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...
 
PConfigParseroperator= (const PConfigParser &other)
 Definition of equal operator of PConfigParser. More...
 
 PConfigParser (const PConfigParser &other)
 Copy constructor of PConfigParser. More...
 
 PConfigParser (const PString &installPrefix="")
 Default constructeur of PConfigParser. 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 ~PConfigParser ()
 Destructeur of PConfigParser. 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 copyPConfigParser (const PConfigParser &other)
 Copy function of PConfigParser. 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 ()
 Parse the input file. More...
 
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 ()
 Initialisation to be done just after loading a file. More...
 
virtual void preLoadFile ()
 Initialisation to be done just before loading a 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 initialisationPConfigParser (const PString &baseInstallPrefix)
 Initialisation function of the class PConfigParser. More...
 
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...
 
bool loadInclude (PLatexObj &parent, PLatexObj &textObj, const PPath &fileName)
 Load a included file. More...
 
bool parseAddSpeaker (PLatexObj &parent, PLatexObj &textObj)
 Parse the addspeakers command. More...
 
bool parseAllLatexObj (PLatexObj &parent, PLatexObj &textObj)
 Parse all the latex obj. More...
 
bool parseBookMainPageLink (PLatexObj &parent, PLatexObj &textObj)
 Parse the book main page link. More...
 
bool parseComment (PLatexObj &parent, PLatexObj &textObj)
 Parse a comment. More...
 
bool parseComplexMonoParam (PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
 Parse all the functions which have complex mono parameter in braces {...}. More...
 
bool parseDebug (PLatexObj &parent, PLatexObj &textObj)
 Parse the debug function. More...
 
bool parseDots (PLatexObj &parent, PLatexObj &textObj)
 Parse a space paragraphe. More...
 
bool parseDoubleInlineMath (PLatexObj &parent, PLatexObj &textObj)
 Parse an inline math formula. More...
 
bool parseEnvironement (PLatexObj &parent, PLatexObj &textObj, const PString &environementName, PLatexType::PLatexType type)
 Parse latex environement. More...
 
bool parseEnvironementContent (PLatexObj &parent, PLatexObj &textObj, const PString &environementName, PLatexType::PLatexType type, bool isAllowComment, bool isAllowMath, const PString &envBalise)
 Parse latex environement. More...
 
bool parseEnvStringOnly (PLatexObj &parent, PLatexObj &textObj, const PString &environementName, PLatexType::PLatexType type)
 Parse an environement which contains only a string. More...
 
bool parseExtraEnvironement (PLatexObj &parent, PLatexObj &textObj)
 Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...) More...
 
bool parseExtraEnvironementContent (PLatexObj &parent, PLatexObj &textObj, const PString &environementName, PLatexType::PLatexType type)
 Parse latex environement. More...
 
bool parseExtraEnvironementFunction (PLatexObj &parent, PLatexObj &textObj)
 Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...) More...
 
bool parseExtraFunction (PLatexObj &parent, PLatexObj &textObj)
 Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...) More...
 
bool parseHref (PLatexObj &parent, PLatexObj &textObj)
 Parse latex Href. More...
 
bool parseIncludeFile (PLatexObj &parent, PLatexObj &textObj)
 Parse a file inclusion. More...
 
bool parseIncludeGraphic (PLatexObj &parent, PLatexObj &textObj)
 Parse the includegraphic command. More...
 
bool parseInlineMath (PLatexObj &parent, PLatexObj &textObj)
 Parse an inline math formula. More...
 
bool parseInputFile (PLatexObj &parent, PLatexObj &textObj)
 Parse a file inclusion. More...
 
bool parseItem (PLatexObj &parent, PLatexObj &textObj)
 Parse an item. More...
 
bool parseNewLine (PLatexObj &parent, PLatexObj &textObj)
 Parse a new line. More...
 
bool parseParserLanguage (PLatexObj &parent, PLatexObj &textObj)
 Parse language parser (cplusplus, cmake, glsl, cuda, ...) More...
 
bool parseParserLanguageFunction (PLatexObj &parent, PLatexObj &textObj)
 Parse a language parser with a function which get an input file. More...
 
bool parsePercent (PLatexObj &parent, PLatexObj &textObj)
 Parse latex percent. More...
 
bool parserCallDot (PLatexObj &parent, PLatexObj &textObj)
 Parse a call to dot. More...
 
bool parserDetails (PLatexObj &parent, PLatexObj &textObj)
 Parse a detail environement. More...
 
bool parseRealNewLine (PLatexObj &parent, PLatexObj &textObj)
 Parse a new line. More...
 
bool parserQuote (PLatexObj &parent, PLatexObj &textObj)
 Parse a quote environnement. More...
 
bool parserSvgToPng (PLatexObj &parent, PLatexObj &textObj)
 Parse a svg to png function. More...
 
bool parseSaveSpeaker (PLatexObj &parent, PLatexObj &textObj)
 Parse the savespeakers command. More...
 
bool parseSectionTitle (PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
 Parse all the functions which have complex mono parameter in braces {...}. More...
 
bool parseSpaceParagraphe (PLatexObj &parent, PLatexObj &textObj)
 Parse a space paragraphe. More...
 
bool parseStringAndGoBack (const PString &str)
 Parse a string an go back if the string exists. More...
 
bool parseTabular (PLatexObj &parent, PLatexObj &textObj)
 Parse a tabular environement. More...
 
bool parseTimeTable (PLatexObj &parent, PLatexObj &textObj)
 Parse the timetable command. More...
 
void parseVecLatexObj (PLatexObj &parent, PLatexObj &textObj, const PString &beginPatern, const PString &endPatern)
 Parse a vector of latex object. More...
 
bool parseVideo (PLatexObj &parent, PLatexObj &textObj)
 Parse a file inclusion. More...
 
bool skipMonoParam (const PString &functionName)
 Skip a mon parameter. More...
 

Private Attributes

bool p_isAllowComment
 True to allow comments. More...
 
bool p_isAllowMath
 True to allow math. More...
 
PListMultiCommentConfig p_listCommentConfig
 Defines the differents comments we allow in the parsing. More...
 

Detailed Description

Parse the pdata confguration file.

Definition at line 13 of file PConfigParser.h.

Constructor & Destructor Documentation

◆ PConfigParser() [1/2]

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

Default constructeur of PConfigParser.

Parameters
installPrefix: installation prefix

Definition at line 24 of file PConfigParser.cpp.

25  :PGenericParser(installPrefix)
26 {
27  initialisationPConfigParser(installPrefix);
28 }
void initialisationPConfigParser(const PString &baseInstallPrefix)
Initialisation function of the class PConfigParser.
PGenericParser(const PString &installPrefix="")
Default constructor of PGenericParser.

References initialisationPConfigParser().

+ Here is the call graph for this function:

◆ PConfigParser() [2/2]

PConfigParser::PConfigParser ( const PConfigParser other)

Copy constructor of PConfigParser.

Parameters
other: class to copy

Definition at line 33 of file PConfigParser.cpp.

34  :PGenericParser(other)
35 {
36  copyPConfigParser(other);
37 }
void copyPConfigParser(const PConfigParser &other)
Copy function of PConfigParser.

References copyPConfigParser().

+ Here is the call graph for this function:

◆ ~PConfigParser()

PConfigParser::~PConfigParser ( )
virtual

Destructeur of PConfigParser.

Definition at line 40 of file PConfigParser.cpp.

40  {
41  saveMapFile();
42 }
void saveMapFile()
Save the map of copied files.

References PGenericParser::saveMapFile().

+ Here is the call graph for this function:

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 
)
protectedinherited

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(), loadInclude(), parseComment(), PMarkdownParser::parseComment(), parseComplexMonoParam(), PMarkdownParser::parseComplexMonoParam(), parseDebug(), parseDots(), parseDoubleInlineMath(), PMarkdownParser::parseEnumerate(), PMarkdownParser::parseEnvDecoration(), parseEnvironementContent(), parseEnvStringOnly(), PMarkdownParser::parseExtraEnvironement(), parseExtraEnvironementFunction(), parseExtraFunction(), PMarkdownParser::parseExtraParser(), parseHref(), PMarkdownParser::parseHref(), parseIncludeGraphic(), PMarkdownParser::parseIncludeGraphic(), parseInlineMath(), parseItem(), PMarkdownParser::parseItemize(), PGenericParser::parseMonoParam(), parseNewLine(), PMarkdownParser::parseNewLine(), parseParserLanguage(), parseParserLanguageFunction(), parsePercent(), PMarkdownParser::parsePercent(), parserCallDot(), parserDetails(), parseRealNewLine(), PGenericParser::parserGetEnv(), parserQuote(), parserSvgToPng(), parseSectionTitle(), PMarkdownParser::parseSectionTitle(), parseSpaceParagraphe(), parseTabular(), PMarkdownParser::parseTextDecoration(), PMarkdownParser::parseUrl(), 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)
protectedinherited

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 PGenericParser::playTextLatexObj(), 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 
)
protectedinherited

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(), PGenericParser::getAbsoluteFileName(), PPath::getFileModificationTime(), PPath::getFileName(), PPath::getParentDirectory(), PPath::isFileExist(), PGenericParser::p_mapCopiedFile, PString::replace(), and PMultiFileParser::stopParsing().

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

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

◆ copyPConfigParser()

void PConfigParser::copyPConfigParser ( const PConfigParser other)
protected

Copy function of PConfigParser.

Parameters
other: class to copy

Definition at line 56 of file PConfigParser.cpp.

56  {
59 }
bool p_isAllowComment
True to allow comments.
Definition: PConfigParser.h:85
bool p_isAllowMath
True to allow math.
Definition: PConfigParser.h:87

References p_isAllowComment, and p_isAllowMath.

Referenced by operator=(), and PConfigParser().

+ Here is the caller graph for this function:

◆ copyPGenericParser()

void PGenericParser::copyPGenericParser ( const PGenericParser other)
protectedinherited

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 PGenericParser::p_bookGitlabUrl, PGenericParser::p_bookMail, PGenericParser::p_bookMainPageLink, PGenericParser::p_bookMasterProjectUrl, PGenericParser::p_bookSideBarWidth, PGenericParser::p_cssContent, PGenericParser::p_isDebugMode, PGenericParser::p_isEnableBookFeedback, PGenericParser::p_mapBiblioEntry, PGenericParser::p_mapCopiedFile, PGenericParser::p_vecEnv, PGenericParser::p_vecExtraEnv, PGenericParser::p_vecExtraFunction, PGenericParser::p_vecExtraParser, PGenericParser::p_vecFunc, PGenericParser::p_vecIncludeDir, PGenericParser::p_vecNameExtraEnv, PGenericParser::p_vecNameExtraFunction, PGenericParser::p_vecNameExtraParser, PGenericParser::p_vecNameFunctionExtraEnv, PGenericParser::p_vecNameFunctionExtraParser, PGenericParser::p_vecNameMarkdownExtraEnv, PGenericParser::p_vecNameMarkdownExtraParser, and PGenericParser::p_vecRemoveLatexKeyword.

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

+ Here is the caller graph for this function:

◆ errorAt()

void PMultiFileParser::errorAt ( )
inherited

Write a parsing error.

Definition at line 126 of file PMultiFileParser.cpp.

126  {
127  std::cerr << "\033[31mError at " << p_parser->getLocation() << " :\033[0m" << std::endl;
128 }
PLocation getLocation() const
Fonction qui renvoie la PLocation du PFileParser.

References PFileParser::getLocation(), and PMultiFileParser::p_parser.

Referenced by PMultiFileParser::checkExpectedMatch(), PMultiFileParser::checkExpectedToken(), PGenericParser::copyFile(), PMarkdownParser::getProperParent(), PGenericParser::getStringBetweenBraces(), loadInclude(), parseAddSpeaker(), parseExtraEnvironement(), parseHref(), PMarkdownParser::parseHref(), parseIncludeGraphic(), PMarkdownParser::parseIncludeGraphic(), parseTimeTable(), parseVideo(), and PMultiFileParser::unexpectedToken().

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

◆ executeLatexCommand()

PString PGenericParser::executeLatexCommand ( const PString inputStr)
protectedinherited

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(), PGenericParser::getSource(), platexobj_text(), and PMultiFileParser::setFileContent().

Referenced by PGenericParser::parseBookEnableFeedback(), PGenericParser::parseBookGitlabUrl(), PGenericParser::parseBookMail(), PGenericParser::parseBookMasterProject(), PGenericParser::parseBookSizeBarWidth(), PGenericParser::parseMainAuthor(), PGenericParser::parseMainDate(), PGenericParser::parseMainSubTitle(), and PGenericParser::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(), PGenericParser::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)
protectedinherited

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 PGenericParser::copyFile(), and parseVideo().

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

◆ getBookEnableFeedback()

bool PGenericParser::getBookEnableFeedback ( ) const
inherited

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 PGenericParser::p_isEnableBookFeedback.

◆ getBookGitlabUrl()

const PString & PGenericParser::getBookGitlabUrl ( ) const
inherited

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 PGenericParser::p_bookGitlabUrl.

◆ getBookMail()

const PString & PGenericParser::getBookMail ( ) const
inherited

Get the book mail list.

Returns
book mail list

Definition at line 146 of file PGenericParser.cpp.

146  {
147  return p_bookMail;
148 }

References PGenericParser::p_bookMail.

◆ getBookMainPageLink()

const PLatexObj & PGenericParser::getBookMainPageLink ( ) const
inherited

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 PGenericParser::p_bookMainPageLink.

◆ getBookMasterProjectUrl()

const PString & PGenericParser::getBookMasterProjectUrl ( ) const
inherited

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 PGenericParser::p_bookMasterProjectUrl.

◆ getBookSideBarWidth()

const PString & PGenericParser::getBookSideBarWidth ( ) const
inherited

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 PGenericParser::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 ( )
inherited

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 PGenericParser::p_mapBiblioEntry.

◆ getMapBiblioEntry() [2/2]

const PMapBiblioEntry & PGenericParser::getMapBiblioEntry ( ) const
inherited

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 PGenericParser::p_mapBiblioEntry.

◆ getOptionStringBetweenBraces()

PString PGenericParser::getOptionStringBetweenBraces ( )
protectedinherited

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 parseAddSpeaker(), parseDots(), parseSaveSpeaker(), parseSpaceParagraphe(), parseTabular(), parseTimeTable(), and skipMonoParam().

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

◆ getOptionStringBetweenHook()

PString PGenericParser::getOptionStringBetweenHook ( )
protectedinherited

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 parseComplexMonoParam(), PMarkdownParser::parseComplexMonoParam(), PGenericParser::parseMonoParam(), parseSectionTitle(), and skipMonoParam().

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

◆ getSource() [1/2]

PLatexObj & PGenericParser::getSource ( )
inherited

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 PGenericParser::p_currentSource.

◆ getSource() [2/2]

const PLatexObj & PGenericParser::getSource ( ) const
inherited

Get the current source.

Returns
current source

Definition at line 87 of file PGenericParser.cpp.

87  {
88  return p_currentSource;
89 }

References PGenericParser::p_currentSource.

Referenced by PGenericParser::executeLatexCommand(), 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)
protectedinherited

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 PGenericParser::parseBookEnableFeedback(), PGenericParser::parseBookGitlabUrl(), PGenericParser::parseBookMail(), PGenericParser::parseBookMasterProject(), PGenericParser::parseBookSizeBarWidth(), parseDebug(), parseEnvStringOnly(), parseHref(), parseIncludeFile(), parseInputFile(), PGenericParser::parseLabel(), PGenericParser::parseMainAuthor(), PGenericParser::parseMainDate(), PGenericParser::parseMainSubTitle(), PGenericParser::parseMainTitle(), PGenericParser::parseMonoParam(), and PGenericParser::parserGetEnv().

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

◆ getVecIncludeDir() [1/2]

PVecString & PGenericParser::getVecIncludeDir ( )
inherited

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 PGenericParser::p_vecIncludeDir.

◆ getVecIncludeDir() [2/2]

const PVecString & PGenericParser::getVecIncludeDir ( ) const
inherited

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 PGenericParser::p_vecIncludeDir.

◆ incrementCurrentChar()

void PGenericParser::incrementCurrentChar ( PLatexObj textObj)
protectedinherited

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 loadInclude(), PMarkdownParser::parseEnumerateItem(), parseEnvironementContent(), PMarkdownParser::parseExtraEnvironement(), parseFile(), PMarkdownParser::parseFile(), parseItem(), PMarkdownParser::parseItem(), parserDetails(), parserQuote(), parseTabular(), parseVecLatexObj(), PMarkdownParser::parseVecLatexObj(), and PMarkdownParser::parseWip().

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

◆ initialisationPConfigParser()

void PConfigParser::initialisationPConfigParser ( const PString baseInstallPrefix)
private

Initialisation function of the class PConfigParser.

Parameters
baseInstallPrefix: installation prefix

Definition at line 101 of file PConfigParser.cpp.

101  {
102  p_isAllowMath = true;
103  p_isAllowComment = true;
104 }

References p_isAllowComment, and p_isAllowMath.

Referenced by PConfigParser().

+ Here is the caller graph for this function:

◆ initialisationPGenericParser()

void PGenericParser::initialisationPGenericParser ( const PString baseInstallPrefix)
privateinherited

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, PGenericParser::loadCss(), PGenericParser::loadDirExtraEnvironement(), PGenericParser::loadDirExtraFunction(), PGenericParser::loadDirExtraParser(), PGenericParser::loadMapFile(), PLatexType::NONE, PGenericParser::p_bookMainPageLink, PGenericParser::p_bookSideBarWidth, PGenericParser::p_currentSource, PGenericParser::p_currentText, PGenericParser::p_isDebugMode, PGenericParser::p_isEnableBookFeedback, PGenericParser::p_vecRemoveLatexKeyword, PLatexObj::setType(), and PLatexType::TEXT.

Referenced by PGenericParser::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 PGenericParser::getOptionStringBetweenBraces(), PGenericParser::getStringBetweenBraces(), ConfigParser::parseDocString(), parseDots(), ConfigParser::parseFile(), and 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 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 loadInclude().

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

◆ loadCss()

void PGenericParser::loadCss ( const PPath inputDir)
protectedinherited

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 PGenericParser::p_cssContent.

Referenced by PGenericParser::initialisationPGenericParser().

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

◆ loadDirExtraEnvironement()

void PGenericParser::loadDirExtraEnvironement ( const PPath inputDir)
protectedinherited

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 PGenericParser::loadDirExtraEnvironementFile().

Referenced by PGenericParser::initialisationPGenericParser().

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

◆ loadDirExtraEnvironementFile()

void PGenericParser::loadDirExtraEnvironementFile ( const PPath inputFile)
protectedinherited

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(), PGenericParser::p_vecExtraEnv, PGenericParser::p_vecNameExtraEnv, PGenericParser::p_vecNameFunctionExtraEnv, PGenericParser::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 PGenericParser::loadDirExtraEnvironement().

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

◆ loadDirExtraFunction()

void PGenericParser::loadDirExtraFunction ( const PPath inputDir)
protectedinherited

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 PGenericParser::loadDirExtraFunctionFile().

Referenced by PGenericParser::initialisationPGenericParser().

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

◆ loadDirExtraFunctionFile()

void PGenericParser::loadDirExtraFunctionFile ( const PPath inputFile)
protectedinherited

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(), PGenericParser::p_vecExtraFunction, PGenericParser::p_vecNameExtraFunction, pxml_getAttrIfExist(), pxml_getChildIfExist(), pxml_getFullContent(), pxml_getVecChildIfExist(), pxml_parserFile(), PEnvironement::setBalise(), PEnvironement::setCss(), and PEnvironement::setName().

Referenced by PGenericParser::loadDirExtraFunction().

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

◆ loadDirExtraParser()

void PGenericParser::loadDirExtraParser ( const PPath inputDir)
protectedinherited

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 PGenericParser::loadDirExtraParserFile().

Referenced by PGenericParser::initialisationPGenericParser().

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

◆ loadDirExtraParserFile()

void PGenericParser::loadDirExtraParserFile ( const PPath inputFile)
protectedinherited

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(), PGenericParser::p_vecExtraParser, PGenericParser::p_vecNameExtraParser, PGenericParser::p_vecNameFunctionExtraParser, PGenericParser::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 PGenericParser::loadDirExtraParser().

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

◆ loadInclude()

bool PConfigParser::loadInclude ( PLatexObj parent,
PLatexObj textObj,
const PPath fileName 
)
private

Load a included file.

Parameters
[out]parent: parent PLatexObj
[out]textObj: saved text
fileName: name of the file to be loaded
Returns
true on success, false otherwise

Definition at line 112 of file PConfigParser.cpp.

112  {
113  if(fileName == "") return false;
114  PPath fileToBeUsed(fileName);
115  bool removeTmpFilename(false);
116  if(fileName.isSameBegining("http")){
117  if(!wgetFile(fileName)){
118  errorAt();
119  std::cerr << "PConfigParser::loadInclude : cannot get file with url = '"<<fileName<<"'" << std::endl;
120  return true;
121  }
122  fileToBeUsed = fileName.getFileName();
123  removeTmpFilename = true;
124  }
125 
126  PString fileExtension(fileToBeUsed.getExtension());
127  if(fileExtension == "md"){
128  PMarkdownParser mdParser(*this);
129 
130  bool b = mdParser.load(fileToBeUsed);
131  if(!b){return b;}
132  PLatexObj & mainLatexObj = mdParser.getSource();
133  std::vector<PLatexObj> & vecObj = mainLatexObj.getVecContent();
134  for(std::vector<PLatexObj>::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
135  addLatexObj(parent, *it);
136  }
137  copyPGenericParser(mdParser);
138  return b;
139  }
140 
141  PFileParser parser;
142  p_listFileParser.push_back(parser);
144  p_parser = &p_listFileParser.back();
145  if(!p_parser->open(fileToBeUsed)){
146  std::cerr << "PMultiFileParser::load : can't open file '" << fileToBeUsed << "'" << std::endl;
147  return false;
148  }
149  p_parser->setWhiteSpace("");
150  p_parser->setSeparator("");
151  while(!p_parser->isEndOfFile() && p_run){
152  long unsigned int currentPos = p_parser->getCurrentCharIdx();
153  if(parseAllLatexObj(parent, textObj)){}
154  else{
155  incrementCurrentChar(textObj);
156  }
157 
158  if(currentPos == p_parser->getCurrentCharIdx() && !p_parser->isEndOfFile()){
159  std::cerr << "PMultiFileParser::load : the parser is stucked at the position :" << std::endl << "\t" << p_parser->getLocation() << std::endl;
160  p_run = false;
161  }
162  }
163  if(p_run) playTextLatexObj(parent, textObj);
164  p_listFileParser.pop_back();
165  if(p_listFileParser.size() > 0lu) p_parser = &p_listFileParser.back();
166  else p_parser = NULL;
167  if(removeTmpFilename){
168  remove(fileToBeUsed.c_str());
169  }
170  return p_run;
171 }
bool wgetFile(const PString &url)
Do a wget of a file.
bool parseAllLatexObj(PLatexObj &parent, PLatexObj &textObj)
Parse all the latex obj.
void setSeparator(const PString &separator)
Initialise la liste des caractères séparateurs.
Definition: PFileParser.cpp:43
void setWhiteSpace(const PString &whiteSpace)
Initialise la liste des caractères blancs.
Definition: PFileParser.cpp:35
void copyPGenericParser(const PGenericParser &other)
Copy function of PGenericParser.
void incrementCurrentChar(PLatexObj &textObj)
Increment current char position.
bool playTextLatexObj(PLatexObj &parent, PLatexObj &textObj, bool isRemoveFirstLastSpace=false)
Play the text latex obj.
void addLatexObj(PLatexObj &parent, const PLatexObj &obj)
Add latex obj in parent.
Describe a latex object.
Definition: PLatexObj.h:40
Class which parses Markdown as into for web site generator.
bool isSameBegining(const PString &beginStr) const
Say if the current PString has the same begining of beginStr.
Definition: PString.cpp:306

References PGenericParser::addLatexObj(), PGenericParser::copyPGenericParser(), PMultiFileParser::errorAt(), PFileParser::getCurrentCharIdx(), PPath::getExtension(), PPath::getFileName(), PFileParser::getLocation(), PGenericParser::getSource(), PLatexObj::getVecContent(), PGenericParser::incrementCurrentChar(), PFileParser::isEndOfFile(), PString::isSameBegining(), PMultiFileParser::load(), MULTI_PARSER_SEPARATORS_STRING, PFileParser::open(), PMultiFileParser::p_listFileParser, PMultiFileParser::p_parser, PMultiFileParser::p_run, parseAllLatexObj(), PGenericParser::playTextLatexObj(), PFileParser::setSeparator(), PFileParser::setWhiteSpace(), and wgetFile().

Referenced by parseIncludeFile(), and parseInputFile().

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

◆ loadMapFile()

void PGenericParser::loadMapFile ( )
protectedinherited

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 PGenericParser::p_mapCopiedFile.

Referenced by PGenericParser::initialisationPGenericParser().

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

◆ operator=()

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

Definition of equal operator of PConfigParser.

Parameters
other: class to copy
Returns
copied class

Definition at line 48 of file PConfigParser.cpp.

48  {
49  copyPConfigParser(other);
50  return *this;
51 }

References copyPConfigParser().

+ Here is the call graph for this function:

◆ parseAddSpeaker()

bool PConfigParser::parseAddSpeaker ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse the addspeakers command.

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

Definition at line 752 of file PConfigParser.cpp.

752  {
753  if(!p_parser->isMatchToken("\\addspeakers")){return false;}
754  playTextLatexObj(parent, textObj);
755  PPath speakerConfig = getOptionStringBetweenBraces();
756  PPath speakerFile = p_parser->getFileName().getParentDirectory() / speakerConfig;
757 
758  if(!ptimetable_loadSpeaker(p_vecSpeaker, speakerFile)){
759  errorAt();
760  std::cerr << "PConfigParser::parseTimeTable : cannot parse speakers configuration '"+speakerFile+"'" << std::endl;
761  stopParsing();
762  return true;
763  }
764 
765  return true;
766 }
std::vector< PLatexSpeaker > p_vecSpeaker
Vector of all Speakers in the project.
PString getOptionStringBetweenBraces()
Get optional string between braces {...}.
bool ptimetable_loadSpeaker(std::vector< PLatexSpeaker > &vecOutputSpeaker, const DicoValue &dico)
Load the speakers of the PTimeTable.

References PMultiFileParser::errorAt(), PFileParser::getFileName(), PGenericParser::getOptionStringBetweenBraces(), PPath::getParentDirectory(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::p_vecSpeaker, PGenericParser::playTextLatexObj(), ptimetable_loadSpeaker(), and PMultiFileParser::stopParsing().

Referenced by parseAllLatexObj().

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

◆ parseAllLatexObj()

bool PConfigParser::parseAllLatexObj ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse all the latex obj.

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

Definition at line 200 of file PConfigParser.cpp.

200  {
201  if(p_parser->isMatch("{")){}
202  else if(p_parser->isMatch("}")){}
203  else if(skipMonoParam("\\minitoc")){}
204  else if(skipMonoParam("\\newpage")){}
205  else if(skipMonoParam("\\centering")){}
206  else if(skipMonoParam("\\def\\sgn")){}
207  else if(skipMonoParam("\\,")){}
208  else if(parsePercent(parent, textObj)){}
209  else if(p_parser->isMatch(p_vecRemoveLatexKeyword) != ""){}
210  else if(parseSpaceParagraphe(parent, textObj)){}
211  else if(parseNewLine(parent, textObj)){}
212  else if(parseRealNewLine(parent, textObj)){}
213  else if(parseDots(parent, textObj)){}
214 
215  else if(parseMonoParam(parent, textObj, "\\url", PLatexType::URL)){}
216  else if(parseGenericLatexObj(parent, textObj)){}
217  else if(parseComplexMonoParam(parent, textObj, "\\footnote", PLatexType::FOOTNOTE)){}
218  else if(parseComplexMonoParam(parent, textObj, "\\caption", PLatexType::CAPTION)){}
219 
220  else if(parseComplexMonoParam(parent, textObj, "\\wip", PLatexType::WORK_IN_PROGRESS)){}
221  else if(parseComplexMonoParam(parent, textObj, "\\workinprogress", PLatexType::WORK_IN_PROGRESS)){}
222  else if(parserDetails(parent, textObj)){}
223  else if(parserQuote(parent, textObj)){}
224  else if(parseComment(parent, textObj)){}
225  else if(parseDebug(parent, textObj)){}
226  else if(parseHref(parent, textObj)){}
227  else if(parseIncludeGraphic(parent, textObj)){}
228  else if(parseAddSpeaker(parent, textObj)){}
229  else if(parseSaveSpeaker(parent, textObj)){}
230  else if(parseTimeTable(parent, textObj)){}
231 
232  else if(parseSectionTitle(parent, textObj, "\\part*", PLatexType::PARTSTAR)){}
233  else if(parseSectionTitle(parent, textObj, "\\chapter*", PLatexType::CHAPTERSTAR)){}
234  else if(parseSectionTitle(parent, textObj, "\\section*", PLatexType::SECTIONSTAR)){}
235  else if(parseSectionTitle(parent, textObj, "\\subsection*", PLatexType::SUBSECTIONSTAR)){}
236  else if(parseSectionTitle(parent, textObj, "\\subsubsection*", PLatexType::SUBSUBSECTIONSTAR)){}
237 
238  else if(parseSectionTitle(parent, textObj, "\\part", PLatexType::PART)){}
239  else if(parseSectionTitle(parent, textObj, "\\chapter", PLatexType::CHAPTER)){}
240  else if(parseSectionTitle(parent, textObj, "\\section", PLatexType::SECTION)){}
241  else if(parseSectionTitle(parent, textObj, "\\subsection", PLatexType::SUBSECTION)){}
242  else if(parseSectionTitle(parent, textObj, "\\subsubsection", PLatexType::SUBSUBSECTION)){}
243 
244  else if(parseSectionTitle(parent, textObj, "\\bookpartseparator", PLatexType::BOOKPARTSEPARATOR)){}
245 
246  else if(parseEnvStringOnly(parent, textObj, "displaymath", PLatexType::DISPLAYMATH)){}
247  else if(parseEnvStringOnly(parent, textObj, "equation", PLatexType::DISPLAYMATH)){}
248  else if(parseEnvStringOnly(parent, textObj, "equation*", PLatexType::DISPLAYMATH)){}
249  else if(parseEnvStringOnly(parent, textObj, "eqnarray", PLatexType::EQNARRAY)){}
250  else if(parseEnvStringOnly(parent, textObj, "align*", PLatexType::EQNARRAY)){}
251  else if(parseDoubleInlineMath(parent, textObj)){}
252  else if(parseInlineMath(parent, textObj)){}
253 
254  else if(parseEnvironement(parent, textObj, "paragraph", PLatexType::PARAGRAPHE)){}
255  else if(parseEnvironement(parent, textObj, "center", PLatexType::CENTER)){}
256  else if(parseEnvironement(parent, textObj, "columns", PLatexType::COLUMNS)){}
257  else if(parseEnvironement(parent, textObj, "column", PLatexType::COLUMN)){}
258 
259  else if(parseEnvironement(parent, textObj, "figure", PLatexType::FIGURE)){}
260  else if(parseEnvironement(parent, textObj, "wrapfigure", PLatexType::FIGURE)){}
261  else if(parseEnvironement(parent, textObj, "table", PLatexType::TABLE)){}
262  else if(parseTabular(parent, textObj)){}
263  else if(parseEnvironement(parent, textObj, "itemize", PLatexType::ITEMIZE)){}
264  else if(parseEnvironement(parent, textObj, "enumerate", PLatexType::ENUMERATE)){}
265  else if(parseItem(parent, textObj)){}
266 
267  else if(parserCallDot(parent, textObj)){}
268  else if(parserSvgToPng(parent, textObj)){}
269 
270  else if(parseExtraEnvironement(parent, textObj)){}
271  else if(parseExtraEnvironementFunction(parent, textObj)){}
272  else if(parseExtraFunction(parent, textObj)){}
273  else if(parseParserLanguage(parent, textObj)){}
274  else if(parseParserLanguageFunction(parent, textObj)){}
275 
276  else if(parseIncludeFile(parent, textObj)){}
277  else if(parseInputFile(parent, textObj)){} //An other non sens of latex
278  else if(parseVideo(parent, textObj)){}
279  else if(parseBookMainPageLink(parent, textObj)){}
280  else{
281  return false;
282  }
283  return true;
284 }
bool parseIncludeFile(PLatexObj &parent, PLatexObj &textObj)
Parse a file inclusion.
bool parseSpaceParagraphe(PLatexObj &parent, PLatexObj &textObj)
Parse a space paragraphe.
bool parsePercent(PLatexObj &parent, PLatexObj &textObj)
Parse latex percent.
bool parseParserLanguageFunction(PLatexObj &parent, PLatexObj &textObj)
Parse a language parser with a function which get an input file.
bool parseVideo(PLatexObj &parent, PLatexObj &textObj)
Parse a file inclusion.
bool parseComplexMonoParam(PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
Parse all the functions which have complex mono parameter in braces {...}.
bool parseHref(PLatexObj &parent, PLatexObj &textObj)
Parse latex Href.
bool parserDetails(PLatexObj &parent, PLatexObj &textObj)
Parse a detail environement.
bool parseExtraEnvironementFunction(PLatexObj &parent, PLatexObj &textObj)
Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...)
bool parseInlineMath(PLatexObj &parent, PLatexObj &textObj)
Parse an inline math formula.
bool parseDots(PLatexObj &parent, PLatexObj &textObj)
Parse a space paragraphe.
bool parseTimeTable(PLatexObj &parent, PLatexObj &textObj)
Parse the timetable command.
bool parserCallDot(PLatexObj &parent, PLatexObj &textObj)
Parse a call to dot.
bool parserSvgToPng(PLatexObj &parent, PLatexObj &textObj)
Parse a svg to png function.
bool parseNewLine(PLatexObj &parent, PLatexObj &textObj)
Parse a new line.
bool parseEnvironement(PLatexObj &parent, PLatexObj &textObj, const PString &environementName, PLatexType::PLatexType type)
Parse latex environement.
bool parseDoubleInlineMath(PLatexObj &parent, PLatexObj &textObj)
Parse an inline math formula.
bool parserQuote(PLatexObj &parent, PLatexObj &textObj)
Parse a quote environnement.
bool parseComment(PLatexObj &parent, PLatexObj &textObj)
Parse a comment.
bool parseInputFile(PLatexObj &parent, PLatexObj &textObj)
Parse a file inclusion.
bool parseEnvStringOnly(PLatexObj &parent, PLatexObj &textObj, const PString &environementName, PLatexType::PLatexType type)
Parse an environement which contains only a string.
bool parseDebug(PLatexObj &parent, PLatexObj &textObj)
Parse the debug function.
bool parseRealNewLine(PLatexObj &parent, PLatexObj &textObj)
Parse a new line.
bool parseSectionTitle(PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
Parse all the functions which have complex mono parameter in braces {...}.
bool parseSaveSpeaker(PLatexObj &parent, PLatexObj &textObj)
Parse the savespeakers command.
bool parseTabular(PLatexObj &parent, PLatexObj &textObj)
Parse a tabular environement.
bool parseIncludeGraphic(PLatexObj &parent, PLatexObj &textObj)
Parse the includegraphic command.
bool parseParserLanguage(PLatexObj &parent, PLatexObj &textObj)
Parse language parser (cplusplus, cmake, glsl, cuda, ...)
bool parseAddSpeaker(PLatexObj &parent, PLatexObj &textObj)
Parse the addspeakers command.
bool parseBookMainPageLink(PLatexObj &parent, PLatexObj &textObj)
Parse the book main page link.
bool skipMonoParam(const PString &functionName)
Skip a mon parameter.
bool parseExtraEnvironement(PLatexObj &parent, PLatexObj &textObj)
Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...)
bool parseExtraFunction(PLatexObj &parent, PLatexObj &textObj)
Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...)
bool parseItem(PLatexObj &parent, PLatexObj &textObj)
Parse an item.
bool parseMonoParam(PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
Parse all the functions which have mono parameter in braces {...}.
bool parseGenericLatexObj(PLatexObj &parent, PLatexObj &textObj)
Parse the generic latex function which have to be used in the latex parser and the markdown parser to...
@ SUBSUBSECTION
Definition: PLatexType.h:54
@ SUBSECTIONSTAR
Definition: PLatexType.h:60
@ SUBSUBSECTIONSTAR
Definition: PLatexType.h:61
@ BOOKPARTSEPARATOR
Definition: PLatexType.h:64
@ WORK_IN_PROGRESS
Definition: PLatexType.h:32

References PLatexType::BOOKPARTSEPARATOR, PLatexType::CAPTION, PLatexType::CENTER, PLatexType::CHAPTER, PLatexType::CHAPTERSTAR, PLatexType::COLUMN, PLatexType::COLUMNS, PLatexType::DISPLAYMATH, PLatexType::ENUMERATE, PLatexType::EQNARRAY, PLatexType::FIGURE, PLatexType::FOOTNOTE, PFileParser::isMatch(), PLatexType::ITEMIZE, PMultiFileParser::p_parser, PGenericParser::p_vecRemoveLatexKeyword, PLatexType::PARAGRAPHE, parseAddSpeaker(), parseBookMainPageLink(), parseComment(), parseComplexMonoParam(), parseDebug(), parseDots(), parseDoubleInlineMath(), parseEnvironement(), parseEnvStringOnly(), parseExtraEnvironement(), parseExtraEnvironementFunction(), parseExtraFunction(), PGenericParser::parseGenericLatexObj(), parseHref(), parseIncludeFile(), parseIncludeGraphic(), parseInlineMath(), parseInputFile(), parseItem(), PGenericParser::parseMonoParam(), parseNewLine(), parseParserLanguage(), parseParserLanguageFunction(), parsePercent(), parserCallDot(), parserDetails(), parseRealNewLine(), parserQuote(), parserSvgToPng(), parseSaveSpeaker(), parseSectionTitle(), parseSpaceParagraphe(), parseTabular(), parseTimeTable(), parseVideo(), PLatexType::PART, PLatexType::PARTSTAR, PLatexType::SECTION, PLatexType::SECTIONSTAR, skipMonoParam(), PLatexType::SUBSECTION, PLatexType::SUBSECTIONSTAR, PLatexType::SUBSUBSECTION, PLatexType::SUBSUBSECTIONSTAR, PLatexType::TABLE, PLatexType::URL, and PLatexType::WORK_IN_PROGRESS.

Referenced by loadInclude(), parseEnvironementContent(), parseFile(), parseItem(), parserDetails(), parserQuote(), parseTabular(), and parseVecLatexObj().

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

◆ parseBookEnableFeedback()

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

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 }
PString executeLatexCommand(const PString &inputStr)
Execute the given latex command.
PString getStringBetweenBraces(const PString &previousToken)
Get the string between the braces {...}.

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

Referenced by PGenericParser::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 
)
protectedinherited

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(), PGenericParser::executeLatexCommand(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PGenericParser::p_bookGitlabUrl, PMultiFileParser::p_parser, and PGenericParser::playTextLatexObj().

Referenced by PGenericParser::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 
)
protectedinherited

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 PGenericParser::executeLatexCommand(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PGenericParser::p_bookMail, PMultiFileParser::p_parser, and PGenericParser::playTextLatexObj().

Referenced by PGenericParser::parseGenericLatexObj().

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

◆ parseBookMainPageLink()

bool PConfigParser::parseBookMainPageLink ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse the book main page link.

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

Definition at line 291 of file PConfigParser.cpp.

291  {
292  PLatexObj tmpParent;
293  if(parseComplexMonoParam(tmpParent, textObj, "\\bookMainPageLink", PLatexType::BOOKMAINPAGELINK)){
294  if(tmpParent.getVecContent().size() != 0lu){
295  p_bookMainPageLink = tmpParent.getVecContent().back();
296  std::cout << "PConfigParser::parseBookMainPageLink : Update main page link (nb element = "<<tmpParent.getVecContent().size()<<")" << std::endl;
297  }
298  return true;
299  }else{
300  return false;
301  }
302 }
@ BOOKMAINPAGELINK
Definition: PLatexType.h:65

References PLatexType::BOOKMAINPAGELINK, PLatexObj::getVecContent(), PGenericParser::p_bookMainPageLink, and parseComplexMonoParam().

Referenced by parseAllLatexObj().

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

◆ parseBookMasterProject()

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

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(), PGenericParser::executeLatexCommand(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PGenericParser::p_bookMasterProjectUrl, PMultiFileParser::p_parser, and PGenericParser::playTextLatexObj().

Referenced by PGenericParser::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 
)
protectedinherited

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 PGenericParser::executeLatexCommand(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PGenericParser::p_bookSideBarWidth, PMultiFileParser::p_parser, and PGenericParser::playTextLatexObj().

Referenced by PGenericParser::parseGenericLatexObj().

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

◆ parseComment()

bool PConfigParser::parseComment ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a comment.

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

Definition at line 577 of file PConfigParser.cpp.

577  {
578  if(!p_isAllowComment){return false;}
579  if(!p_parser->isMatch("%")){return false;}
580  playTextLatexObj(parent, textObj);
581  PString comment(p_parser->getUntilKeyWithoutPatern("\n"));
582  PLatexObj tmp;
584  tmp.setName(comment);
585  addLatexObj(parent, tmp);
586  return true;
587 }

References PGenericParser::addLatexObj(), PLatexType::COMMENT, PFileParser::getUntilKeyWithoutPatern(), PFileParser::isMatch(), p_isAllowComment, PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), PLatexObj::setName(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseComplexMonoParam()

bool PConfigParser::parseComplexMonoParam ( PLatexObj parent,
PLatexObj textObj,
const PString functionName,
PLatexType::PLatexType  type 
)
private

Parse all the functions which have complex 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 180 of file PConfigParser.cpp.

180  {
181  if(!p_parser->isMatchToken(functionName)){return false;}
182  playTextLatexObj(parent, textObj);
183  PLatexObj tmp;
184  tmp.setType(type);
185 
186  PString textOption(getOptionStringBetweenHook());
187  tmp.setText(textOption);
188 
189  parseVecLatexObj(tmp, textObj, "{", "}");
190 
191  addLatexObj(parent, tmp);
192  return true;
193 }
void parseVecLatexObj(PLatexObj &parent, PLatexObj &textObj, const PString &beginPatern, const PString &endPatern)
Parse a vector of latex object.
PString getOptionStringBetweenHook()
Get optional string between hooks [...].

References PGenericParser::addLatexObj(), PGenericParser::getOptionStringBetweenHook(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, parseVecLatexObj(), PGenericParser::playTextLatexObj(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by parseAllLatexObj(), and parseBookMainPageLink().

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

◆ parseDebug()

bool PConfigParser::parseDebug ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse the debug function.

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

Definition at line 594 of file PConfigParser.cpp.

594  {
595  if(!p_parser->isMatchToken("\\debug")){return false;}
596  if(p_isDebugMode){
597  playTextLatexObj(parent, textObj);
598  PLatexObj tmp;
600  PString text(getStringBetweenBraces("\\debug"));
601  tmp.setName(text);
602  addLatexObj(parent, tmp);
603  }
604  return true;
605 }

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

Referenced by parseAllLatexObj().

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

◆ parseDots()

bool PConfigParser::parseDots ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a space paragraphe.

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

Definition at line 353 of file PConfigParser.cpp.

353  {
354  if(!isMatch("\\dots")){return false;}
355  playTextLatexObj(parent, textObj);
357  PLatexObj tmp;
359  tmp.setText("... ");
360  addLatexObj(parent, tmp);
361  return true;
362 }

References PGenericParser::addLatexObj(), PGenericParser::getOptionStringBetweenBraces(), PMultiFileParser::isMatch(), PGenericParser::playTextLatexObj(), PLatexObj::setText(), PLatexObj::setType(), and PLatexType::TEXT.

Referenced by parseAllLatexObj().

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

◆ parseDoubleInlineMath()

bool PConfigParser::parseDoubleInlineMath ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse an inline math formula.

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

Definition at line 970 of file PConfigParser.cpp.

970  {
971  if(!p_isAllowMath){return false;}
972  if(!p_parser->isMatch("$$", "\\")){return false;}
973  playTextLatexObj(parent, textObj);
974  PString mathText(p_parser->getUntilKeyWithoutPatern("$$"));
975  PLatexObj inlineMath;
976  inlineMath.setType(PLatexType::DISPLAYMATH);
977  inlineMath.setText(mathText);
978 
979  addLatexObj(parent, inlineMath);
980  return true;
981 }

References PGenericParser::addLatexObj(), PLatexType::DISPLAYMATH, PFileParser::getUntilKeyWithoutPatern(), PFileParser::isMatch(), p_isAllowMath, PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseEnvironement()

bool PConfigParser::parseEnvironement ( PLatexObj parent,
PLatexObj textObj,
const PString environementName,
PLatexType::PLatexType  type 
)
private

Parse latex environement.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
environementName: name of the evironement
type: type of the environement
Returns
true on success, false otherwise

Definition at line 825 of file PConfigParser.cpp.

825  {
826  std::vector<PString> vecPatern(getBeginSeqEnv(environementName));
827  if(!p_parser->isMatchSeq(vecPatern)){return false;}
828  return parseEnvironementContent(parent, textObj, environementName, type, true, true, "div");
829 }
PVecString getBeginSeqEnv(const PString &envName)
Get the sequence of the begining of an environement.
bool parseEnvironementContent(PLatexObj &parent, PLatexObj &textObj, const PString &environementName, PLatexType::PLatexType type, bool isAllowComment, bool isAllowMath, const PString &envBalise)
Parse latex environement.

References getBeginSeqEnv(), PFileParser::isMatchSeq(), PMultiFileParser::p_parser, and parseEnvironementContent().

Referenced by parseAllLatexObj().

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

◆ parseEnvironementContent()

bool PConfigParser::parseEnvironementContent ( PLatexObj parent,
PLatexObj textObj,
const PString environementName,
PLatexType::PLatexType  type,
bool  isAllowComment,
bool  isAllowMath,
const PString envBalise 
)
private

Parse latex environement.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
environementName: name of the evironement
type: type of the environement
isAllowComment: true to allow comment, false otherwise
isAllowMath: true to allow math, false otherwise
envBalise: balise of the env to be used
Returns
true on success, false otherwise

Definition at line 841 of file PConfigParser.cpp.

843 {
844  playTextLatexObj(parent, textObj);
845  PLatexObj env;
846  env.setType(type);
847  env.setName(environementName);
848  env.setBalise(envBalise);
849  PLatexObj tmpText;
850  tmpText.setType(PLatexType::TEXT);
851  std::vector<PString> vecPatern(getEndSeqEnv(environementName));
852 
853  bool saveIsAllowComment(p_isAllowComment), saveIsAllowMath(p_isAllowMath);
854  p_isAllowComment = isAllowComment;
855  p_isAllowMath = isAllowMath;
856  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPatern) && p_run){
857  if(parseAllLatexObj(env, tmpText)){}
858  else{
859  incrementCurrentChar(tmpText);
860  }
861  }
862  p_isAllowComment = saveIsAllowComment;
863  p_isAllowMath = saveIsAllowMath;
864 
865  playTextLatexObj(env, tmpText);
866  addLatexObj(parent, env);
867  return true;
868 }
PVecString getEndSeqEnv(const PString &envName)
Get the sequence of the ending of an environement.
void setBalise(const PString &balise)
Sets the balise of the PLatexObj.
Definition: PLatexObj.cpp:172

References PGenericParser::addLatexObj(), getEndSeqEnv(), PGenericParser::incrementCurrentChar(), PFileParser::isEndOfFile(), PFileParser::isMatchSeq(), p_isAllowComment, p_isAllowMath, PMultiFileParser::p_parser, PMultiFileParser::p_run, parseAllLatexObj(), PGenericParser::playTextLatexObj(), PLatexObj::setBalise(), PLatexObj::setName(), PLatexObj::setType(), and PLatexType::TEXT.

Referenced by parseEnvironement(), and parseExtraEnvironementContent().

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

◆ parseEnvStringOnly()

bool PConfigParser::parseEnvStringOnly ( PLatexObj parent,
PLatexObj textObj,
const PString environementName,
PLatexType::PLatexType  type 
)
private

Parse an environement which contains only a string.

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

Definition at line 928 of file PConfigParser.cpp.

928  {
930  if(!p_parser->isMatchToken("\\begin")){return false;}
931  PString envName(getStringBetweenBraces("\\begin").eraseFirstLastChar(" \t\n"));
932  if(environementName != envName){
934  return false;
935  }
936  playTextLatexObj(parent, textObj);
937  PString envContent(p_parser->getUntilKeyWithoutPatern("\\end{"+environementName+"}"));
938 
939  PLatexObj tmp;
940  tmp.setType(type);
941  tmp.setText(envContent);
942 
943  addLatexObj(parent, tmp);
944  return true;
945 }
void eraseFirstLastChar(PVecString &vecOut, const PVecString &vecStr, const PString &vecChar)
Erase first and last characters of all PString in given vector.
Definition: PString.cpp:52
void popPosition()
Get to the last saved position of the PFileParser in the current file.
Definition: PFileParser.cpp:99
void pushPosition()
Remember the current position of the PFileParser in the current file.
Definition: PFileParser.cpp:93

References PGenericParser::addLatexObj(), eraseFirstLastChar(), PGenericParser::getStringBetweenBraces(), PFileParser::getUntilKeyWithoutPatern(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), PFileParser::popPosition(), PFileParser::pushPosition(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseExtraEnvironement()

bool PConfigParser::parseExtraEnvironement ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...)

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

Definition at line 1140 of file PConfigParser.cpp.

1140  {
1141  if(p_vecNameExtraEnv.size() == 0lu){return false;}
1143  if(!p_parser->isMatch("\\begin")){return false;}
1145  char ch = p_parser->getCurrentCh();
1146  if(ch != '{'){
1147  errorAt();
1148  std::cerr << "PConfigParser::parseExtraEnvironement : expect '{' after '\\begin' instead of '"<<ch<<"'" << std::endl;
1149  stopParsing();
1150  return true;
1151  }
1152  p_parser->getNextChar();
1154  if(matchEnv == ""){
1155  p_parser->popPosition();
1156  return false;
1157  }
1159  ch = p_parser->getCurrentCh();
1160  if(ch != '}'){
1161  errorAt();
1162  std::cerr << "PConfigParser::parseExtraEnvironement : expect '}' after '\\begin{matchEnv' instead of '"<<ch<<"'" << std::endl;
1163  stopParsing();
1164  return true;
1165  }
1166  p_parser->getNextChar();
1167  return parseExtraEnvironementContent(parent, textObj, matchEnv, PLatexType::ENVIRONEMENT);
1168 }
bool parseExtraEnvironementContent(PLatexObj &parent, PLatexObj &textObj, const PString &environementName, PLatexType::PLatexType type)
Parse latex environement.
@ ENVIRONEMENT
Definition: PLatexType.h:85

References PLatexType::ENVIRONEMENT, PMultiFileParser::errorAt(), PFileParser::getCurrentCh(), PFileParser::getNextChar(), PFileParser::isMatch(), PMultiFileParser::p_parser, PGenericParser::p_vecNameExtraEnv, parseExtraEnvironementContent(), PARSER_SKIP_SPACE, PFileParser::popPosition(), PFileParser::pushPosition(), and PMultiFileParser::stopParsing().

Referenced by parseAllLatexObj().

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

◆ parseExtraEnvironementContent()

bool PConfigParser::parseExtraEnvironementContent ( PLatexObj parent,
PLatexObj textObj,
const PString environementName,
PLatexType::PLatexType  type 
)
private

Parse latex environement.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
environementName: name of the evironement
type: type of the environement
Returns
true on success, false otherwise

Definition at line 1177 of file PConfigParser.cpp.

1177  {
1178  PEnvironement & configEnv = p_vecExtraEnv[environementName];
1179  return parseEnvironementContent(parent, textObj, environementName,
1180  type, configEnv.getIsAllowComment(), configEnv.getIsAlloxMath(), configEnv.getBalise());
1181 }
bool getIsAllowComment() const
Gets the isAllowComment of the PEnvironement.
Definition: PLatexObj.cpp:1159
bool getIsAlloxMath() const
Gets the isAlloxMath of the PEnvironement.
Definition: PLatexObj.cpp:1173
const PString & getBalise() const
Gets the balise of the PEnvironement.
Definition: PLatexObj.cpp:1145

References PEnvironement::getBalise(), PEnvironement::getIsAllowComment(), PEnvironement::getIsAlloxMath(), PGenericParser::p_vecExtraEnv, and parseEnvironementContent().

Referenced by parseExtraEnvironement().

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

◆ parseExtraEnvironementFunction()

bool PConfigParser::parseExtraEnvironementFunction ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...)

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

Definition at line 1189 of file PConfigParser.cpp.

1189  {
1190  if(p_vecNameFunctionExtraEnv.size() == 0lu){return false;}
1193  if(matchFunc == ""){
1194  p_parser->popPosition();
1195  return false;
1196  }
1198  char ch = p_parser->getCurrentCh();
1199  if(ch != '{'){
1200  p_parser->popPosition(); //This is not the expected environement
1201  return false;
1202  }
1203  playTextLatexObj(parent, textObj);
1204  PLatexObj tmp;
1206 
1207  PString matchEnv(matchFunc.eraseChar('\\'));
1208  tmp.setName(matchEnv);
1209 
1210  PEnvironement & configEnv = p_vecExtraEnv[matchEnv];
1211  tmp.setBalise(configEnv.getBalise());
1212 
1213  p_parser->getNextChar();
1214  PPath fileName(p_parser->getUntilKeyWithoutPatern("}"));
1215  if(fileName != ""){
1216  if(fileName[0] != '/'){
1217  fileName = p_parser->getFileName().getParentDirectory() / fileName;
1218  }
1219  PString envContent(fileName.loadFileContent().eraseFirstLastChar(" \t\n"));
1220  PLatexObj content;
1221  content.setType(PLatexType::TEXT);
1222  content.setText(envContent);
1223  tmp.getVecContent().push_back(content);
1224  addLatexObj(parent, tmp);
1225  }
1226  return true;
1227 }

References PGenericParser::addLatexObj(), PLatexType::ENVIRONEMENT, PString::eraseChar(), PString::eraseFirstLastChar(), PEnvironement::getBalise(), PFileParser::getCurrentCh(), PFileParser::getFileName(), PFileParser::getNextChar(), PPath::getParentDirectory(), PFileParser::getUntilKeyWithoutPatern(), PLatexObj::getVecContent(), PFileParser::isMatch(), PPath::loadFileContent(), PMultiFileParser::p_parser, PGenericParser::p_vecExtraEnv, PGenericParser::p_vecNameFunctionExtraEnv, PARSER_SKIP_SPACE, PGenericParser::playTextLatexObj(), PFileParser::popPosition(), PFileParser::pushPosition(), PLatexObj::setBalise(), PLatexObj::setName(), PLatexObj::setText(), PLatexObj::setType(), and PLatexType::TEXT.

Referenced by parseAllLatexObj().

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

◆ parseExtraFunction()

bool PConfigParser::parseExtraFunction ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...)

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

Definition at line 1234 of file PConfigParser.cpp.

1234  {
1235  if(p_vecNameExtraFunction.size() == 0lu){return false;}
1238  if(matchFunc == ""){
1239  p_parser->popPosition();
1240  return false;
1241  }
1242  if(!isMatchRewind("{")){
1243  p_parser->popPosition(); //This is not the expected environement
1244  return false;
1245  }
1246  playTextLatexObj(parent, textObj);
1247  PLatexObj tmp;
1249  PString matchEnv(matchFunc.eraseChar('\\'));
1250  tmp.setName(matchEnv);
1251 
1252  PEnvironement & configEnv = p_vecExtraFunction[matchEnv];
1253  tmp.setBalise(configEnv.getBalise());
1254 
1255  parseVecLatexObj(tmp, textObj, "{", "}");
1256 
1257  addLatexObj(parent, tmp);
1258  return true;
1259 }
bool isMatchRewind(const PString &token)
Check if the given token matches the current read file and goes back even if the token matches.

References PGenericParser::addLatexObj(), PString::eraseChar(), PLatexType::FUNCTION, PEnvironement::getBalise(), PFileParser::isMatch(), PMultiFileParser::isMatchRewind(), PMultiFileParser::p_parser, PGenericParser::p_vecExtraFunction, PGenericParser::p_vecNameExtraFunction, parseVecLatexObj(), PGenericParser::playTextLatexObj(), PFileParser::popPosition(), PFileParser::pushPosition(), PLatexObj::setBalise(), PLatexObj::setName(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseFile()

bool PConfigParser::parseFile ( )
protectedvirtual

Parse the input file.

Returns
true on success, false otherwise

Implements PMultiFileParser.

Definition at line 64 of file PConfigParser.cpp.

64  {
65  if(!p_run) return false;
69  p_currentSource.setLink("index.html");
71 
72  //To parse the file we need to read char by char until we get something we know
73  while(!p_parser->isEndOfFile() && p_run){ //If we are not at the end of the file
75  else{
77  }
78  }
80 
81  return true;
82 }
void setLink(const PString &link)
Sets the link of the PLatexObj.
Definition: PLatexObj.cpp:165
void setSourceFile(const PString &sourceFile)
Sets the sourceFile of the PLatexObj.
Definition: PLatexObj.cpp:249
void setSourceLine(size_t sourceLine)
Sets the sourceLine of the PLatexObj.
Definition: PLatexObj.cpp:256
PPath getFileName() const
renvoie le fichier du PLocation
Definition: PLocation.cpp:60

References PPath::eraseExtension(), PLatexType::FILE, PPath::getFileName(), PFileParser::getFileName(), PLocation::getFileName(), PFileParser::getLocation(), PGenericParser::incrementCurrentChar(), PFileParser::isEndOfFile(), PGenericParser::p_currentSource, PGenericParser::p_currentText, PMultiFileParser::p_parser, PMultiFileParser::p_run, parseAllLatexObj(), PGenericParser::playTextLatexObj(), PLatexObj::setLink(), PLatexObj::setName(), PLatexObj::setSourceFile(), PLatexObj::setSourceLine(), and PLatexObj::setType().

+ Here is the call graph for this function:

◆ parseGenericLatexObj()

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

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 parseLabel(PLatexObj &parent, PLatexObj &textObj)
Parse latex label.

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

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

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

◆ parseHref()

bool PConfigParser::parseHref ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse latex Href.

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

Definition at line 612 of file PConfigParser.cpp.

612  {
613  if(!p_parser->isMatchToken("\\href")){return false;}
614  playTextLatexObj(parent, textObj);
615  PLatexObj tmp;
617  PString link(getStringBetweenBraces("\\href"));
618  tmp.setName(link);
619 
620  parseVecLatexObj(tmp, textObj, "{", "}");
621  if(!tmp.getName().isSameBegining("http") && !tmp.getName().isSameBegining("https")){
622  PPath buildFileName(copyFile(PPath(LATEX_RESSOURCES_OUTPUT_DIR), link));
623  if(buildFileName == ""){
624  if(PPath(tmp.getName()).getExtension() != "html"){
625  errorAt();
626  std::cerr << "PConfigParser::parseHref : cannot copy file '"<<link<<"' in '" LATEX_RESSOURCES_OUTPUT_DIR "'" << std::endl;
627  return true;
628  }
629  buildFileName = link;
630  }
631  tmp.setName(buildFileName);
632  }
633  addLatexObj(parent, tmp);
634  return true;
635 }
#define LATEX_RESSOURCES_OUTPUT_DIR
Definition: PLatexObj_def.h:13
PPath copyFile(const PPath &outputDir, const PPath &fileName)
Copy a file.
const PString & getName() const
Gets the name of the PLatexObj.
Definition: PLatexObj.cpp:326
PString getExtension() const
Get file extension.
Definition: PPath.cpp:252

References PGenericParser::addLatexObj(), PGenericParser::copyFile(), PMultiFileParser::errorAt(), PPath::getExtension(), PLatexObj::getName(), PGenericParser::getStringBetweenBraces(), PLatexType::HREF, PFileParser::isMatchToken(), PString::isSameBegining(), LATEX_RESSOURCES_OUTPUT_DIR, PMultiFileParser::p_parser, parseVecLatexObj(), PGenericParser::playTextLatexObj(), PLatexObj::setName(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseIncludeFile()

bool PConfigParser::parseIncludeFile ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a file inclusion.

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

Definition at line 368 of file PConfigParser.cpp.

368  {
369  if(!p_parser->isMatchToken("\\include")){return false;}
370  playTextLatexObj(parent, textObj);
371  PString fileName(getStringBetweenBraces("\\include"));
372 
373  PPath fileToBeLoaded(fileName);
374  if(fileToBeLoaded.size() != 0lu){
375  if(fileToBeLoaded[0] != '/'){
376  fileToBeLoaded = p_parser->getFileName().getParentDirectory() / fileToBeLoaded;
377  }
378  }
379  return loadInclude(parent, textObj, fileToBeLoaded);
380 }
bool loadInclude(PLatexObj &parent, PLatexObj &textObj, const PPath &fileName)
Load a included file.

References PFileParser::getFileName(), PPath::getParentDirectory(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), loadInclude(), PMultiFileParser::p_parser, and PGenericParser::playTextLatexObj().

Referenced by parseAllLatexObj().

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

◆ parseIncludeGraphic()

bool PConfigParser::parseIncludeGraphic ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse the includegraphic command.

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

Definition at line 708 of file PConfigParser.cpp.

708  {
709  if(!p_parser->isMatchToken("\\includegraphics")){return false;}
710  playTextLatexObj(parent, textObj);
712  char ch = p_parser->getCurrentCh();
713  PString prevToken(""),option("");
714  prevToken += ch;
715  if(ch == '['){ //We skip the options for now
717  option = p_parser->getUntilKeyWithoutPatern("]");
718  prevToken += option;
719  ch = p_parser->getCurrentCh();
720  }
722  if(ch != '{'){
723  errorAt();
724  std::cerr << "PConfigParser::parseIncludeGraphic : expect '{' after '"+prevToken+"' instead of '"<<ch<<"'" << std::endl;
725  stopParsing();
726  return "";
727  }
729  PString imageFile(p_parser->getUntilKeyWithoutPatern("}"));
730  PLatexObj tmp;
732 
733  PString buildFileName("");
734  if(!imageFile.isSameBegining("http")){
735  buildFileName = copyFile(PPath(LATEX_IMAGE_OUTPUT_DIR), imageFile);
736  }else{
737  buildFileName = imageFile;
738  }
739  if(buildFileName == ""){return true;}
740  tmp.setName(buildFileName);
741  tmp.setText(option);
742 
743  addLatexObj(parent, tmp);
744  return true;
745 }
#define LATEX_IMAGE_OUTPUT_DIR
Definition: PLatexObj_def.h:11

References PGenericParser::addLatexObj(), PGenericParser::copyFile(), PMultiFileParser::errorAt(), PFileParser::getCurrentCh(), PFileParser::getNextChar(), PFileParser::getUntilKeyWithoutPatern(), PLatexType::IMAGE, PFileParser::isMatchToken(), PString::isSameBegining(), LATEX_IMAGE_OUTPUT_DIR, PMultiFileParser::p_parser, PARSER_SKIP_SPACE, PGenericParser::playTextLatexObj(), PLatexObj::setName(), PLatexObj::setText(), PLatexObj::setType(), and PMultiFileParser::stopParsing().

Referenced by parseAllLatexObj().

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

◆ parseInlineMath()

bool PConfigParser::parseInlineMath ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse an inline math formula.

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

Definition at line 952 of file PConfigParser.cpp.

952  {
953  if(!p_isAllowMath){return false;}
954  if(!p_parser->isMatch("$", "\\")){return false;}
955  playTextLatexObj(parent, textObj);
956  PString mathText(p_parser->getUntilKeyWithoutPatern("$"));
957  PLatexObj inlineMath;
958  inlineMath.setType(PLatexType::INLINEMATH);
959  inlineMath.setText(mathText);
960 
961  addLatexObj(parent, inlineMath);
962  return true;
963 }

References PGenericParser::addLatexObj(), PFileParser::getUntilKeyWithoutPatern(), PLatexType::INLINEMATH, PFileParser::isMatch(), p_isAllowMath, PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseInputFile()

bool PConfigParser::parseInputFile ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a file inclusion.

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

Definition at line 387 of file PConfigParser.cpp.

387  {
388  if(!p_parser->isMatchToken("\\input")){return false;}
389  playTextLatexObj(parent, textObj);
390  PString fileName(getStringBetweenBraces("\\input"));
391 
392  PPath fileToBeLoaded(fileName);
393  if(fileToBeLoaded.size() != 0lu){
394  if(fileToBeLoaded[0] != '/'){
395  fileToBeLoaded = p_parser->getFileName().getParentDirectory() / fileToBeLoaded;
396  }
397  }
398  return loadInclude(parent, textObj, fileToBeLoaded);
399 }

References PFileParser::getFileName(), PPath::getParentDirectory(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), loadInclude(), PMultiFileParser::p_parser, and PGenericParser::playTextLatexObj().

Referenced by parseAllLatexObj().

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

◆ parseItem()

bool PConfigParser::parseItem ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse an item.

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

Definition at line 999 of file PConfigParser.cpp.

999  {
1000  if(!p_parser->isMatch("\\item")){return false;}
1001  playTextLatexObj(parent, textObj);
1002 
1003  PLatexObj env;
1005 
1006  PLatexObj tmpText;
1007  tmpText.setType(PLatexType::TEXT);
1008 
1009  std::vector<PString> vecPaternItemize;
1010  vecPaternItemize.push_back("\\end");
1011  vecPaternItemize.push_back("{");
1012  vecPaternItemize.push_back("itemize");
1013  vecPaternItemize.push_back("}");
1014 
1015  std::vector<PString> vecPaternEnumerate;
1016  vecPaternEnumerate.push_back("\\end");
1017  vecPaternEnumerate.push_back("{");
1018  vecPaternEnumerate.push_back("enumerate");
1019  vecPaternEnumerate.push_back("}");
1020 
1021  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPaternItemize, true) &&
1022  !p_parser->isMatchSeq(vecPaternEnumerate, true) &&
1023  !parseStringAndGoBack("\\item") && p_run)
1024  {
1025  if(parseAllLatexObj(env, tmpText)){}
1026  else{
1027  incrementCurrentChar(tmpText);
1028  }
1029  }
1030  playTextLatexObj(env, tmpText);
1031 
1032  addLatexObj(parent, env);
1033 
1034 
1035  return true;
1036 }
bool parseStringAndGoBack(const PString &str)
Parse a string an go back if the string exists.

References PGenericParser::addLatexObj(), PGenericParser::incrementCurrentChar(), PFileParser::isEndOfFile(), PFileParser::isMatch(), PFileParser::isMatchSeq(), PLatexType::ITEM, PMultiFileParser::p_parser, PMultiFileParser::p_run, parseAllLatexObj(), parseStringAndGoBack(), PGenericParser::playTextLatexObj(), PLatexObj::setType(), and PLatexType::TEXT.

Referenced by 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 
)
protectedinherited

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 }
PLatexObj * getLastPLatexObj(PLatexObj &obj)
Get the last PLatexObj of the given one.

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

Referenced by PGenericParser::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 
)
protectedinherited

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 PGenericParser::executeLatexCommand(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), and PLatexObj::setAuthor().

Referenced by PGenericParser::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 
)
protectedinherited

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 PGenericParser::executeLatexCommand(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), and PLatexObj::setDate().

Referenced by PGenericParser::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 
)
protectedinherited

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 PGenericParser::executeLatexCommand(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), and PLatexObj::setSubTitle().

Referenced by PGenericParser::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 
)
protectedinherited

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 PGenericParser::executeLatexCommand(), PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), and PLatexObj::setName().

Referenced by PGenericParser::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 
)
protectedinherited

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 }

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

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

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

◆ parseNewLine()

bool PConfigParser::parseNewLine ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a new line.

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

Definition at line 325 of file PConfigParser.cpp.

325  {
326  if(!p_parser->isMatch("\n\n")){return false;}
327  playTextLatexObj(parent, textObj);
328  PLatexObj tmp;
330  addLatexObj(parent, tmp);
331  return true;
332 }
@ AUTOSPACEPARAGRAPH
Definition: PLatexType.h:28

References PGenericParser::addLatexObj(), PLatexType::AUTOSPACEPARAGRAPH, PFileParser::isMatch(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseParserLanguage()

bool PConfigParser::parseParserLanguage ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse language parser (cplusplus, cmake, glsl, cuda, ...)

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

Definition at line 1043 of file PConfigParser.cpp.

1043  {
1044  if(p_vecNameExtraParser.size() == 0lu){return false;}
1046  if(!p_parser->isMatchToken("\\begin")){return false;}
1048  char ch = p_parser->getCurrentCh();
1049  if(ch != '{'){
1050  p_parser->popPosition(); //This is not the expected environement
1051  return false;
1052  }
1053  p_parser->getNextChar();
1055  if(matchEnv == ""){
1056  p_parser->popPosition();
1057  return false;
1058  }
1060  ch = p_parser->getCurrentCh();
1061  if(ch != '}'){
1062  p_parser->popPosition(); //This is not the expected environement
1063  return false;
1064  }
1065  p_parser->getNextChar();
1066  playTextLatexObj(parent, textObj);
1067  PLatexObj tmp;
1069  tmp.setName(matchEnv);
1070 
1071  PParserEnv parser(getParserEnv(p_vecExtraParser, matchEnv));
1072  char saveEscapeChar = p_parser->getEscapeChar();
1073  p_parser->setEscapeChar('\0');
1074  PString inputFileContent(p_parser->getUntilKeyWithoutPatern("\\end{"+matchEnv+"}").eraseFirstLastChar(" \n") + "\n");
1075  p_parser->setEscapeChar(saveEscapeChar);
1076  tmp.setNbline(inputFileContent.count('\n'));
1077 
1078  PString envContent(parser_makeHighlighting(inputFileContent, parser));
1079  tmp.setText(envContent);
1080 
1081  addLatexObj(parent, tmp);
1082  return true;
1083 }
void setEscapeChar(char escapeChar)
Sets the escape character of the PFileParser.
Definition: PFileParser.cpp:58
char getEscapeChar() const
Gets the escape character of the PFileParser.
void setNbline(long unsigned int nbline)
Sets the nbline of the PLatexObj.
Definition: PLatexObj.cpp:193
PString eraseFirstLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:545
PString parser_makeHighlighting(const PString &strContent, const PParserEnv &parser)
Do the highlighting of the input text.
PParserEnv getParserEnv(const PVecParserEnv &vecParser, const PString &nameParser)
Get the parser env.

References PGenericParser::addLatexObj(), PString::count(), PString::eraseFirstLastChar(), PFileParser::getCurrentCh(), PFileParser::getEscapeChar(), PFileParser::getNextChar(), getParserEnv(), PFileParser::getUntilKeyWithoutPatern(), PFileParser::isMatch(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::p_vecExtraParser, PGenericParser::p_vecNameExtraParser, PLatexType::PARSER, parser_makeHighlighting(), PARSER_SKIP_SPACE, PGenericParser::playTextLatexObj(), PFileParser::popPosition(), PFileParser::pushPosition(), PFileParser::setEscapeChar(), PLatexObj::setName(), PLatexObj::setNbline(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseParserLanguageFunction()

bool PConfigParser::parseParserLanguageFunction ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a language parser with a function which get an input file.

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

Definition at line 1090 of file PConfigParser.cpp.

1090  {
1091  if(p_vecNameFunctionExtraParser.size() == 0lu){return false;}
1094  if(matchFunc == ""){
1095  p_parser->popPosition();
1096  return false;
1097  }
1099  char ch = p_parser->getCurrentCh();
1100  if(ch != '{'){
1101  p_parser->popPosition(); //This is not the expected environement
1102  return false;
1103  }
1104  playTextLatexObj(parent, textObj);
1105  PLatexObj tmp;
1107  PString matchEnv(matchFunc.eraseChar('\\'));
1108  tmp.setName(matchEnv);
1109 
1110  p_parser->getNextChar();
1111  PString baseContent(p_parser->getUntilKeyWithoutPaternRecurse("}", "{"));
1112  PPath fileName(baseContent);
1113  if(fileName != ""){
1114  if(fileName[0] != '/'){
1115  fileName = p_parser->getFileName().getParentDirectory() / fileName;
1116  }
1117  PParserEnv parser(getParserEnv(p_vecExtraParser, matchEnv));
1118  PString inputFileContent("");
1119  if(fileName.isFileExist()){
1120  inputFileContent = fileName.loadFileContent().eraseFirstLastChar(" \n") + "\n";
1121  }else{
1122  inputFileContent = baseContent + " ";
1123  }
1124  tmp.setNbline(inputFileContent.count('\n')); //The first line has no \n, if there is a \n there are two lines
1125 
1126  PString envContent(parser_makeHighlighting(inputFileContent, parser));
1127  tmp.setText(envContent);
1128 
1129  addLatexObj(parent, tmp);
1130  }
1131 
1132  return true;
1133 }

References PGenericParser::addLatexObj(), PString::count(), PString::eraseChar(), PString::eraseFirstLastChar(), PFileParser::getCurrentCh(), PFileParser::getFileName(), PFileParser::getNextChar(), PPath::getParentDirectory(), getParserEnv(), PFileParser::getUntilKeyWithoutPaternRecurse(), PPath::isFileExist(), PFileParser::isMatch(), PPath::loadFileContent(), PMultiFileParser::p_parser, PGenericParser::p_vecExtraParser, PGenericParser::p_vecNameFunctionExtraParser, PLatexType::PARSER, parser_makeHighlighting(), PARSER_SKIP_SPACE, PGenericParser::playTextLatexObj(), PFileParser::popPosition(), PFileParser::pushPosition(), PLatexObj::setName(), PLatexObj::setNbline(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parsePercent()

bool PConfigParser::parsePercent ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse latex percent.

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

Definition at line 642 of file PConfigParser.cpp.

642  {
643  if(!p_parser->isMatch("\\%")){return false;}
644  playTextLatexObj(parent, textObj);
645  PLatexObj tmp;
647  addLatexObj(parent, tmp);
648  return true;
649 }

References PGenericParser::addLatexObj(), PFileParser::isMatch(), PMultiFileParser::p_parser, PLatexType::PERCENT, PGenericParser::playTextLatexObj(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parserCallDot()

bool PConfigParser::parserCallDot ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a call to dot.

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

Definition at line 540 of file PConfigParser.cpp.

540  {
541  if(!p_parser->isMatchToken("\\calldot")){return false;}
542  playTextLatexObj(parent, textObj);
544  PLatexObj tmp;
546  PString baseContent(p_parser->getUntilKeyWithoutPaternRecurse("}", "{"));
547  PString fileName(baseContent);
548  tmp.setName(fileName);
549  tmp.setText(p_parser->getFileName());
550  addLatexObj(parent, tmp);
551  return true;
552 }

References PGenericParser::addLatexObj(), PLatexType::CALLDOT, PFileParser::getFileName(), PFileParser::getNextChar(), PFileParser::getUntilKeyWithoutPaternRecurse(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), PLatexObj::setName(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parserDetails()

bool PConfigParser::parserDetails ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a detail environement.

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

Definition at line 462 of file PConfigParser.cpp.

462  {
463  std::vector<PString> vecBeginPatern(getBeginSeqEnv("detail"));
464  if(!p_parser->isMatchSeq(vecBeginPatern)){return false;}
465  playTextLatexObj(parent, textObj);
466  //Parse the summary
467  PLatexObj summaryObj;
468  summaryObj.setType(PLatexType::SUMMARY);
469  parseVecLatexObj(summaryObj, textObj, "{", "}");
470 
471  PLatexObj env;
473  env.setName("details");
474  env.setBalise("details");
475 
476  addLatexObj(env, summaryObj);
477  //Parse the environement
478  PLatexObj tmpText;
479  tmpText.setType(PLatexType::TEXT);
480  std::vector<PString> vecPatern(getEndSeqEnv("detail"));
481 
482  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPatern) && p_run){
483  if(parseAllLatexObj(env, tmpText)){}
484  else{
485  incrementCurrentChar(tmpText);
486  }
487  }
488  playTextLatexObj(env, tmpText);
489  addLatexObj(parent, env);
490  return true;
491 }

References PGenericParser::addLatexObj(), PLatexType::DETAILS, getBeginSeqEnv(), getEndSeqEnv(), PGenericParser::incrementCurrentChar(), PFileParser::isEndOfFile(), PFileParser::isMatchSeq(), PMultiFileParser::p_parser, PMultiFileParser::p_run, parseAllLatexObj(), parseVecLatexObj(), PGenericParser::playTextLatexObj(), PLatexObj::setBalise(), PLatexObj::setName(), PLatexObj::setType(), PLatexType::SUMMARY, and PLatexType::TEXT.

Referenced by parseAllLatexObj().

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

◆ parseRealNewLine()

bool PConfigParser::parseRealNewLine ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a new line.

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

Definition at line 339 of file PConfigParser.cpp.

339  {
340  if(!p_parser->isMatch("\\\\")){return false;}
341  playTextLatexObj(parent, textObj);
342  PLatexObj tmp;
344  addLatexObj(parent, tmp);
345  return true;
346 }

References PGenericParser::addLatexObj(), PFileParser::isMatch(), PLatexType::NEWLINE, PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parserGetEnv()

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

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 PGenericParser::addLatexObj(), PLatexType::GETENV, PGenericParser::getStringBetweenBraces(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), PLatexObj::setName(), and PLatexObj::setType().

Referenced by PGenericParser::parseGenericLatexObj().

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

◆ parserQuote()

bool PConfigParser::parserQuote ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a quote environnement.

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

Definition at line 498 of file PConfigParser.cpp.

498  {
499  std::vector<PString> vecBeginPatern(getBeginSeqEnv("quote"));
500  if(!p_parser->isMatchSeq(vecBeginPatern)){return false;}
501  playTextLatexObj(parent, textObj);
502 
503  PLatexObj env;
505 
506  PLatexObj authorQuote;
507  authorQuote.setType(PLatexType::FUNCTION);
508  authorQuote.setName("rightline");
509  authorQuote.setBalise("div");
510  parseVecLatexObj(authorQuote, textObj, "{", "}");
511 
512  PLatexObj contentQuote;
513  contentQuote.setType(PLatexType::CENTER);
514 
515  //Parse the environement
516  PLatexObj tmpText;
517  tmpText.setType(PLatexType::TEXT);
518  std::vector<PString> vecPatern(getEndSeqEnv("quote"));
519 
520  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPatern) && p_run){
521  if(parseAllLatexObj(contentQuote, tmpText)){}
522  else{
523  incrementCurrentChar(tmpText);
524  }
525  }
526  playTextLatexObj(contentQuote, tmpText);
527 
528  addLatexObj(env, contentQuote);
529  addLatexObj(env, authorQuote);
530 
531  addLatexObj(parent, env);
532  return true;
533 }

References PGenericParser::addLatexObj(), PLatexType::CENTER, PLatexType::FUNCTION, getBeginSeqEnv(), getEndSeqEnv(), PGenericParser::incrementCurrentChar(), PFileParser::isEndOfFile(), PFileParser::isMatchSeq(), PMultiFileParser::p_parser, PMultiFileParser::p_run, parseAllLatexObj(), parseVecLatexObj(), PGenericParser::playTextLatexObj(), PLatexType::QUOTE, PLatexObj::setBalise(), PLatexObj::setName(), PLatexObj::setType(), and PLatexType::TEXT.

Referenced by parseAllLatexObj().

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

◆ parserSvgToPng()

bool PConfigParser::parserSvgToPng ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a svg to png function.

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

Definition at line 559 of file PConfigParser.cpp.

559  {
560  if(!p_parser->isMatchToken("\\svgtopng")){return false;}
561  playTextLatexObj(parent, textObj);
563  PLatexObj tmp;
565  PString fileName(p_parser->getUntilKeyWithoutPatern("}"));
566  tmp.setName(fileName);
567  tmp.setText(p_parser->getFileName());
568  addLatexObj(parent, tmp);
569  return true;
570 }

References PGenericParser::addLatexObj(), PFileParser::getFileName(), PFileParser::getNextChar(), PFileParser::getUntilKeyWithoutPatern(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::playTextLatexObj(), PLatexObj::setName(), PLatexObj::setText(), PLatexObj::setType(), and PLatexType::SVGTOPNG.

Referenced by parseAllLatexObj().

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

◆ parseSaveSpeaker()

bool PConfigParser::parseSaveSpeaker ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse the savespeakers command.

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

Definition at line 773 of file PConfigParser.cpp.

773  {
774  if(!p_parser->isMatchToken("\\savespeakers")){return false;}
775  playTextLatexObj(parent, textObj);
777 
778  pspeaker_tex(parent.getVecContent(), p_vecSpeaker, "sec_full_speakers");
779  return true;
780 }
void pspeaker_tex(std::vector< PLatexObj > &vecContent, const std::vector< PLatexSpeaker > &vecSpeaker, const PString &sectionLabel)
Save all speakers of the given PTimeTable into a vector of PLatexObj.

References PGenericParser::getOptionStringBetweenBraces(), PLatexObj::getVecContent(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, PGenericParser::p_vecSpeaker, PGenericParser::playTextLatexObj(), and pspeaker_tex().

Referenced by parseAllLatexObj().

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

◆ parseSectionTitle()

bool PConfigParser::parseSectionTitle ( PLatexObj parent,
PLatexObj textObj,
const PString functionName,
PLatexType::PLatexType  type 
)
private

Parse all the functions which have complex 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 658 of file PConfigParser.cpp.

658  {
659  if(!p_parser->isMatchToken(functionName)){return false;}
660  playTextLatexObj(parent, textObj);
661  PLatexObj tmp;
662  tmp.setType(type);
665 
666  PString textOption(getOptionStringBetweenHook());
667  tmp.setText(textOption);
668  PLatexObj objTitle;
669  parseVecLatexObj(objTitle, textObj, "{", "}");
670  tmp.setComplexTitle(objTitle.getVecContent());
671  addLatexObj(parent, tmp);
672  return true;
673 }
void setComplexTitle(const std::vector< PLatexObj > &complexTitle)
Sets the complexTitle of the PLatexObj.
Definition: PLatexObj.cpp:179
size_t getLine() const
renvoie la ligne du PLocation
Definition: PLocation.cpp:67

References PGenericParser::addLatexObj(), PLocation::getFileName(), PLocation::getLine(), PFileParser::getLocation(), PGenericParser::getOptionStringBetweenHook(), PLatexObj::getVecContent(), PFileParser::isMatchToken(), PMultiFileParser::p_parser, parseVecLatexObj(), PGenericParser::playTextLatexObj(), PLatexObj::setComplexTitle(), PLatexObj::setSourceFile(), PLatexObj::setSourceLine(), PLatexObj::setText(), and PLatexObj::setType().

Referenced by parseAllLatexObj().

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

◆ parseSpaceParagraphe()

bool PConfigParser::parseSpaceParagraphe ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a space paragraphe.

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

Definition at line 310 of file PConfigParser.cpp.

310  {
311  if(!isMatch("\\spaceparagraphe")){return false;}
312  playTextLatexObj(parent, textObj);
314  PLatexObj tmp;
316  addLatexObj(parent, tmp);
317  return true;
318 }
@ SPACEPARAGRAPH
Definition: PLatexType.h:27

References PGenericParser::addLatexObj(), PGenericParser::getOptionStringBetweenBraces(), PMultiFileParser::isMatch(), PGenericParser::playTextLatexObj(), PLatexObj::setType(), and PLatexType::SPACEPARAGRAPH.

Referenced by parseAllLatexObj().

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

◆ parseStringAndGoBack()

bool PConfigParser::parseStringAndGoBack ( const PString str)
private

Parse a string an go back if the string exists.

Parameters
str: string to be serached
Returns
true if the string has been found, false otherwise

Definition at line 987 of file PConfigParser.cpp.

987  {
989  bool b = p_parser->isMatch(str);
991  return b;
992 }

References PFileParser::isMatch(), PMultiFileParser::p_parser, PFileParser::popPosition(), and PFileParser::pushPosition().

Referenced by parseItem().

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

◆ parseTabular()

bool PConfigParser::parseTabular ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a tabular environement.

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

Definition at line 875 of file PConfigParser.cpp.

875  {
876  std::vector<PString> vecBeginPatern(getBeginSeqEnv("tabular"));
877  if(!p_parser->isMatchSeq(vecBeginPatern)){return false;}
878  playTextLatexObj(parent, textObj);
879  getOptionStringBetweenBraces(); //Remove tabular option
880  PLatexObj envTabular;
881  envTabular.setType(PLatexType::TABULAR);
882  envTabular.setName("tabular");
883 
884  std::vector<PString> vecEndPatern(getEndSeqEnv("tabular"));
885 
886  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecEndPatern) && p_run){ //Parse all rows
887  PLatexObj rowObj;
888  rowObj.setType(PLatexType::TABROW);
889  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecEndPatern, true) &&
890  !p_parser->isMatch("\\\\") && p_run) //Parse one row
891  {
892  PLatexObj cellObj;
893  cellObj.setType(PLatexType::TABCELL);
894 
895  PLatexObj tmpText;
896  tmpText.setType(PLatexType::TEXT);
897  //Parse all cells
898  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecEndPatern, true) &&
899  !p_parser->isMatchRewind("\\\\") &&
900  !p_parser->isMatch("&") && p_run) //Parse one cell
901  {
902  if(parseAllLatexObj(cellObj, tmpText)){}
903  else{
904  incrementCurrentChar(tmpText);
905  }
906  }
907  playTextLatexObj(cellObj, tmpText, true);
908  if(cellObj.getVecContent().size() != 0lu){
909  rowObj.getVecContent().push_back(cellObj); //Add cell in row
910  }
911  }
912  if(rowObj.getVecContent().size() != 0lu){
913  envTabular.getVecContent().push_back(rowObj); //Add row in tabular
914  }
915  }
916 
917  addLatexObj(parent, envTabular);
918  return true;
919 }

References PGenericParser::addLatexObj(), getBeginSeqEnv(), getEndSeqEnv(), PGenericParser::getOptionStringBetweenBraces(), PLatexObj::getVecContent(), PGenericParser::incrementCurrentChar(), PFileParser::isEndOfFile(), PFileParser::isMatch(), PFileParser::isMatchRewind(), PFileParser::isMatchSeq(), PMultiFileParser::p_parser, PMultiFileParser::p_run, parseAllLatexObj(), PGenericParser::playTextLatexObj(), PLatexObj::setName(), PLatexObj::setType(), PLatexType::TABCELL, PLatexType::TABROW, PLatexType::TABULAR, and PLatexType::TEXT.

Referenced by parseAllLatexObj().

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

◆ parseTimeTable()

bool PConfigParser::parseTimeTable ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse the timetable command.

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

Definition at line 787 of file PConfigParser.cpp.

787  {
788  if(!p_parser->isMatchToken("\\timetable")){return false;}
789  playTextLatexObj(parent, textObj);
790  PPath timetableConfig = getOptionStringBetweenBraces();
791  PPath timeTableFile = p_parser->getFileName().getParentDirectory() / timetableConfig;
792  //We have to try to load speakers in some are defined in the timetable configuration
793  //But we need also to add \addspeakers function to update a map of speakers in the PGenericParser
794 
795  //Load the timetable toml config
796  PTimeTable timetable;
797  bool isAlreadyDefinedSpeaker = p_vecSpeaker.size() != 0lu;
798  if(isAlreadyDefinedSpeaker){
799  timetable.setVecSpeaker(p_vecSpeaker);
800  }
801  if(!ptimetable_load(timetable, timeTableFile)){
802  errorAt();
803  std::cerr << "PConfigParser::parseTimeTable : cannot parse timetable configuration '"+timeTableFile+"'" << std::endl;
804  stopParsing();
805  return true;
806  }
807  //Update begin and end time of blocks
808  ptimetable_updateEndTime(timetable);
809  //Create the HTML PLatexObj
810  if(!ptimetable_tex(parent.getVecContent(), timetable, PPath(LATEX_INVITATION_OUTPUT_DIR), !isAlreadyDefinedSpeaker)){
811  errorAt();
812  std::cerr << "PConfigParser::parseTimeTable : cannot save timetable '"+timeTableFile+"'" << std::endl;
813  stopParsing();
814  }
815  return true;
816 }
#define LATEX_INVITATION_OUTPUT_DIR
Definition: PLatexObj_def.h:14
Timetable.
Definition: PTimeTable.h:197
void setVecSpeaker(const std::vector< PLatexSpeaker > &vecSpeaker)
Sets the vecSpeaker of the PTimeTable.
Definition: PTimeTable.cpp:824
bool ptimetable_tex(std::vector< PLatexObj > &vecContent, const PTimeTable &timetable, const PPath &outputDirectory, bool isSaveSpeaker)
Convert a PTimeTable into PLatexObj.
void ptimetable_updateEndTime(PTimeTable &timetable)
Update the end time of the blocks.
bool ptimetable_load(PTimeTable &timetable, const PPath &configFile)
Load the PTimeTable with a toml configuration.

References PMultiFileParser::errorAt(), PFileParser::getFileName(), PGenericParser::getOptionStringBetweenBraces(), PPath::getParentDirectory(), PLatexObj::getVecContent(), PFileParser::isMatchToken(), LATEX_INVITATION_OUTPUT_DIR, PMultiFileParser::p_parser, PGenericParser::p_vecSpeaker, PGenericParser::playTextLatexObj(), ptimetable_load(), ptimetable_tex(), ptimetable_updateEndTime(), PTimeTable::setVecSpeaker(), and PMultiFileParser::stopParsing().

Referenced by parseAllLatexObj().

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

◆ parseVecLatexObj()

void PConfigParser::parseVecLatexObj ( PLatexObj parent,
PLatexObj textObj,
const PString beginPatern,
const PString endPatern 
)
private

Parse a vector of latex object.

Parameters
[out]parent: parent PLatexObj
[out]textObj: PLatexObj to deal with text
beginPatern: starting partern to start the parsing of the vector of PLatexObj (disabled is empty)
endPatern: end patern of the vector of latex obj

Definition at line 681 of file PConfigParser.cpp.

681  {
682  if(beginPatern != ""){ //If we check the begin patern
683  if(!p_parser->isMatch(beginPatern)){ //And it does not match
684  return; //We stop
685  }
686  }
688  while(!p_parser->isEndOfFile() && p_run && !p_parser->isMatch(endPatern)){
689  long unsigned int currentPos = p_parser->getCurrentCharIdx();
690 
691  if(parseAllLatexObj(parent, textObj)){}
692  else{
693  incrementCurrentChar(textObj);
694  }
695  if(currentPos == p_parser->getCurrentCharIdx() && !p_parser->isEndOfFile()){
696  std::cerr << "PConfigParser::parseVecLatexObj : the parser is stucked at the position :" << std::endl << "\t" << p_parser->getLocation() << std::endl;
697  p_run = false;
698  }
699  }
700  if(p_run) playTextLatexObj(parent, textObj);
701 }

References PFileParser::getCurrentCharIdx(), PFileParser::getLocation(), PGenericParser::incrementCurrentChar(), PFileParser::isEndOfFile(), PFileParser::isMatch(), PMultiFileParser::p_parser, PMultiFileParser::p_run, parseAllLatexObj(), PARSER_SKIP_SPACE, and PGenericParser::playTextLatexObj().

Referenced by parseComplexMonoParam(), parseExtraFunction(), parseHref(), parserDetails(), parserQuote(), and parseSectionTitle().

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

◆ parseVideo()

bool PConfigParser::parseVideo ( PLatexObj parent,
PLatexObj textObj 
)
private

Parse a file inclusion.

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

Definition at line 406 of file PConfigParser.cpp.

406  {
407  if(!p_parser->isMatchToken("\\video")){return false;}
408  playTextLatexObj(parent, textObj);
410  char ch = p_parser->getCurrentCh();
411  PString prevToken(""), option("400");
412  prevToken += ch;
413  if(ch == '['){ //We skip the options for now
415  option = p_parser->getUntilKeyWithoutPatern("]");
416  prevToken += option;
417  ch = p_parser->getCurrentCh();
418  }
420  if(ch != '{'){
421  errorAt();
422  std::cerr << "PConfigParser::parseVideo : expect '{' after '"+prevToken+"' instead of '"<<ch<<"'" << std::endl;
423  stopParsing();
424  return true;
425  }
427  PPath fileName(p_parser->getUntilKeyWithoutPatern("}"));
428 
429  if(fileName.getExtension() != "mp4"){
430  errorAt();
431  std::cerr << "PConfigParser::parseVideo : use video '"<<fileName<<"' because the extension has to be '.mp4'" << std::endl;
432  stopParsing();
433  return true;
434  }
435 
436  PLatexObj tmp;
437  tmp.setText(option);
439 
440  PString buildFileName("");
441  if(!fileName.isSameBegining("http")){
442  PPath fileToBeUsed(getAbsoluteFileName(fileName));
443  if(fileToBeUsed.checkFileBegning("http")){ //If the file contains an url, we replace it by the url
444  buildFileName = fileToBeUsed.loadFileContent();
445  }else{ //Otherwise, we just copy the file
446  buildFileName = copyFile(PPath(LATEX_VIDEO_OUTPUT_DIR), fileName);
447  }
448  }else{
449  buildFileName = fileName;
450  }
451  if(buildFileName == ""){return true;}
452  tmp.setName(buildFileName);
453  addLatexObj(parent, tmp);
454  return true;
455 }
#define LATEX_VIDEO_OUTPUT_DIR
Definition: PLatexObj_def.h:12

References PGenericParser::addLatexObj(), PPath::checkFileBegning(), PGenericParser::copyFile(), PMultiFileParser::errorAt(), PGenericParser::getAbsoluteFileName(), PFileParser::getCurrentCh(), PPath::getExtension(), PFileParser::getNextChar(), PFileParser::getUntilKeyWithoutPatern(), PFileParser::isMatchToken(), PString::isSameBegining(), LATEX_VIDEO_OUTPUT_DIR, PPath::loadFileContent(), PMultiFileParser::p_parser, PARSER_SKIP_SPACE, PGenericParser::playTextLatexObj(), PLatexObj::setName(), PLatexObj::setText(), PLatexObj::setType(), PMultiFileParser::stopParsing(), and PLatexType::VIDEO.

Referenced by parseAllLatexObj().

+ 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 
)
protectedinherited

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.

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

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

Initialisation to be done just after loading a file.

Reimplemented from PMultiFileParser.

Definition at line 94 of file PConfigParser.cpp.

94  {
95 
96 }

◆ preLoadFile()

void PConfigParser::preLoadFile ( )
protectedvirtual

Initialisation to be done just before loading a file.

Reimplemented from PMultiFileParser.

Definition at line 85 of file PConfigParser.cpp.

85  {
86  //Save the current source
91 }

References PGenericParser::clearLatexObj(), PGenericParser::p_currentSource, PGenericParser::p_currentText, PMultiFileParser::p_parser, PFileParser::setSeparator(), and PFileParser::setWhiteSpace().

+ Here is the call graph for this function:

◆ saveCss()

bool PGenericParser::saveCss ( )
inherited

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 PGenericParser::p_cssContent, PGenericParser::p_vecExtraEnv, PGenericParser::p_vecExtraFunction, PPath::saveFileContent(), and select_css_theme().

+ Here is the call graph for this function:

◆ saveMapFile()

void PGenericParser::saveMapFile ( )
protectedinherited

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 PGenericParser::p_mapCopiedFile.

Referenced by ~PConfigParser().

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

◆ setDebugMode()

void PGenericParser::setDebugMode ( bool  isDebugMode)
inherited

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 PGenericParser::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(), PGenericParser::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:

◆ skipMonoParam()

bool PConfigParser::skipMonoParam ( const PString functionName)
private

Skip a mon parameter.

Parameters
functionName: name of the function to be parsed
Returns
true if the function has been found, false otherwise

Definition at line 1265 of file PConfigParser.cpp.

1265  {
1266  if(!p_parser->isMatchToken(functionName)){return false;}
1267  //Skip hook option
1269  //Skip brace content
1271  return true;
1272 }

References PGenericParser::getOptionStringBetweenBraces(), PGenericParser::getOptionStringBetweenHook(), PFileParser::isMatchToken(), and PMultiFileParser::p_parser.

Referenced by parseAllLatexObj().

+ 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
protectedinherited

Gitlab url of the current sources of the project.

Definition at line 156 of file PGenericParser.h.

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

◆ p_bookMail

PString PGenericParser::p_bookMail
protectedinherited

Mail to be used to contact authors in book mode.

Definition at line 160 of file PGenericParser.h.

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

◆ p_bookMainPageLink

PLatexObj PGenericParser::p_bookMainPageLink
protectedinherited

◆ p_bookMasterProjectUrl

PString PGenericParser::p_bookMasterProjectUrl
protectedinherited

◆ p_bookSideBarWidth

PString PGenericParser::p_bookSideBarWidth
protectedinherited

◆ p_cssContent

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

Css of all the configurations.

Definition at line 146 of file PGenericParser.h.

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

◆ p_currentSource

PLatexObj PGenericParser::p_currentSource
protectedinherited

◆ p_currentText

PLatexObj PGenericParser::p_currentText
protectedinherited

◆ 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_isAllowComment

bool PConfigParser::p_isAllowComment
private

True to allow comments.

Definition at line 85 of file PConfigParser.h.

Referenced by copyPConfigParser(), initialisationPConfigParser(), parseComment(), and parseEnvironementContent().

◆ p_isAllowMath

bool PConfigParser::p_isAllowMath
private

◆ p_isDebugMode

bool PGenericParser::p_isDebugMode
protectedinherited

◆ p_isEnableBookFeedback

bool PGenericParser::p_isEnableBookFeedback
protectedinherited

◆ 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(), loadInclude(), and PMultiFileParser::setFileContent().

◆ p_mapBiblioEntry

PMapBiblioEntry PGenericParser::p_mapBiblioEntry
protectedinherited

Map of all bibliography entries.

Definition at line 148 of file PGenericParser.h.

Referenced by PGenericParser::copyPGenericParser(), and PGenericParser::getMapBiblioEntry().

◆ p_mapCopiedFile

PMapFile PGenericParser::p_mapCopiedFile
protectedinherited

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

◆ p_run

◆ p_vecEnv

PVecLatexEnv PGenericParser::p_vecEnv
protectedinherited

Vector of all the environements.

Definition at line 112 of file PGenericParser.h.

Referenced by PGenericParser::copyPGenericParser().

◆ p_vecExtraEnv

◆ p_vecExtraFunction

PMapExtraEnv PGenericParser::p_vecExtraFunction
protectedinherited

◆ p_vecExtraParser

PVecParserEnv PGenericParser::p_vecExtraParser
protectedinherited

◆ p_vecFunc

PVecLatexFunc PGenericParser::p_vecFunc
protectedinherited

Vector of all the functions.

Definition at line 114 of file PGenericParser.h.

Referenced by PGenericParser::copyPGenericParser().

◆ p_vecIncludeDir

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

Vector of the include directories.

Definition at line 117 of file PGenericParser.h.

Referenced by PGenericParser::copyPGenericParser(), and PGenericParser::getVecIncludeDir().

◆ p_vecNameExtraEnv

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

Vector of the name of the extra environement.

Definition at line 120 of file PGenericParser.h.

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

◆ p_vecNameExtraFunction

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

Vector of the name of the extra function.

Definition at line 129 of file PGenericParser.h.

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

◆ p_vecNameExtraParser

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

Vector of the name of the extra environement.

Definition at line 134 of file PGenericParser.h.

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

◆ p_vecNameFunctionExtraEnv

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

Vector of the name of the extra environement.

Definition at line 122 of file PGenericParser.h.

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

◆ p_vecNameFunctionExtraParser

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

Vector of the function name of the extra environement.

Definition at line 136 of file PGenericParser.h.

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

◆ p_vecNameMarkdownExtraEnv

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

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

Definition at line 124 of file PGenericParser.h.

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

◆ p_vecNameMarkdownExtraParser

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

Vector of the markdown name of the extra environement.

Definition at line 138 of file PGenericParser.h.

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

◆ p_vecRemoveLatexKeyword

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

Vector of removed latex functions.

Definition at line 141 of file PGenericParser.h.

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

◆ p_vecSpeaker

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

Vector of all Speakers in the project.

Definition at line 166 of file PGenericParser.h.

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


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