2023-08-28 21:03:08 -07:00
|
|
|
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
|
|
|
# pragma once
|
2024-12-10 13:13:14 -08:00
|
|
|
# include "helpers/push_ignores.inline.hpp"
|
|
|
|
# include "components/header_start.hpp"
|
|
|
|
# include "components/types.hpp"
|
|
|
|
# include "components/gen/ecode.hpp"
|
|
|
|
# include "components/gen/eoperator.hpp"
|
|
|
|
# include "components/gen/especifier.hpp"
|
|
|
|
# include "components/ast.hpp"
|
|
|
|
# include "components/code_types.hpp"
|
|
|
|
# include "components/ast_types.hpp"
|
|
|
|
# include "components/interface.hpp"
|
|
|
|
# include "components/inlines.hpp"
|
|
|
|
# include "components/gen/ast_inlines.hpp"
|
|
|
|
# include "components/header_end.hpp"
|
2023-08-28 21:03:08 -07:00
|
|
|
#endif
|
2023-08-21 18:40:23 -07:00
|
|
|
|
2024-12-10 13:13:14 -08:00
|
|
|
#pragma region Scanner
|
|
|
|
|
2023-08-21 17:27:00 -07:00
|
|
|
// This is a simple file reader that reads the entire file into memory.
|
|
|
|
// It has an extra option to skip the first few lines for undesired includes.
|
|
|
|
// This is done so that includes can be kept in dependency and component files so that intellisense works.
|
2024-12-10 17:45:00 -08:00
|
|
|
Code scan_file( char const* path );
|
2023-07-24 19:19:21 -07:00
|
|
|
|
2024-12-10 20:35:47 -08:00
|
|
|
CodeBody parse_file( const char* path );
|
2023-07-18 20:33:00 -07:00
|
|
|
|
2024-12-10 13:13:14 -08:00
|
|
|
// The follow is basic support for light csv parsing (use it as an example)
|
|
|
|
// Make something robust if its more serious.
|
|
|
|
|
|
|
|
typedef struct CSV_Column CSV_Column;
|
|
|
|
struct CSV_Column {
|
2024-12-10 17:45:00 -08:00
|
|
|
CSV_Object ADT;
|
2024-12-10 20:35:47 -08:00
|
|
|
Array(ADT_Node) Content;
|
2023-07-18 20:33:00 -07:00
|
|
|
};
|
|
|
|
|
2024-12-10 13:13:14 -08:00
|
|
|
typedef struct CSV_Columns2 CSV_Columns2;
|
|
|
|
struct CSV_Columns2 {
|
2024-12-10 17:45:00 -08:00
|
|
|
CSV_Object ADT;
|
2024-12-10 20:35:47 -08:00
|
|
|
Array(ADT_Node) Col_1;
|
|
|
|
Array(ADT_Node) Col_2;
|
2024-12-10 13:13:14 -08:00
|
|
|
};
|
2023-07-18 20:33:00 -07:00
|
|
|
|
2024-12-10 20:35:47 -08:00
|
|
|
CSV_Column parse_csv_one_column(AllocatorInfo allocator, char const* path);
|
|
|
|
CSV_Columns2 parse_csv_two_columns(AllocatorInfo allocator, char const* path);
|
2024-12-10 13:13:14 -08:00
|
|
|
|
|
|
|
#pragma endregion Scanner
|