Took some break for my mental health. I'm ok.
I'm just working on making the configuration system. (wasting my time in this stupid configurator)
I just used regex to identify the syntax.
std::regex *syntax_regex[] = {
new std::regex("\\[([\\w]+)\\][ ]*\\=[ ]*([\\w]+)[ ]*\\{[ ]*") , /* Grouping */
new std::regex("([\\w]+)[ ]*\\=[ ]*(.+)[ ]*") , /* Normal */
new std::regex("\\@([\\w]+)[ ]*\\=[ ]*(.+)[ ]*") , /* Raw Normal */
new std::regex("\\}[ ]*WARNING[ ]*\\=[ ]*(.+)") , /* Warning */
new std::regex("\\}") , /* End */
};
The values are parsed and interpreted into C++ macro. Nothing too complicated, but it took quite of time to implement it.. (mainly because I'm lazy :/)
Now this code will be converted
[INTERRUPT] = enabled {
GENERAL_MAXCOUNT = 256
} WARNING = "Unused function called : interrupt is disabled\n"
[IST] = enabled {
SIZE = 2048
}
...into this C++ header
#ifndef _CONFIG_CONFIGURATIONS_MACRO_
#define _CONFIG_CONFIGURATIONS_MACRO_
/****************** CONFIG_INTERRUPT ******************/
#define CONFIG_USE_INTERRUPT
#define CONFIG_INTERRUPT_GENERAL_MAXCOUNT 256
#define CONFIG_WARNING_NO_INTERRUPT WARNING("Unused function called : interrupt is disabled\n");
/****************** CONFIG_IST ******************/
#define CONFIG_USE_IST
#define CONFIG_IST_SIZE 2048
#endif
I originally thought of separating all the configurations into files, but now I think that separating the configuration makes the system more complicated. So I will just integrate all the configuration values into one configuration file.
Now we really need to focus on the integrity of the system and.. the task management system!!! I have no time..