Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
vite
Commits
925fd2bf
Commit
925fd2bf
authored
Jan 30, 2009
by
Pascal Noisette
Browse files
principe du parserevent
parent
16d89cdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
parser/src/algorithmeEventParser.cpp
0 → 100644
View file @
925fd2bf
#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
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment