Commit 475bc81f authored by Arthur Redondy's avatar Arthur Redondy

nettoyage de fichiers inutiles et ajout de commentaires doxygen : plus de...

nettoyage de fichiers inutiles et ajout de commentaires doxygen : plus de warnings de doxygen pour la partie parser
parent da2e60e5
This diff is collapsed.
To compile the interface code source :
Visit : http://www.qtsoftware.com/downloads/opensource/appdev and download the development files for your operating system.
Install also GLUT.
For Debian/Ubuntu users, you can use apt-get :
sudo apt-get install libqt4-dev libqt4-opengl-dev libglut3-dev
For Doxygen, it necessary to have epstopdf for the latex version. You can install it with the package texlive-extra-utils.
Then, until Qt development files are installed, you can compile ViTE :
make build -> the first time you compile the project. Compiled files are placed in "bin" folder.
make -> if you have ever done "make rebuild". Compiled files are placed in "bin" folder.
make plugins -> the first time you compile the project. It generates the 'libplugin.so' file in 'plugin' folder which used by qtDesigner for the render area.
make doc -> generates the documentation of the source code.
make tests -> to compile test files. Compiled files are placed in "bin" folder.
make debugs -> to compile ViTE with debug informations. Compiled files are placed in "debug" folder.
make clean -> remove files generated by the compiler.
/!\ WARNING : use "make debugs" or "make tests" with a "s" and NOT "make debug" or "make test" !
all:
make -C src
mtest:
make -C test
clean:
rm -f bin/*.o
\ No newline at end of file
CXX=g++
CXXFLAGS = -Wall -g
BIN_DIR = ../bin/
OBJECT_FILE = enderror.o endwarning.o endinformation.o message.o message_ns.o
all : $(OBJECT_FILE)
@echo " "
@echo "Message files compiled successfully ! (release)"
@echo " "
%.o:%.cpp %.hpp
$(CXX) -c $(CXXFLAGS) $< -o $(BIN_DIR)$@
......@@ -10,7 +10,13 @@
* \brief Contains the name and the type of a definition element.
*/
struct Field{
/*!
* \brief Contains the name of a definition element.
*/
std::string _name;
/*!
* \brief Contains the type of a definition element.
*/
std::string _type;
};
......
......@@ -13,6 +13,9 @@
#include "../message/message_ns.hpp"
#include "../interface/interface_graphic.hpp"
/*! \class Error
* \brief Define errors and warnings used in the parser.
*/
class Error{
private:
Error();
......@@ -27,43 +30,144 @@ public:
/*
* Priorities of errors
*/
/*!
* \brief Define the priority _ERROR.
*/
const static int _ERROR = 1;
/*!
* \brief Define the priority _WARNING.
*/
const static int _WARNING = 2;
/*
* Kind of errors known
*/
/*!
* \brief Define the error when missing the end of a definition.
*/
const static std::string _EXPECT_END_DEF;
/*!
* \brief Define the error when missing the beginning of a definition.
*/
const static std::string _EXPECT_EVENT_DEF;
/*!
* \brief Define the error when missing the name of a definition.
*/
const static std::string _EXPECT_NAME_DEF;
/*!
* \brief Define the error when missing the identity of a definition.
*/
const static std::string _EXPECT_ID_DEF;
/*!
* \brief Define the error when some extra characters are ignored at the end of a line in a definition.
*/
const static std::string _EXTRA_TOKEN_IN_DEF;
/*!
* \brief Define the error when an event doesn't match with the event with the same name know by the parser.
*/
const static std::string _UNKNOWN_EVENT;
/*!
* \brief Define the error when missing the type of a field in a definition.
*/
const static std::string _FIELD_TYPE_MISSING;
/*!
* \brief Define the error when the type of a field in a definition is not recognized by the parser.
*/
const static std::string _FIELD_TYPE_UNKNOWN;
/*!
* \brief Define the error when a definition has no field.
*/
const static std::string _EMPTY_DEF;
/*!
* \brief Define the error when a value don't match with its type.
*/
const static std::string _INCOMPATIBLE_VALUE_IN_EVENT;
/*!
* \brief Define the error when a type is not reconized by the parser.
*/
const static std::string _UNKNOWN_TYPE_IN_EVENT;
/*!
* \brief Define the error when an event is not reconized by the parser.
*/
const static std::string _UNKNOWN_EVENT_IN_PARSER_DEF_NOT_FOUND;
/*!
* \brief Define the error when the parser can't parse a line.
*/
const static std::string _UNKNOWN_LINE;
/*!
* \brief Define the error when the file which has to be parse doesn't have the right extension.
*/
const static std::string _BAD_FILE_EXTENSION;
/*!
* \brief Define the error when some extra characters are ignored at the end of the line event.
*/
const static std::string _LINE_TOO_LONG_EVENT;
/*!
* \fn set(const std::string kind_of_error, const int priority) static void
* \brief raise an error or a warning
* \param kind_of_error : content of error
* \param priority : _ERROR or _WARNING
*/
static void set(const std::string kind_of_error, const int priority);
/*!
* \fn set_and_print(const std::string kind_of_error, const int priority) static void
* \brief raise and throw to the interface an error or a warning
* \param kind_of_error : content of error
* \param priority : _ERROR or _WARNING
*/
static void set_and_print(const std::string kind_of_error, const int priority);
static void set_and_print(const std::string kind_of_error, const unsigned int line_number, const int priority);
/*!
* \fn set_and_print(const std::string kind_of_error, const unsigned int line_number, const int priority) static void
* \brief raise and throw to the interface an error or a warning and the line when it occurs
* \param kind_of_error : content of error
* \param line_number : position of the error in the trace
* \param priority : _ERROR or _WARNING
*/
static void set_and_print(const std::string kind_of_error, const unsigned int line_number, const int priority);
/*!
* \fn print(const int priority) static void
* \brief print the current error
* \param priority : _ERROR or _WARNING
*/
static void print(const int priority);
/*!
* \fn set_if(bool condition, const std::string kind_of_error, const unsigned int line_number, const int priority) static bool
* \brief raise an error or a warning and the line when it occurs if the condition is satisfied
* \param condition : a condition
* \param kind_of_error : content of error
* \param line_number : position of the error in the trace
* \param priority : _ERROR or _WARNING
* \return true if the condition is satisfied
*/
static bool set_if(bool condition, const std::string kind_of_error, const unsigned int line_number, const int priority);
/*!
* \fn set_and_print_if(bool condition, const std::string kind_of_error ,const unsigned int line_number, const int priority) static bool
* \brief raise and throw to the interface an error or a warning and the line when it occurs is the condition is satisfied
* \param condition : a condition
* \param kind_of_error : content of error
* \param line_number : position of the error in the trace
* \param priority : _ERROR or _WARNING
* \return true is the condition is satisfied
*/
static bool set_and_print_if(bool condition, const std::string kind_of_error, const unsigned int line_number, const int priority);
/*!
* \fn print_numbers() static void
* \brief throw to the interface a message about the number of errors and warnings
*/
static void print_numbers();
/*!
* \fn flush_in_file(const std::string &filename) static void
* \brief print all the errors and warnings saved in a file and empty the queues _errors and _warnings
* \param filename : a file path
*/
static void flush_in_file(const std::string &filename);
};
......
......@@ -56,11 +56,11 @@ public:
~Line();
/*!
* \fn starts_with(const std::string &) const
* \param : A string
* \return : true if the line starts with the param, false else
* \fn starts_with(const std::string &s) const
* \param s : a string
* \return true if the line starts with the param, false else
*/
bool starts_with(const std::string &) const;
bool starts_with(const std::string &s) const;
/*!
* \fn is_eof() const
......
DIR_SRC = src
DIR_TESTS = tests
all:
@(cd $(DIR_SRC) && make)
debug:
@(cd ../bin && rm -f *.o)
@(cd $(DIR_TESTS) && make)
clean:
@(cd $(DIR_SRC) && make clean)
@(cd $(DIR_TESTS) && make clean)
rm -rf Makefile~ *.*~
LD = g++
OBJ = Line.o ParserDefinitionDecoder.o Definition.o ParserPaje.o TokenSource.o ParserEventDecoder.o
OBJWPARSER = Line.o ParserDefinitionDecoder.o Definition.o TokenSource.o
OPT = -g -Wall -W
LIBS =
DIR_OBJ = ../../bin/
all: $(OBJ)
allbutparser : $(OBJWPARSER)
$(OBJ):%.o: %.cpp %.hpp
$(LD) -c $< $(OPT) -o $(DIR_OBJ)$@
clean:
$(RM) *.o *.*~ makefile~
LD = g++
OBJ = Container.o ContainerType.o Entity.o EntityType.o EntityValue.o State.o StateType.o Event.o EventType.o Trace.o
OPT = -g -Wall -W
LIBS =
DIR_VALUES = values
all: $(OBJ)
$(OBJ):%.o: %.cpp %.hpp
$(LD) -c $< $(OPT) -o ../../bin/$@
@(cd $(DIR_VALUES) && make)
clean:
$(RM) *.o *.*~ Makefile~
LD = g++
OBJ = Color.o Date.o Double.o Hex.o Integer.o Name.o String.o
OPT = -g -Wall -W
LIBS =
all: $(OBJ)
$(OBJ):%.o: %.cpp %.hpp Value.hpp
$(LD) -c $< $(OPT)
clean:
$(RM) *.o *.*~ Makefile~
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