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:408

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:156
void setName(const PString &name)
Sets the name of the PLatexObj.
Definition: PLatexObj.cpp:142
void setType(const PLatexType::PLatexType &type)
Sets the type of the PLatexObj.
Definition: PLatexObj.cpp:128
void setText(const PString &text)
Sets the text of the PLatexObj.
Definition: PLatexObj.cpp:135

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 838 of file PGenericParser.cpp.

838  {
839  if(fileName == ""){
840  std::cerr << "PGenericParser::copyFile : fileName is empty" << std::endl;
841  return PPath("");
842  }
843  PPath fileToBeCopied(getAbsoluteFileName(fileName));
844  if(fileToBeCopied == ""){ //If the fileName does not exists, it is relative to the current parsed file
845  std::cerr << "PGenericParser::copyFile : file '"<<fileName<<"' does not exists, even relative to the current parsed file that gives '"<<fileToBeCopied<<"'" << std::endl;
846  return PPath("");
847  }
848 
849  PString baseFileName(fileToBeCopied.getFileName());
850  PString linkDir(fileName.getParentDirectory().replace("../", ""));
851  PPath buildFileName(outputDir + PPath("/") + linkDir + PPath("/") + baseFileName);
852 
853  //Do we know the input file (did we already copy it)
854  PMapFile::iterator it(p_mapCopiedFile.find(fileName));
855  if(it != p_mapCopiedFile.end()){
856  //Let's check if the copied file still exists
857  if(buildFileName.isFileExist()){
858  //Ok, now let's get it's last modification time to be sure
859  time_t currentModifTime = fileToBeCopied.getFileModificationTime();
860  //Now let's check if it is the same one
861  if(currentModifTime == it->second && currentModifTime > 0){ //negative value is an error
862  //Ok, no need to copy, we already did it and the file if up to date
863  std::cout << "PGenericParser::copyFile : no need to copy file '"<<fileName<<"' already updated at time " << currentModifTime << std::endl;
864  return buildFileName;
865  }
866  }
867  }
868 
869  if(linkDir != ""){ //If there is other directories
870  if(!PPath(outputDir + "/" + linkDir).createDirectory()){
871  std::cerr << "PGenericParser::copyFile : cannot create directory '"<<(outputDir + "/" + linkDir)<<"'" << std::endl;
872  return PPath("");
873  }
874  }else{
875  if(!outputDir.createDirectory()){
876  std::cerr << "PGenericParser::copyFile : cannot create directory '"<<outputDir<<"'" << std::endl;
877  return PPath("");
878  }
879  }
880 
881  //Set the modification time
882  time_t lastModifTime = fileToBeCopied.getFileModificationTime();
883 
884  PString command("cp "+fileToBeCopied+" " + buildFileName);
885  if(system(command.c_str()) != 0){
886  errorAt();
887  std::cerr << "PGenericParser::copyFile : can't copy file '"<<fileToBeCopied<<"' into '"<<buildFileName<<"' directory" << std::endl;
888  stopParsing();
889  return PPath("");
890  }
891 // std::cout << "PGenericParser::copyFile : copy file '"<<fileToBeCopied<<"' at time " << lastModifTime << std::endl;
892  p_mapCopiedFile[fileToBeCopied] = lastModifTime;
893  return buildFileName;
894 }
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:267

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 821 of file PGenericParser.cpp.

821  {
822  PPath fileToBeCopied(fileName);
823  if(!fileToBeCopied.isFileExist()){ //If the fileName does not exists, it is relative to the current parsed file
824  fileToBeCopied = p_parser->getFileName().getParentDirectory() / fileName;
825  if(!fileToBeCopied.isFileExist()){ //Il the fileName still does not exists, we have to complain
826  std::cerr << "PGenericParser::getAbsoluteFileName : file '"<<fileName<<"' does not exists, even relative to the current parsed file that gives '"<<fileToBeCopied<<"'" << std::endl;
827  return PPath("");
828  }
829  }
830  return fileToBeCopied;
831 }
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:310

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 103 of file PConfigParser.cpp.

103  {
104  p_isAllowMath = true;
105  p_isAllowComment = true;
106 }

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 899 of file PGenericParser.cpp.

899  {
900  p_isDebugMode = false;
903 
904  PString installPrefix(CMAKE_INSTALL_PREFIX);
905  if(baseInstallPrefix != ""){
906  installPrefix = baseInstallPrefix;
907  }
908 
909  PPath dirExtraEnv(installPrefix+"/share/PhoenixTex2Html/ENVIRONEMENT");
910  loadDirExtraEnvironement(dirExtraEnv);
911 
912  PPath dirExtraFunction(installPrefix+"/share/PhoenixTex2Html/FUNCTION");
913  loadDirExtraFunction(dirExtraFunction);
914 
915  PPath dirExtraParser(installPrefix+"/share/PhoenixTex2Html/PARSER");
916  loadDirExtraParser(dirExtraParser);
917 
918  PPath dirCss(installPrefix+"/share/PhoenixTex2Html/STYLE");
919  loadCss(dirCss);
920 
921  p_vecRemoveLatexKeyword.push_back("\\toprule");
922  p_vecRemoveLatexKeyword.push_back("\\midrule");
923  p_vecRemoveLatexKeyword.push_back("\\bottomrule");
924  p_vecRemoveLatexKeyword.push_back("\\hline");
925  loadMapFile();
926 
927  p_bookSideBarWidth = "300px";
928  p_isEnableBookFeedback = false;
929 
930  p_bookMainPageLink.setType(PLatexType::NONE); //None by default, type will be updated on update
931 }
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 792 of file PGenericParser.cpp.

792  {
793  PListFile listInputFile = inputDir.getAllElementInDir();
794  if(listInputFile.size() == 0lu){
795  std::cerr << "PGenericParser::loadCss : can't read directory '"<<inputDir<<"'" << std::endl;
796  return;
797  }
798  for(PListFile::iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
799  PString styleName(it->getFileName().eraseExtension());
800  PPath tmpFile(inputDir / (*it));
801  p_cssContent[styleName] = tmpFile.loadFileContent();
802  }
803 }
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:270
void setName(const PString &name)
Sets the name of the PEnvironement.
Definition: PLatexObj.cpp:1080
void setCss(const PString &css)
Sets the css of the PEnvironement.
Definition: PLatexObj.cpp:1087
void setBalise(const PString &balise)
Sets the balise of the PEnvironement.
Definition: PLatexObj.cpp:1094
void setIsAllowComment(bool isAllowComment)
Sets the isAllowComment of the PEnvironement.
Definition: PLatexObj.cpp:1101
void setIsAlloxMath(bool isAlloxMath)
Sets the isAlloxMath of the PEnvironement.
Definition: PLatexObj.cpp:1108
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 778 of file PGenericParser.cpp.

778  {
779  PListFile listInputFile = inputDir.getAllElementInDir();
780  if(listInputFile.size() == 0lu){
781  std::cerr << "PGenericParser::loadDirExtraParser : can't read directory '"<<inputDir<<"'" << std::endl;
782  return;
783  }
784  for(PListFile::iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
785  loadDirExtraParserFile(inputDir / (*it));
786  }
787 }
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  PVecXml listDelimiter;
754  if(pxml_getVecChildIfExist(listDelimiter, *itBalise, "delimiter")){
755  for(PVecXml::iterator it(listDelimiter.begin()); it != listDelimiter.end(); ++it){
757  }
758  }
759 
760  PXml matchSequence;
761  if(pxml_getChildIfExist(matchSequence, *itBalise, "sequence")){
762  PParseSeq seq;
763  if(loadParserSeq(seq, matchSequence)){
764  tmp.setSeq(seq);
765  }else{
766  std::cerr << "PGenericParser::loadDirExtraParserFile : can't initialise sequence with balise in file '"<<inputFile<<"'" << std::endl;
767  }
768  }
769  parserEnv.getVecContext().push_back(tmp);
770  }
771  p_vecExtraParser.getVecEnv().push_back(parserEnv);
772  }
773 }
bool loadParserSeq(PParseSeq &seq, const PXml &xmlSeq)
Load a ParseSeq with a XML balise.
Context for parser environement.
Definition: PLatexObj.h:308
void setBegin(const PString &begin)
Sets the begin of the PContext.
Definition: PLatexObj.cpp:1238
void setNotBeforeBegin(const PString &notBeforeBegin)
Sets the notBeforeBegin of the PContext.
Definition: PLatexObj.cpp:1252
const std::vector< PString > & getVecDelimiter() const
Gets the vecDelimiter of the PContext.
Definition: PLatexObj.cpp:1392
void setSeq(const PParseSeq &seq)
Sets the seq of the PContext.
Definition: PLatexObj.cpp:1287
void setNotBeforeEnd(const PString &notBeforeEnd)
Sets the notBeforeEnd of the PContext.
Definition: PLatexObj.cpp:1266
const std::vector< PString > & getVecKeyword() const
Gets the vecKeyword of the PContext.
Definition: PLatexObj.cpp:1378
void setEnd(const PString &end)
Sets the end of the PContext.
Definition: PLatexObj.cpp:1245
void setNotAfterBegin(const PString &notAfterBegin)
Sets the notAfterBegin of the PContext.
Definition: PLatexObj.cpp:1259
void setName(const PString &name)
Sets the name of the PContext.
Definition: PLatexObj.cpp:1231
Parsing sequence.
Definition: PParseSeq.h:77
Parser environement.
Definition: PLatexObj.h:366
void setName(const PString &name)
Sets the name of the PParserEnv.
Definition: PLatexObj.cpp:1471
void setPlainText(const PString &plainText)
Sets the plainText of the PParserEnv.
Definition: PLatexObj.cpp:1478
const std::vector< PContext > & getVecContext() const
Gets the vecContext of the PParserEnv.
Definition: PLatexObj.cpp:1520
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:1582
PString convertBackSlahedStr(const PString &str)
Convert all the echaped char.

References convertBackSlahedStr(), PPath::eraseExtension(), PPath::getFileName(), PXmlAttr::getValue(), PXml::getVecChild(), PParserEnv::getVecContext(), PContext::getVecDelimiter(), 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 114 of file PConfigParser.cpp.

114  {
115  if(fileName == "") return false;
116  PPath fileToBeUsed(fileName);
117  bool removeTmpFilename(false);
118  if(fileName.isSameBegining("http")){
119  if(!wgetFile(fileName)){
120  errorAt();
121  std::cerr << "PConfigParser::loadInclude : cannot get file with url = '"<<fileName<<"'" << std::endl;
122  return true;
123  }
124  fileToBeUsed = fileName.getFileName();
125  removeTmpFilename = true;
126  }
127 
128  PString fileExtension(fileToBeUsed.getExtension());
129  if(fileExtension == "md"){
130  PMarkdownParser mdParser(*this);
131 
132  bool b = mdParser.load(fileToBeUsed);
133  if(!b){return b;}
134  PLatexObj & mainLatexObj = mdParser.getSource();
135  std::vector<PLatexObj> & vecObj = mainLatexObj.getVecContent();
136  for(std::vector<PLatexObj>::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
137  addLatexObj(parent, *it);
138  }
139  copyPGenericParser(mdParser);
140  return b;
141  }
142 
143  PFileParser parser;
144  p_listFileParser.push_back(parser);
146  p_parser = &p_listFileParser.back();
147  if(!p_parser->open(fileToBeUsed)){
148  std::cerr << "PMultiFileParser::load : can't open file '" << fileToBeUsed << "'" << std::endl;
149  return false;
150  }
151  p_parser->setWhiteSpace("");
152  p_parser->setSeparator("");
153  while(!p_parser->isEndOfFile() && p_run){
154  long unsigned int currentPos = p_parser->getCurrentCharIdx();
155  if(parseAllLatexObj(parent, textObj)){}
156  else{
157  incrementCurrentChar(textObj);
158  }
159 
160  if(currentPos == p_parser->getCurrentCharIdx() && !p_parser->isEndOfFile()){
161  std::cerr << "PMultiFileParser::load : the parser is stucked at the position :" << std::endl << "\t" << p_parser->getLocation() << std::endl;
162  p_run = false;
163  }
164  }
165  if(p_run) playTextLatexObj(parent, textObj);
166  p_listFileParser.pop_back();
167  if(p_listFileParser.size() > 0lu) p_parser = &p_listFileParser.back();
168  else p_parser = NULL;
169  if(removeTmpFilename){
170  remove(fileToBeUsed.c_str());
171  }
172  return p_run;
173 }
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:38
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:369

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 806 of file PGenericParser.cpp.

806  {
807  PString fileName(COPIED_RECOVER_FILE);
808  if(!data_load(fileName, p_mapCopiedFile)){return;}
809 }
#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 754 of file PConfigParser.cpp.

754  {
755  if(!p_parser->isMatchToken("\\addspeakers")){return false;}
756  playTextLatexObj(parent, textObj);
757  PPath speakerConfig = getOptionStringBetweenBraces();
758  PPath speakerFile = p_parser->getFileName().getParentDirectory() / speakerConfig;
759 
760  if(!ptimetable_loadSpeaker(p_vecSpeaker, speakerFile)){
761  errorAt();
762  std::cerr << "PConfigParser::parseTimeTable : cannot parse speakers configuration '"+speakerFile+"'" << std::endl;
763  stopParsing();
764  return true;
765  }
766 
767  return true;
768 }
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 202 of file PConfigParser.cpp.

202  {
203  if(p_parser->isMatch("{")){}
204  else if(p_parser->isMatch("}")){}
205  else if(skipMonoParam("\\minitoc")){}
206  else if(skipMonoParam("\\newpage")){}
207  else if(skipMonoParam("\\centering")){}
208  else if(skipMonoParam("\\def\\sgn")){}
209  else if(skipMonoParam("\\,")){}
210  else if(parsePercent(parent, textObj)){}
211  else if(p_parser->isMatch(p_vecRemoveLatexKeyword) != ""){}
212  else if(parseSpaceParagraphe(parent, textObj)){}
213  else if(parseNewLine(parent, textObj)){}
214  else if(parseRealNewLine(parent, textObj)){}
215  else if(parseDots(parent, textObj)){}
216 
217  else if(parseMonoParam(parent, textObj, "\\url", PLatexType::URL)){}
218  else if(parseGenericLatexObj(parent, textObj)){}
219  else if(parseComplexMonoParam(parent, textObj, "\\footnote", PLatexType::FOOTNOTE)){}
220  else if(parseComplexMonoParam(parent, textObj, "\\caption", PLatexType::CAPTION)){}
221 
222  else if(parseComplexMonoParam(parent, textObj, "\\wip", PLatexType::WORK_IN_PROGRESS)){}
223  else if(parseComplexMonoParam(parent, textObj, "\\workinprogress", PLatexType::WORK_IN_PROGRESS)){}
224  else if(parserDetails(parent, textObj)){}
225  else if(parserQuote(parent, textObj)){}
226  else if(parseComment(parent, textObj)){}
227  else if(parseDebug(parent, textObj)){}
228  else if(parseHref(parent, textObj)){}
229  else if(parseIncludeGraphic(parent, textObj)){}
230  else if(parseAddSpeaker(parent, textObj)){}
231  else if(parseSaveSpeaker(parent, textObj)){}
232  else if(parseTimeTable(parent, textObj)){}
233 
234  else if(parseSectionTitle(parent, textObj, "\\part*", PLatexType::PARTSTAR)){}
235  else if(parseSectionTitle(parent, textObj, "\\chapter*", PLatexType::CHAPTERSTAR)){}
236  else if(parseSectionTitle(parent, textObj, "\\section*", PLatexType::SECTIONSTAR)){}
237  else if(parseSectionTitle(parent, textObj, "\\subsection*", PLatexType::SUBSECTIONSTAR)){}
238  else if(parseSectionTitle(parent, textObj, "\\subsubsection*", PLatexType::SUBSUBSECTIONSTAR)){}
239 
240  else if(parseSectionTitle(parent, textObj, "\\part", PLatexType::PART)){}
241  else if(parseSectionTitle(parent, textObj, "\\chapter", PLatexType::CHAPTER)){}
242  else if(parseSectionTitle(parent, textObj, "\\section", PLatexType::SECTION)){}
243  else if(parseSectionTitle(parent, textObj, "\\subsection", PLatexType::SUBSECTION)){}
244  else if(parseSectionTitle(parent, textObj, "\\subsubsection", PLatexType::SUBSUBSECTION)){}
245 
246  else if(parseSectionTitle(parent, textObj, "\\bookpartseparator", PLatexType::BOOKPARTSEPARATOR)){}
247 
248  else if(parseEnvStringOnly(parent, textObj, "displaymath", PLatexType::DISPLAYMATH)){}
249  else if(parseEnvStringOnly(parent, textObj, "equation", PLatexType::DISPLAYMATH)){}
250  else if(parseEnvStringOnly(parent, textObj, "equation*", PLatexType::DISPLAYMATH)){}
251  else if(parseEnvStringOnly(parent, textObj, "eqnarray", PLatexType::EQNARRAY)){}
252  else if(parseEnvStringOnly(parent, textObj, "align*", PLatexType::EQNARRAY)){}
253  else if(parseDoubleInlineMath(parent, textObj)){}
254  else if(parseInlineMath(parent, textObj)){}
255 
256  else if(parseEnvironement(parent, textObj, "paragraph", PLatexType::PARAGRAPHE)){}
257  else if(parseEnvironement(parent, textObj, "center", PLatexType::CENTER)){}
258  else if(parseEnvironement(parent, textObj, "columns", PLatexType::COLUMNS)){}
259  else if(parseEnvironement(parent, textObj, "column", PLatexType::COLUMN)){}
260 
261  else if(parseEnvironement(parent, textObj, "figure", PLatexType::FIGURE)){}
262  else if(parseEnvironement(parent, textObj, "wrapfigure", PLatexType::FIGURE)){}
263  else if(parseEnvironement(parent, textObj, "table", PLatexType::TABLE)){}
264  else if(parseTabular(parent, textObj)){}
265  else if(parseEnvironement(parent, textObj, "itemize", PLatexType::ITEMIZE)){}
266  else if(parseEnvironement(parent, textObj, "enumerate", PLatexType::ENUMERATE)){}
267  else if(parseItem(parent, textObj)){}
268 
269  else if(parserCallDot(parent, textObj)){}
270  else if(parserSvgToPng(parent, textObj)){}
271 
272  else if(parseExtraEnvironement(parent, textObj)){}
273  else if(parseExtraEnvironementFunction(parent, textObj)){}
274  else if(parseExtraFunction(parent, textObj)){}
275  else if(parseParserLanguage(parent, textObj)){}
276  else if(parseParserLanguageFunction(parent, textObj)){}
277 
278  else if(parseIncludeFile(parent, textObj)){}
279  else if(parseInputFile(parent, textObj)){} //An other non sens of latex
280  else if(parseVideo(parent, textObj)){}
281  else if(parseBookMainPageLink(parent, textObj)){}
282  else{
283  return false;
284  }
285  return true;
286 }
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:599

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 293 of file PConfigParser.cpp.

293  {
294  PLatexObj tmpParent;
295  if(parseComplexMonoParam(tmpParent, textObj, "\\bookMainPageLink", PLatexType::BOOKMAINPAGELINK)){
296  if(tmpParent.getVecContent().size() != 0lu){
297  p_bookMainPageLink = tmpParent.getVecContent().back();
298  std::cout << "PConfigParser::parseBookMainPageLink : Update main page link (nb element = "<<tmpParent.getVecContent().size()<<")" << std::endl;
299  }
300  return true;
301  }else{
302  return false;
303  }
304 }
@ 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 579 of file PConfigParser.cpp.

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

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 182 of file PConfigParser.cpp.

182  {
183  if(!p_parser->isMatchToken(functionName)){return false;}
184  playTextLatexObj(parent, textObj);
185  PLatexObj tmp;
186  tmp.setType(type);
187 
188  PString textOption(getOptionStringBetweenHook());
189  tmp.setText(textOption);
190 
191  parseVecLatexObj(tmp, textObj, "{", "}");
192 
193  addLatexObj(parent, tmp);
194  return true;
195 }
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 596 of file PConfigParser.cpp.

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

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 355 of file PConfigParser.cpp.

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

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 972 of file PConfigParser.cpp.

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

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 827 of file PConfigParser.cpp.

827  {
828  std::vector<PString> vecPatern(getBeginSeqEnv(environementName));
829  if(!p_parser->isMatchSeq(vecPatern)){return false;}
830  return parseEnvironementContent(parent, textObj, environementName, type, true, true, "div");
831 }
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 843 of file PConfigParser.cpp.

845 {
846  playTextLatexObj(parent, textObj);
847  PLatexObj env;
848  env.setType(type);
849  env.setName(environementName);
850  env.setBalise(envBalise);
851  PLatexObj tmpText;
852  tmpText.setType(PLatexType::TEXT);
853  std::vector<PString> vecPatern(getEndSeqEnv(environementName));
854 
855  bool saveIsAllowComment(p_isAllowComment), saveIsAllowMath(p_isAllowMath);
856  p_isAllowComment = isAllowComment;
857  p_isAllowMath = isAllowMath;
858  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPatern) && p_run){
859  if(parseAllLatexObj(env, tmpText)){}
860  else{
861  incrementCurrentChar(tmpText);
862  }
863  }
864  p_isAllowComment = saveIsAllowComment;
865  p_isAllowMath = saveIsAllowMath;
866 
867  playTextLatexObj(env, tmpText);
868  addLatexObj(parent, env);
869  return true;
870 }
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:170

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 930 of file PConfigParser.cpp.

930  {
932  if(!p_parser->isMatchToken("\\begin")){return false;}
933  PString envName(getStringBetweenBraces("\\begin").eraseFirstLastChar(" \t\n"));
934  if(environementName != envName){
936  return false;
937  }
938  playTextLatexObj(parent, textObj);
939  PString envContent(p_parser->getUntilKeyWithoutPatern("\\end{"+environementName+"}"));
940 
941  PLatexObj tmp;
942  tmp.setType(type);
943  tmp.setText(envContent);
944 
945  addLatexObj(parent, tmp);
946  return true;
947 }
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 1142 of file PConfigParser.cpp.

1142  {
1143  if(p_vecNameExtraEnv.size() == 0lu){return false;}
1145  if(!p_parser->isMatch("\\begin")){return false;}
1147  char ch = p_parser->getCurrentCh();
1148  if(ch != '{'){
1149  errorAt();
1150  std::cerr << "PConfigParser::parseExtraEnvironement : expect '{' after '\\begin' instead of '"<<ch<<"'" << std::endl;
1151  stopParsing();
1152  return true;
1153  }
1154  p_parser->getNextChar();
1156  if(matchEnv == ""){
1157  p_parser->popPosition();
1158  return false;
1159  }
1161  ch = p_parser->getCurrentCh();
1162  if(ch != '}'){
1163  errorAt();
1164  std::cerr << "PConfigParser::parseExtraEnvironement : expect '}' after '\\begin{matchEnv' instead of '"<<ch<<"'" << std::endl;
1165  stopParsing();
1166  return true;
1167  }
1168  p_parser->getNextChar();
1169  return parseExtraEnvironementContent(parent, textObj, matchEnv, PLatexType::ENVIRONEMENT);
1170 }
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 1179 of file PConfigParser.cpp.

1179  {
1180  PEnvironement & configEnv = p_vecExtraEnv[environementName];
1181  return parseEnvironementContent(parent, textObj, environementName,
1182  type, configEnv.getIsAllowComment(), configEnv.getIsAlloxMath(), configEnv.getBalise());
1183 }
bool getIsAllowComment() const
Gets the isAllowComment of the PEnvironement.
Definition: PLatexObj.cpp:1157
bool getIsAlloxMath() const
Gets the isAlloxMath of the PEnvironement.
Definition: PLatexObj.cpp:1171
const PString & getBalise() const
Gets the balise of the PEnvironement.
Definition: PLatexObj.cpp:1143

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 1191 of file PConfigParser.cpp.

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

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 1236 of file PConfigParser.cpp.

1236  {
1237  if(p_vecNameExtraFunction.size() == 0lu){return false;}
1240  if(matchFunc == ""){
1241  p_parser->popPosition();
1242  return false;
1243  }
1244  if(!isMatchRewind("{")){
1245  p_parser->popPosition(); //This is not the expected environement
1246  return false;
1247  }
1248  playTextLatexObj(parent, textObj);
1249  PLatexObj tmp;
1251  PString matchEnv(matchFunc.eraseChar('\\'));
1252  tmp.setName(matchEnv);
1253 
1254  PEnvironement & configEnv = p_vecExtraFunction[matchEnv];
1255  tmp.setBalise(configEnv.getBalise());
1256 
1257  parseVecLatexObj(tmp, textObj, "{", "}");
1258 
1259  addLatexObj(parent, tmp);
1260  return true;
1261 }
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;
66  p_parser->setEscapeChar('\0');
70  p_currentSource.setLink("index.html");
72 
73  //To parse the file we need to read char by char until we get something we know
74  while(!p_parser->isEndOfFile() && p_run){ //If we are not at the end of the file
76  else{
78  }
79  }
81 
82  return true;
83 }
void setEscapeChar(char escapeChar)
Sets the escape character of the PFileParser.
Definition: PFileParser.cpp:58
void setLink(const PString &link)
Sets the link of the PLatexObj.
Definition: PLatexObj.cpp:163
void setSourceFile(const PString &sourceFile)
Sets the sourceFile of the PLatexObj.
Definition: PLatexObj.cpp:247
void setSourceLine(size_t sourceLine)
Sets the sourceLine of the PLatexObj.
Definition: PLatexObj.cpp:254
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(), PFileParser::setEscapeChar(), 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 614 of file PConfigParser.cpp.

614  {
615  if(!p_parser->isMatchToken("\\href")){return false;}
616  playTextLatexObj(parent, textObj);
617  PLatexObj tmp;
619  PString link(getStringBetweenBraces("\\href"));
620  tmp.setName(link);
621 
622  parseVecLatexObj(tmp, textObj, "{", "}");
623  if(!tmp.getName().isSameBegining("http") && !tmp.getName().isSameBegining("https")){
624  PPath buildFileName(copyFile(PPath(LATEX_RESSOURCES_OUTPUT_DIR), link));
625  if(buildFileName == ""){
626  if(PPath(tmp.getName()).getExtension() != "html"){
627  errorAt();
628  std::cerr << "PConfigParser::parseHref : cannot copy file '"<<link<<"' in '" LATEX_RESSOURCES_OUTPUT_DIR "'" << std::endl;
629  return true;
630  }
631  buildFileName = link;
632  }
633  tmp.setName(buildFileName);
634  }
635  addLatexObj(parent, tmp);
636  return true;
637 }
#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:324
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 370 of file PConfigParser.cpp.

370  {
371  if(!p_parser->isMatchToken("\\include")){return false;}
372  playTextLatexObj(parent, textObj);
373  PString fileName(getStringBetweenBraces("\\include"));
374 
375  PPath fileToBeLoaded(fileName);
376  if(fileToBeLoaded.size() != 0lu){
377  if(fileToBeLoaded[0] != '/'){
378  fileToBeLoaded = p_parser->getFileName().getParentDirectory() / fileToBeLoaded;
379  }
380  }
381  return loadInclude(parent, textObj, fileToBeLoaded);
382 }
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 710 of file PConfigParser.cpp.

710  {
711  if(!p_parser->isMatchToken("\\includegraphics")){return false;}
712  playTextLatexObj(parent, textObj);
714  char ch = p_parser->getCurrentCh();
715  PString prevToken(""),option("");
716  prevToken += ch;
717  if(ch == '['){ //We skip the options for now
719  option = p_parser->getUntilKeyWithoutPatern("]");
720  prevToken += option;
721  ch = p_parser->getCurrentCh();
722  }
724  if(ch != '{'){
725  errorAt();
726  std::cerr << "PConfigParser::parseIncludeGraphic : expect '{' after '"+prevToken+"' instead of '"<<ch<<"'" << std::endl;
727  stopParsing();
728  return "";
729  }
731  PString imageFile(p_parser->getUntilKeyWithoutPatern("}"));
732  PLatexObj tmp;
734 
735  PString buildFileName("");
736  if(!imageFile.isSameBegining("http")){
737  buildFileName = copyFile(PPath(LATEX_IMAGE_OUTPUT_DIR), imageFile);
738  }else{
739  buildFileName = imageFile;
740  }
741  if(buildFileName == ""){return true;}
742  tmp.setName(buildFileName);
743  tmp.setText(option);
744 
745  addLatexObj(parent, tmp);
746  return true;
747 }
#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 954 of file PConfigParser.cpp.

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

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 389 of file PConfigParser.cpp.

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

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 1001 of file PConfigParser.cpp.

1001  {
1002  if(!p_parser->isMatch("\\item")){return false;}
1003  playTextLatexObj(parent, textObj);
1004 
1005  PLatexObj env;
1007 
1008  PLatexObj tmpText;
1009  tmpText.setType(PLatexType::TEXT);
1010 
1011  std::vector<PString> vecPaternItemize;
1012  vecPaternItemize.push_back("\\end");
1013  vecPaternItemize.push_back("{");
1014  vecPaternItemize.push_back("itemize");
1015  vecPaternItemize.push_back("}");
1016 
1017  std::vector<PString> vecPaternEnumerate;
1018  vecPaternEnumerate.push_back("\\end");
1019  vecPaternEnumerate.push_back("{");
1020  vecPaternEnumerate.push_back("enumerate");
1021  vecPaternEnumerate.push_back("}");
1022 
1023  while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPaternItemize, true) &&
1024  !p_parser->isMatchSeq(vecPaternEnumerate, true) &&
1025  !parseStringAndGoBack("\\item") && p_run)
1026  {
1027  if(parseAllLatexObj(env, tmpText)){}
1028  else{
1029  incrementCurrentChar(tmpText);
1030  }
1031  }
1032  playTextLatexObj(env, tmpText);
1033 
1034  addLatexObj(parent, env);
1035 
1036 
1037  return true;
1038 }
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:233

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:240

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:149

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 327 of file PConfigParser.cpp.

327  {
328  if(!p_parser->isMatch("\n\n")){return false;}
329  playTextLatexObj(parent, textObj);
330  PLatexObj tmp;
332  addLatexObj(parent, tmp);
333  return true;
334 }
@ 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 1045 of file PConfigParser.cpp.

1045  {
1046  if(p_vecNameExtraParser.size() == 0lu){return false;}
1048  if(!p_parser->isMatchToken("\\begin")){return false;}
1050  char ch = p_parser->getCurrentCh();
1051  if(ch != '{'){
1052  p_parser->popPosition(); //This is not the expected environement
1053  return false;
1054  }
1055  p_parser->getNextChar();
1057  if(matchEnv == ""){
1058  p_parser->popPosition();
1059  return false;
1060  }
1062  ch = p_parser->getCurrentCh();
1063  if(ch != '}'){
1064  p_parser->popPosition(); //This is not the expected environement
1065  return false;
1066  }
1067  p_parser->getNextChar();
1068  playTextLatexObj(parent, textObj);
1069  PLatexObj tmp;
1071  tmp.setName(matchEnv);
1072 
1073  PParserEnv parser(getParserEnv(p_vecExtraParser, matchEnv));
1074  char saveEscapeChar = p_parser->getEscapeChar();
1075  p_parser->setEscapeChar('\0');
1076  PString inputFileContent(p_parser->getUntilKeyWithoutPatern("\\end{"+matchEnv+"}").eraseFirstLastChar(" \n") + "\n");
1077  p_parser->setEscapeChar(saveEscapeChar);
1078  tmp.setNbline(inputFileContent.count('\n'));
1079 
1080  PString envContent(parser_makeHighlighting(inputFileContent, parser));
1081  tmp.setText(envContent);
1082 
1083  addLatexObj(parent, tmp);
1084  return true;
1085 }
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:191
PString eraseFirstLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:623
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 1092 of file PConfigParser.cpp.

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

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 644 of file PConfigParser.cpp.

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

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 542 of file PConfigParser.cpp.

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

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 464 of file PConfigParser.cpp.

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

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 341 of file PConfigParser.cpp.

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

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 500 of file PConfigParser.cpp.

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

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 561 of file PConfigParser.cpp.

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

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 775 of file PConfigParser.cpp.

775  {
776  if(!p_parser->isMatchToken("\\savespeakers")){return false;}
777  playTextLatexObj(parent, textObj);
779 
780  pspeaker_tex(parent.getVecContent(), p_vecSpeaker, "sec_full_speakers");
781  return true;
782 }
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 660 of file PConfigParser.cpp.

660  {
661  if(!p_parser->isMatchToken(functionName)){return false;}
662  playTextLatexObj(parent, textObj);
663  PLatexObj tmp;
664  tmp.setType(type);
667 
668  PString textOption(getOptionStringBetweenHook());
669  tmp.setText(textOption);
670  PLatexObj objTitle;
671  parseVecLatexObj(objTitle, textObj, "{", "}");
672  tmp.setComplexTitle(objTitle.getVecContent());
673  addLatexObj(parent, tmp);
674  return true;
675 }
void setComplexTitle(const std::vector< PLatexObj > &complexTitle)
Sets the complexTitle of the PLatexObj.
Definition: PLatexObj.cpp:177
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 312 of file PConfigParser.cpp.

312  {
313  if(!isMatch("\\spaceparagraphe")){return false;}
314  playTextLatexObj(parent, textObj);
316  PLatexObj tmp;
318  addLatexObj(parent, tmp);
319  return true;
320 }
@ 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 989 of file PConfigParser.cpp.

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

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 877 of file PConfigParser.cpp.

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

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 789 of file PConfigParser.cpp.

789  {
790  if(!p_parser->isMatchToken("\\timetable")){return false;}
791  playTextLatexObj(parent, textObj);
792  PPath timetableConfig = getOptionStringBetweenBraces();
793  PPath timeTableFile = p_parser->getFileName().getParentDirectory() / timetableConfig;
794  //We have to try to load speakers in some are defined in the timetable configuration
795  //But we need also to add \addspeakers function to update a map of speakers in the PGenericParser
796 
797  //Load the timetable toml config
798  PTimeTable timetable;
799  bool isAlreadyDefinedSpeaker = p_vecSpeaker.size() != 0lu;
800  if(isAlreadyDefinedSpeaker){
801  timetable.setVecSpeaker(p_vecSpeaker);
802  }
803  if(!ptimetable_load(timetable, timeTableFile)){
804  errorAt();
805  std::cerr << "PConfigParser::parseTimeTable : cannot parse timetable configuration '"+timeTableFile+"'" << std::endl;
806  stopParsing();
807  return true;
808  }
809  //Update begin and end time of blocks
810  ptimetable_updateEndTime(timetable);
811  //Create the HTML PLatexObj
812  if(!ptimetable_tex(parent.getVecContent(), timetable, PPath(LATEX_INVITATION_OUTPUT_DIR), !isAlreadyDefinedSpeaker)){
813  errorAt();
814  std::cerr << "PConfigParser::parseTimeTable : cannot save timetable '"+timeTableFile+"'" << std::endl;
815  stopParsing();
816  }
817  return true;
818 }
#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 683 of file PConfigParser.cpp.

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

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 408 of file PConfigParser.cpp.

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

96  {
97 
98 }

◆ preLoadFile()

void PConfigParser::preLoadFile ( )
protectedvirtual

Initialisation to be done just before loading a file.

Reimplemented from PMultiFileParser.

Definition at line 86 of file PConfigParser.cpp.

86  {
87  //Save the current source
90  p_parser->setEscapeChar('\0');
93 }

References PGenericParser::clearLatexObj(), PGenericParser::p_currentSource, PGenericParser::p_currentText, PMultiFileParser::p_parser, PFileParser::setEscapeChar(), 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:99
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 812 of file PGenericParser.cpp.

812  {
813  PString fileName(COPIED_RECOVER_FILE);
814  if(!data_save(fileName, p_mapCopiedFile)){return;}
815 }
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 1267 of file PConfigParser.cpp.

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

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: