Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 925fd2bf authored by Pascal Noisette's avatar Pascal Noisette
Browse files

principe du parserevent

parent 16d89cdf
Branches
Tags
No related merge requests found
#algorithme pour convertion
convertir(String type, String valeur) : Type
{
if (type=="int")
return new Integer(valeur)
else if (type=="String")
return new Str(valeur)
else if (type=="Color")
return new Color(valeur)
}
#algorithme pour EventParser
E : Hash des evenements (constuit dans le parserDef), ligne
S : Trace
Event & e = Hash(atoi(liretoken(ligne)))
if (e.name = "PajedefineContainer" )
{
int i = 0;
String token;
Map facultatif<int, Type>;
while (token = liretoken(ligne))
{
String typeattendu = e.vector[i].type;
String champattendu = e.vector[i].champ;
i++;
if (champattendu=="name")
{
String parametre1 = token;
}
else if (champattendu=="couleur")
{
Couleur parametre2(typeattendu,token);
}
else //facultatif
{
facultatif += convertir(typeattendu,token);
}
}
trace.storePajedefineContainer(parametre1,parametre2,facultatif);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment