Port linkerscript parser to Bison (#1266)

Notable side effects:
* Use the standard-conformant MSVC preproc
* Add test for linker script INCLUDE
* Improve wording of placement conflict errors
* Fix errors from not newline-terminated files
* Teach checkdiff about the linker script doc
* Call linker script "commands" "directives" instead

---------

Co-authored-by: Rangi42 <remy.oukaour+rangi42@gmail.com>
This commit is contained in:
Eldred Habert
2023-12-11 02:29:37 +01:00
committed by GitHub
parent ab30690854
commit fd78a9ae83
28 changed files with 573 additions and 656 deletions

View File

@@ -8,26 +8,9 @@
#include "linkdefs.hpp"
extern FILE * linkerScript;
struct SectionPlacement {
struct Section *section;
enum SectionType type;
uint16_t org;
uint32_t bank;
};
extern uint64_t script_lineNo;
/*
* Parses the linker script to return the next section constraint
* @return A pointer to a struct, or NULL on EOF. The pointer shouldn't be freed
* Parses the linker script, and modifies the sections mentioned within appropriately.
*/
struct SectionPlacement *script_NextSection(void);
/*
* `free`s all assignment memory that was allocated.
*/
void script_Cleanup(void);
void script_ProcessScript(char const *path);
#endif // RGBDS_LINK_SCRIPT_H