PhoenixGenerator  2.0.4
Set of tools to generate code
Loading...
Searching...
No Matches
parserClassConfig.h File Reference
#include "PFileParser.h"
#include "PClassConfig.h"
+ Include dependency graph for parserClassConfig.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool parserClassConfig (std::vector< PClassConfig > &listClassConfig, PVecPath &listInclude, const PPath &fileName)
 Parser list class config.
 

Function Documentation

◆ parserClassConfig()

bool parserClassConfig ( std::vector< PClassConfig > & listClassConfig,
PVecPath & listInclude,
const PPath & fileName )

Parser list class config.

Parameters
[out]listClassConfig: list of class config
listInclude: list of include
fileName: file name of the config
Returns
true on success, false otherwise

Definition at line 214 of file parserClassConfig.cpp.

214 {
215 if(fileName == "") return false;
216 PFileParser parser;
217 parser.setWhiteSpace(" \t\n");
218 parser.setSeparator("{};/*");
219 if(!parser.open(fileName)) return false;
220 PString currentComment("");
221 PVecString listTemplate;
222 while(!parser.isEndOfFile()){
223 if(parser.isMatch("#")){
224 if(parser.isMatch("include")){
225 listInclude.push_back(parser.getUntilKeyWithoutPatern("\n").eraseChar(" \t\n"));
226 }
227 }else if(updateCurrentComment(parser, currentComment)){}
228 else if(updateCurrentTemplate(parser, listTemplate)){}
229 else if(parseEnumConfig(listClassConfig, parser, currentComment)){}
230 else{ //Si ce n'est pas un séparateur, c'est que l'on a trouvé un nom, de PClassConfig
231 if(!parsePClassConfig(listClassConfig, parser, currentComment, listTemplate)){
232 errorUnexpectedToken(parser, parser.getNextToken());
233 return false;
234 }
235 }
236 parser.skipWhiteSpace();
237 }
238 return true;
239}
bool updateCurrentComment(PFileParser &parser, PString &currentComment)
Fonction qui met à jour un commentaire.
bool parseEnumConfig(std::vector< PClassConfig > &listClassConfig, PFileParser &parser, PString &currentComment)
Parse an enum definition.
bool parsePClassConfig(std::vector< PClassConfig > &listClassConfig, PFileParser &parser, PString &currentComment, PVecString &listTemplate)
Parse a PClassConfig.
bool updateCurrentTemplate(PFileParser &parser, PVecString &currentTemplate)
Update a template definition.
void errorUnexpectedToken(const PFileParser &parser, const PString &token)
Affiche une erreur de token non attendu.

References errorUnexpectedToken(), parseEnumConfig(), parsePClassConfig(), updateCurrentComment(), and updateCurrentTemplate().

Referenced by simple_project_load_config().

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