basic chemical (config) working, still needs more testing

This commit is contained in:
herbglitch 2025-03-09 06:03:38 -06:00
parent 0e83921632
commit 3fbccd9752
4 changed files with 420 additions and 96 deletions

View file

@ -87,7 +87,6 @@ void ARC_Chemical_SetGroupWithCStr(ARC_Chemical *chemical, const char *groupName
* @brief get a value from a given keyname
*
* @note name may be prefaced with <group>:: to specify group
* @note this function uses ARC_Chemical_GetWithCStr so it shares error messages with that function
*
* @param[in] chemical ARC_Chemical to get value from
* @param[in] element name of a variable that has been read in
@ -100,6 +99,7 @@ void *ARC_Chemical_Get(ARC_Chemical *chemical, ARC_String *element);
* @brief get a value from a given keyname
*
* @note name may be prefaced with <group>:: to specify group
* @note this function uses ARC_Chemical_Get so it shares error messages with that function
*
* @param[in] chemical ARC_Chemical to get value from
* @param[in] element name of a variable that has been read in
@ -128,6 +128,75 @@ void ARC_Chemical_UnloadFromString(ARC_Chemical *chemical, ARC_String **string);
*/
void ARC_Chemical_UnloadFromFile(ARC_Chemical *chemical, ARC_String *data);
#define ARC_CHEMICAL_DEFAULT_GROUP " "
#define ARC_CHEMICAL_GROUP_TAG_NAME "group"
#define ARC_CHEMICAL_GROUP_SEPARATOR "::"
//the grouping is based on the ascii table, but the ids are sequential to make finding tokens quicker (look at the lexer continious for more explanation)
#define ARC_CHEMICAL_TAB 0x01
#define ARC_CHEMICAL_NEWLINE 0x02
#define ARC_CHEMICAL_SPACE 0x03
#define ARC_CHEMICAL_BANG 0x04
#define ARC_CHEMICAL_QUOTE 0x05
#define ARC_CHEMICAL_HASH 0x06
#define ARC_CHEMICAL_DOLLAR 0x07
#define ARC_CHEMICAL_PERCENT 0x08
#define ARC_CHEMICAL_AMPERSAND 0x09
#define ARC_CHEMICAL_SINGLE_QUOTE 0x0A
#define ARC_CHEMICAL_OPEN_PAREN 0x0B
#define ARC_CHEMICAL_CLOSE_PAREN 0x0C
#define ARC_CHEMICAL_ASTERISK 0x0D
#define ARC_CHEMICAL_PLUS 0x0E
#define ARC_CHEMICAL_COMMA 0x0F
#define ARC_CHEMICAL_MINUS 0x10
#define ARC_CHEMICAL_PERIOD 0x11
#define ARC_CHEMICAL_SLASH 0x12
#define ARC_CHEMICAL_NUMBER 0x13
#define ARC_CHEMICAL_COLON 0x14
#define ARC_CHEMICAL_SEMICOLON 0x15
#define ARC_CHEMICAL_LESS_THAN 0x16
#define ARC_CHEMICAL_GREATER_THAN 0x17
#define ARC_CHEMICAL_EQUAL 0x18
#define ARC_CHEMICAL_QUESTION_MARK 0x19
#define ARC_CHEMICAL_AT 0x1A
#define ARC_CHEMICAL_ALPHA_UPPER_CHAR 0x1B
#define ARC_CHEMICAL_OPEN_BRACKET 0x1C
#define ARC_CHEMICAL_BACKSLASH 0x1D
#define ARC_CHEMICAL_CLOSE_BRACKET 0x1E
#define ARC_CHEMICAL_CARET 0x1F
#define ARC_CHEMICAL_UNDERSCORE 0x20
#define ARC_CHEMICAL_GRAVE 0x21
#define ARC_CHEMICAL_ALPHA_LOWER_CHAR 0x22
#define ARC_CHEMICAL_OPEN_CURLY_BRACE 0x23
#define ARC_CHEMICAL_VERTICAL_LINE 0x24
#define ARC_CHEMICAL_CLOSE_CURLY_BRACE 0x25
#define ARC_CHEMICAL_TILDE 0x26
#define ARC_CHEMICAL_LANGUAGE 0x27
#define ARC_CHEMICAL_GROUP 0x28
#define ARC_CHEMICAL_GROUP_NAME 0x29
#define ARC_CHEMICAL_GROUP_ARGS 0x2A
#define ARC_CHEMICAL_VARIABLE_LINES 0x2B
#define ARC_CHEMICAL_VARIABLE_LINE 0x2C
#define ARC_CHEMICAL_ALLOW_SPACE 0x2D
#define ARC_CHEMICAL_TYPE 0x2E
#define ARC_CHEMICAL_VALUE 0x2F
#define ARC_CHEMICAL_NESTED_VALUE 0x30
#define ARC_CHEMICAL_VALUE_ARGS 0x31
#define ARC_CHEMICAL_VARIABLE 0x32
#define ARC_CHEMICAL_VARIABLE_NAME 0x33
#define ARC_CHEMICAL_VARIABLE_CHAR 0x34
#define ARC_CHEMICAL_STRING 0x35
#define ARC_CHEMICAL_STRING_CHARS 0x36
#define ARC_CHEMICAL_STRING_CHAR 0x37
#define ARC_CHEMICAL_ESCAPE_CHAR 0x38
#define ARC_CHEMICAL_WHITESPACE 0x39
#define ARC_CHEMICAL_NUMBER_TAG 0x3A
#ifdef __cplusplus
}
#endif