Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
vite
Commits
c48efb2b
Commit
c48efb2b
authored
Feb 10, 2009
by
Johnny Jazeix
Browse files
Ajout de commentaires pour la doc et correction de quelques erreurs
parent
8b63c5e7
Changes
25
Hide whitespace changes
Inline
Side-by-side
Doxyfile
View file @
c48efb2b
...
...
@@ -25,7 +25,7 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = Vi
te
PROJECT_NAME = Vi
TE
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
...
...
@@ -513,7 +513,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = interface/src/ interface/tests/ parser/src/
s
tr
uctureDonnee/ values/
INPUT = interface/src/ interface/tests/ parser/src/ tr
ace/src/ values/ main.cpp
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
...
...
@@ -590,7 +590,7 @@ EXAMPLE_RECURSIVE = NO
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
IMAGE_PATH =
./
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
...
...
Makefile
View file @
c48efb2b
...
...
@@ -17,7 +17,7 @@ DIR_PARSER = parser
all
:
cd
interface/
&&
make
#
@(cd $(DIR_PARSER) && make)
@
(
cd
$(DIR_PARSER)
&&
make
)
@
echo
" "
@
echo
"Compilation completed! File created in 'bin' folder."
@
echo
" "
...
...
interface/src/resource.hpp
View file @
c48efb2b
/*!
*\file res
s
ource.hpp
*\file resource.hpp
*\brief This file gives some common header files for the interface classes.
*/
...
...
logo.png
0 → 100644
View file @
c48efb2b
11.1 KB
main.cpp
View file @
c48efb2b
/*!
*\file main.cpp
*\brief The main launcher.
/*!
* \mainpage ViTE
*
* \image html logo.png
* \image latex logo.png
*
* \file main.cpp
* \brief The main launcher.
*/
#include "interface_console.hpp"
...
...
parser/src/Definition.hpp
View file @
c48efb2b
...
...
@@ -41,13 +41,17 @@ public:
*/
Definition
();
/*!
* \fn Definition(std::string &eventname)
* \brief constructor
* \param eventname : the name of the new Definition
*/
Definition
(
std
::
string
&
eventname
);
/*!
* \brief : add a field to definition
* \param
:
name
* \param
:
value
* \param name
: the name of the event
* \param value
: the type of the event
*/
void
store
(
std
::
string
name
,
std
::
string
value
);
...
...
@@ -66,6 +70,11 @@ public:
*/
const
std
::
vector
<
field
>
&
get_fields
()
const
;
/*!
* \fn : get_event_name() const
* \return the string _event_name
*
*/
std
::
string
get_event_name
()
const
;
};
...
...
parser/src/ParserDefinitionDecoder.hpp
View file @
c48efb2b
...
...
@@ -40,13 +40,13 @@ public:
int
definitions_number
();
/*!
* \fn store_definition
* \fn store_definition
(Line &)
* \param : the line to store,
*/
void
store_definition
(
Line
&
);
/*!
* \fn get_definition
* \fn get_definition
(int i)
* \param : the integer matching the definition we want
* \return : the i-th definition
*/
...
...
@@ -59,19 +59,19 @@ public:
std
::
map
<
int
,
Definition
>
*
get_hash_table_of_definitions
();
/*!
* \fn enter_definition
* \fn enter_definition
(Line &line)
* \param : line
*/
void
enter_definition
(
Line
&
line
);
/*!
* \fn leave_definition
* \fn leave_definition
(Line&line)
* \param : line
*/
void
leave_definition
(
Line
&
line
);
/*!
* \fn add_field_to_definition
* \fn add_field_to_definition
(std::string& first_token, Line& line)
* \param : the name of the file to parse
* \param : the structure of data to fill
*/
...
...
parser/src/ParserEventDecoder.cpp
View file @
c48efb2b
...
...
@@ -15,7 +15,7 @@ ParserEventDecoder::ParserEventDecoder(){
}
void
ParserEventDecoder
::
store_event
(
const
Definition
&
definition
,
Line
&
line
,
Trace
&
trace
){
void
ParserEventDecoder
::
store_event
(
const
Definition
&
definition
,
Line
&
line
,
Trace
&
trace
){
String
alias
;
bool
alias_is_initialized
=
false
;
...
...
@@ -59,16 +59,16 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
String
key
;
bool
key_is_initialized
=
false
;
vector
<
Value
>
extra_fields
;
vector
<
Value
>
extra_fields
;
///// Il faut un vector de Value * -> Interface...
int
i
=
1
;
int
i
=
1
;
vector
<
field
>
fields
=
definition
.
get_fields
();
int
number_of_values
=
fields
.
size
();
while
(
i
<
number_of_values
)
{
string
current_value
;
if
(
!
line
.
item
(
i
,
current_value
))
{
if
(
!
line
.
item
(
i
,
current_value
))
{
cout
<<
"warning : missing values"
<<
endl
;
return
;
}
...
...
@@ -104,11 +104,11 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
fields
[
i
-
1
].
_name
==
"Time"
)
{
if
(
!
instantiate
(
current_value
,
time
_type
))
{
if
(
!
Date
::
instantiate
(
current_value
,
time
))
{
cout
<<
"warning : incompatible value"
<<
endl
;
return
;
}
time_
type_
is_initialized
=
true
;
time_is_initialized
=
true
;
}
else
if
(
fields
[
i
-
1
].
_name
==
"Type"
)
{
...
...
@@ -123,12 +123,12 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
else
if
(
fields
[
i
-
1
].
_name
==
"Value"
)
{
if
(
fields
[
i
-
1
].
_type
==
"double"
)
{
if
(
!
instantiate
(
current_value
,
value_double
))
{
if
(
!
Double
::
instantiate
(
current_value
,
value_double
))
{
cout
<<
"warning : incompatible value"
<<
endl
;
return
;
}
value_double_is_initialized
=
true
;
}
}
else
{
value_string
=
current_value
;
value_string_is_initialized
=
true
;
...
...
@@ -136,10 +136,7 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
fields
[
i
-
1
].
_name
==
"SourceContainer"
)
{
if
(
source_container
=
current_value
)
{
cout
<<
"warning : incompatible value"
<<
endl
;
return
;
}
source_container
=
current_value
;
source_container_is_initialized
=
true
;
}
...
...
@@ -155,21 +152,20 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
else
{
if
(
fields
[
i
-
1
].
_type
==
"string"
)
{
String
value
;
value
=
current_value
;
extra_fields
.
push_back
(
value
)
String
value
=
current_value
;
extra_fields
.
push_back
(
value
);
}
else
if
(
fields
[
i
-
1
].
_type
==
"double"
)
{
Double
value
;
if
(
!
instantiate
(
current_value
,
value
))
{
if
(
!
Double
::
instantiate
(
current_value
,
value
))
{
cout
<<
"warning : incompatible value"
<<
endl
;
return
;
}
extra_fields
.
push_back
(
value
)
extra_fields
.
push_back
(
value
)
;
}
else
if
(
fields
[
i
-
1
].
_type
==
"hex"
)
{
Hex
value
;
if
(
!
instantiate
(
current_value
,
value
))
{
if
(
!
Hex
::
instantiate
(
current_value
,
value
))
{
cout
<<
"warning : incompatible value"
<<
endl
;
return
;
}
...
...
@@ -177,23 +173,23 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
fields
[
i
-
1
].
_type
==
"date"
)
{
Date
value
;
if
(
!
instantiate
(
current_value
,
value
))
{
if
(
!
Date
::
instantiate
(
current_value
,
value
))
{
cout
<<
"warning : incompatible value"
<<
endl
;
return
;
}
extra_fields
.
push_back
(
value
);
extra_fields
.
push_back
(
value
);
}
else
if
(
fields
[
i
-
1
].
_type
==
"integer"
)
{
Integer
value
;
if
(
!
instantiate
(
current_value
,
value
))
{
if
(
!
Integer
::
instantiate
(
current_value
,
value
))
{
cout
<<
"warning : incompatible value"
<<
endl
;
return
;
}
extra_fields
.
push_back
(
value
)
extra_fields
.
push_back
(
value
)
;
}
else
if
(
fields
[
i
-
1
].
_type
==
"color"
)
{
Color
value
;
if
(
!
instantiate
(
current_value
,
value
))
{
if
(
!
Color
::
instantiate
(
current_value
,
value
))
{
cout
<<
"warning : incompatible value"
<<
endl
;
return
;
}
...
...
@@ -212,14 +208,32 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
cout
<<
"warning : extra value(s)"
<<
endl
;
}
//A faire : remplir un "Name alias_name" avec alias et name
//////A faire : remplir un "Name alias_name" avec alias et name
Name
alias_name
;
if
(
alias_is_initialized
&&
name_is_initialized
){
alias_name
=
Name
(
name
.
to_string
(),
alias
.
to_string
());
}
else
if
(
alias_is_initialized
&&
!
name_is_initialized
){
alias_name
=
Name
(
alias_only_t
(),
alias
.
to_string
());
}
else
if
(
!
alias_is_initialized
&&
name_is_initialized
){
alias_name
=
Name
(
name_only_t
(),
name
.
to_string
());
}
else
{
// One of the field should have been initialised
cerr
<<
"The event has no name and no alias."
<<
endl
;
return
;
}
string
event_name
=
definition
.
get_event_name
();
if
(
event_name
==
"PajeDefineContainerType"
)
{
if
(
alias_name_is_initialized
&&
container_type_is_initialized
)
{
if
(
// alias_name_is_initialized && //// On en a pas besoin car si c'est pas initialisé on le voit avant
container_type_is_initialized
)
{
trace
.
define_container_type
(
alias_name
,
container_type
,
extra_fields
);
}
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -227,9 +241,10 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
event_name
==
"PajeCreateContainer"
)
{
if
(
time_is_initialized
&&
alias_name_is_initialized
&&
type_is_initialized
&&
container_is_initialized
)
{
if
(
time_is_initialized
&&
// alias_name_is_initialized &&
type_is_initialized
&&
container_is_initialized
)
{
trace
.
create_container
(
time
,
alias_name
,
type
,
container
,
extra_fields
);
}
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -237,9 +252,10 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
event_name
==
"PajeDestroyContainer"
)
{
if
(
time_is_initialized
&&
alias_name_is_initialized
&&
type_is_initialized
)
{
if
(
time_is_initialized
&&
// alias_name_is_initialized &&
type_is_initialized
)
{
trace
.
destroy_container
(
time
,
alias_name
,
type
,
extra_fields
);
}
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -247,9 +263,10 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
event_name
==
"PajeDefineEventType"
)
{
if
(
alias_name_is_initialized
&&
container_type_is_initialized
)
{
if
(
// alias_name_is_initialized &&
container_type_is_initialized
)
{
trace
.
define_event_type
(
alias_name
,
container_type
,
extra_fields
);
}
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -257,9 +274,10 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
event_name
==
"PajeDefineStateType"
)
{
if
(
alias_name_is_initialized
&&
container_type_is_initialized
)
{
if
(
// alias_name_is_initialized &&
container_type_is_initialized
)
{
trace
.
define_state_type
(
alias_name
,
container_type
,
extra_fields
);
}
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -267,9 +285,10 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
event_name
==
"PajeDefineVariableType"
)
{
if
(
alias_name_is_initialized
&&
container_type_is_initialized
)
{
if
(
// alias_name_is_initialized &&
container_type_is_initialized
)
{
trace
.
define_variable_type
(
alias_name
,
container_type
,
extra_fields
);
}
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -277,9 +296,10 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
event_name
==
"PajeDefineLinkType"
)
{
if
(
alias_name_is_initialized
&&
container_type_is_initialized
&&
source_container_type_is_initialized
&&
dest_container_type_is_initialized
)
{
if
(
// alias_name_is_initialized &&
container_type_is_initialized
&&
source_container_type_is_initialized
&&
dest_container_type_is_initialized
)
{
trace
.
define_variable_type
(
alias_name
,
container_type
,
source_container_type
,
dest_container_type
,
extra_fields
);
}
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -287,9 +307,10 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
event_name
==
"PajeDefineEntityValue"
)
{
if
(
alias_name_is_initialized
&&
entity_type_is_initialized
)
{
if
(
// alias_name_is_initialized &&
entity_type_is_initialized
)
{
trace
.
define_variable_type
(
alias_name
,
entity_type
,
extra_fields
);
}
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -297,9 +318,10 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
else
if
(
event_name
==
"PajeSetState"
)
{
if
(
time_is_initialized
&&
type_is_initialized
&&
value_is_initialized
)
{
trace
.
define_variable_type
(
time
,
type
,
valueextra_fields
);
}
if
(
time_is_initialized
&&
type_is_initialized
// && value_is_initialized
)
{
trace
.
define_variable_type
(
time
,
type
,
extra_fields
);
}
else
{
cout
<<
"warning : incompatible evenement"
<<
endl
;
return
;
...
...
@@ -309,8 +331,8 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
//A faire : encore des type d'evenement a definir + chercher les parents et types des parents quand il le faut
else
{
cout
<<
"warning : unknown evenement"
<<
endl
;
return
;
cout
<<
"warning : unknown evenement"
<<
endl
;
return
;
}
}
parser/src/ParserEventDecoder.hpp
View file @
c48efb2b
...
...
@@ -12,7 +12,7 @@
#include "../../values/integer.hpp"
#include "../../values/name.hpp"
#include "../../values/string.hpp"
//
#include "../../
s
tr
uctureDonnee/t
race.hpp"
#include "../../tr
ace/src/T
race.hpp"
/**
* \class ParserEventDecoder
...
...
parser/src/ParserPaje.hpp
View file @
c48efb2b
...
...
@@ -17,7 +17,7 @@ class ParserPaje {
public:
/*!
* \fn parse(std::string filename)
* \fn parse(std::string filename
, Trace &trace
)
* \param : the name of the file to parse
* \param : the structure of data to fill
*/
...
...
parser/tests/makefile
View file @
c48efb2b
CC
=
g++
LD
=
g++
OBJ
=
../src/Line.o ../src/ParserDefinitionDecoder.o ../src/Definition.o ../src/TokenSource.o ../src/ParserPaje.o
OBJ
=
../src/Line.o ../src/ParserDefinitionDecoder.o ../src/Definition.o ../src/TokenSource.o
../src/ParserEventDecoder.o
../src/ParserPaje.o
OPT
=
-g
-Wall
-W
...
...
trace/src/ContainerType.cpp
View file @
c48efb2b
...
...
@@ -3,11 +3,11 @@
ContainerType
::
ContainerType
(
Name
&
name
,
ContainerType
*
parent
)
:
_name
(
name
),
_parent
(
parent
),
_children
()
{
_parent
->
_children
.
push_back
(
this
);
}
const
ContainerType
*
ContainerType
::
get_parent
()
const
{
return
_parent
;
}
const
list
<
ContainerType
*>
&
ContainerType
::
get_children
()
const
{
return
_children
;
}
...
...
trace/src/ContainerType.hpp
View file @
c48efb2b
#ifndef CONTAINERTYPE_HPP
#define CONTAINERTYPE_HPP
#ifndef CONTAINERTYPE_HPP
#define CONTAINERTYPE_HPP
#include <list>
using
std
::
list
;
#include "values/Name.hpp"
/*!
*
* \file containertype.hpp
* \author Clément Vuchener
* \brief Contains the definition of the class Container
* \date 2009 January 30th
*
*/
/*!
*
* \class ContainerType
* \brief describe the type of a container
*
*/
/*!
*
* \file containertype.hpp
* \author Clément Vuchener
* \brief Contains the definition of the class Container
* \date 2009 January 30th
*
*/
/*!
*
* \class ContainerType
* \brief describe the type of a container
*
*/
class
ContainerType
{
private:
Name
_name
;
ContainerType
*
_parent
;
list
<
ContainerType
*>
_children
;
public:
ContainerType
(
Name
&
name
,
ContainerType
*
parent
);
/*!
*
* \fn get_parent
* \brief Returns the parent container type
*
*/
const
ContainerType
*
get_parent
()
const
;
/*!
*
* \fn get_children
* \brief Returns the list of the child container types
*
*/
const
list
<
ContainerType
*>
&
get_children
()
const
;
};
#endif
public:
ContainerType
(
Name
&
name
,
ContainerType
*
parent
);
/*!
*
* \fn get_parent
* \brief Returns the parent container type
*
*/
const
ContainerType
*
get_parent
()
const
;
/*!
*
* \fn get_children
* \brief Returns the list of the child container types
*
*/
const
list
<
ContainerType
*>
&
get_children
()
const
;
};
#endif
trace/src/values/Color.cpp
View file @
c48efb2b
#include "color.hpp"
#include "Color.hpp"
Color
::
Color
()
{
_r
=
0
;
_g
=
0
;
_b
=
0
;
}
Color
::
Color
(
double
r
,
double
g
,
double
b
)
{
_r
=
r
;
...
...
trace/src/values/Color.hpp
View file @
c48efb2b
...
...
@@ -26,6 +26,13 @@ private :
double
_b
;
public:
/*!
*
* \brief Constructor
*
*/
Color
();
/*!
*
* \brief Constructor
...
...
trace/src/values/Date.cpp
View file @
c48efb2b
#include "
d
ate.hpp"
#include "
D
ate.hpp"
Date
::
Date
(){
...
...
trace/src/values/Double.cpp
View file @
c48efb2b
#include "
d
ouble.hpp"
#include "
D
ouble.hpp"
Double
::
Double
(){
...
...
trace/src/values/Hex.cpp
View file @
c48efb2b
#include "hex.hpp"
#include "Hex.hpp"
Hex
::
Hex
()
{
_value
=
0
;
}
Hex
::
Hex
(
int
n
)
{
_value
=
n
;
...
...
trace/src/values/Hex.hpp
View file @
c48efb2b
...
...
@@ -26,6 +26,13 @@ class Hex: public Value {
private:
int
_value
;
public:
/*!
*
* \brief Constructor
*
*/
Hex
();
/*!
*
* \brief Constructor
...
...
trace/src/values/Integer.cpp
View file @
c48efb2b
#include "integer.hpp"
#include "Integer.hpp"
Integer
::
Integer
()
{
_value
=
0
;
}
Integer
::
Integer
(
int
n
)
{
_value
=
n
;
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
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