Commit c48efb2b authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Ajout de commentaires pour la doc et correction de quelques erreurs

parent 8b63c5e7
......@@ -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 = Vite
PROJECT_NAME = ViTE
# 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/ structureDonnee/ values/
INPUT = interface/src/ interface/tests/ parser/src/ trace/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
......
......@@ -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 " "
......
/*!
*\file ressource.hpp
*\file resource.hpp
*\brief This file gives some common header files for the interface classes.
*/
......
logo.png

11.1 KB

/*!
*\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"
......
......@@ -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;
};
......
......@@ -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
*/
......
......@@ -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;
}
}
......@@ -12,7 +12,7 @@
#include "../../values/integer.hpp"
#include "../../values/name.hpp"
#include "../../values/string.hpp"
// #include "../../structureDonnee/trace.hpp"
#include "../../trace/src/Trace.hpp"
/**
* \class ParserEventDecoder
......
......@@ -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
*/
......
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
......
......@@ -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;
}
......
#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
#include "color.hpp"
#include "Color.hpp"
Color::Color() {
_r = 0;
_g = 0;
_b = 0;
}
Color::Color(double r, double g, double b) {
_r = r;
......
......@@ -26,6 +26,13 @@ private :
double _b;
public:
/*!
*
* \brief Constructor
*
*/
Color();
/*!
*
* \brief Constructor
......
#include "date.hpp"
#include "Date.hpp"
Date::Date(){
......
#include "double.hpp"
#include "Double.hpp"
Double::Double(){
......
#include "hex.hpp"
#include "Hex.hpp"
Hex::Hex() {
_value = 0;
}
Hex::Hex(int n) {
_value = n;
......
......@@ -26,6 +26,13 @@ class Hex: public Value {
private:
int _value;
public:
/*!
*
* \brief Constructor
*
*/
Hex();
/*!
*
* \brief Constructor
......
#include "integer.hpp"
#include "Integer.hpp"
Integer::Integer() {
_value = 0;
}
Integer::Integer(int n) {
_value = n;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment