binpac: Make 'nullptr' a keyword, allow values to be set to it and compared against it

This helps fix 'modernize-use-nullptr' findings in generated code.
This commit is contained in:
Tim Wojtulewicz 2025-05-16 15:26:18 -07:00
parent 3cf68302a2
commit 45d07641e4
8 changed files with 41 additions and 5 deletions

View file

@ -21,6 +21,7 @@
#include "pac_expr.h"
#include "pac_flow.h"
#include "pac_id.h"
#include "pac_nullptr.h"
#include "pac_number.h"
#include "pac_output.h"
#include "pac_param.h"
@ -200,6 +201,10 @@ ESCSEQ (\\([^\n]|[0-7]{3}|x[[:xdigit:]]{2}))
yylval.val = AnalyzerDataUnit::FLOWUNIT;
return TOK_DATAUNIT;
}
<INITIAL>nullptr {
yylval.nullp = new Nullptr();
return TOK_NULLPTR;
}
<INITIAL>of return TOK_OF;
<INITIAL>offsetof return TOK_OFFSETOF;
<INITIAL>padding return TOK_PADDING;