Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions frontend_asm68k.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ int main(int argc, char **argv)
settings.pedantic_warnings_enabled = cc_false;
settings.expand_all_macros = cc_false;
settings.automatic_even = cc_true;
settings.allow_ifeq_directives = cc_false;

source_file_path = object_file_path = symbol_file_path = listing_file_path = NULL;
source_file = object_file = symbol_file = listing_file = NULL;
Expand All @@ -128,6 +129,10 @@ int main(int argc, char **argv)
case 'd':
case 'g':
case 'k':
/* /k flag - allow use of ifeq, ifne, etc. */
settings.allow_ifeq_directives = cc_true;
break;

case 'l':
case 'w':
case 'z': /* And 'zd'. */
Expand Down
1 change: 1 addition & 0 deletions frontend_custom.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ int main(int argc, char **argv)
settings.pedantic_warnings_enabled = cc_true;
settings.expand_all_macros = cc_false;
settings.automatic_even = cc_false;
settings.allow_ifeq_directives = cc_false;

for (i = 1; i < argc; ++i)
{
Expand Down
1,364 changes: 702 additions & 662 deletions lexical.c

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions lexical.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
Expand Down Expand Up @@ -386,7 +387,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
yy_size_t yy_n_chars;

/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
Expand Down Expand Up @@ -430,7 +431,7 @@ void yypop_buffer_state ( yyscan_t yyscanner );

YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner );

void *yyalloc ( yy_size_t , yyscan_t yyscanner );
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
Expand Down Expand Up @@ -489,7 +490,7 @@ FILE *yyget_out ( yyscan_t yyscanner );

void yyset_out ( FILE * _out_str , yyscan_t yyscanner );

int yyget_leng ( yyscan_t yyscanner );
yy_size_t yyget_leng ( yyscan_t yyscanner );

char *yyget_text ( yyscan_t yyscanner );

Expand Down Expand Up @@ -716,9 +717,9 @@ extern int yylex \
#undef yyTABLES_NAME
#endif

#line 514 "lexical.l"
#line 521 "lexical.l"


#line 722 "lexical.h"
#line 723 "lexical.h"
#undef m68kasm_IN_HEADER
#endif /* m68kasm_HEADER_H */
7 changes: 7 additions & 0 deletions lexical.l
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,17 @@ hexadecimal {hexadecimal_digit}+
<INITIAL>incbin BEGIN(PATH); return TOKEN_DIRECTIVE_INCBIN;
<INITIAL>binclude BEGIN(PATH); return TOKEN_DIRECTIVE_INCBIN;
<INITIAL>equ BEGIN(OPERANDS); return TOKEN_DIRECTIVE_EQU;
<INITIAL>equr BEGIN(OPERANDS); return TOKEN_DIRECTIVE_EQUR;
<INITIAL>equs BEGIN(OPERANDS); return TOKEN_DIRECTIVE_EQUS;
<INITIAL>substr BEGIN(OPERANDS); return TOKEN_DIRECTIVE_SUBSTR;
<INITIAL>set BEGIN(OPERANDS); return TOKEN_DIRECTIVE_SET;
<INITIAL>if BEGIN(OPERANDS); return TOKEN_DIRECTIVE_IF;
<INITIAL>ifeq BEGIN(OPERANDS); return TOKEN_DIRECTIVE_IFEQ;
<INITIAL>ifne BEGIN(OPERANDS); return TOKEN_DIRECTIVE_IFNE;
<INITIAL>ifgt BEGIN(OPERANDS); return TOKEN_DIRECTIVE_IFGT;
<INITIAL>iflt BEGIN(OPERANDS); return TOKEN_DIRECTIVE_IFLT;
<INITIAL>ifge BEGIN(OPERANDS); return TOKEN_DIRECTIVE_IFGE;
<INITIAL>ifle BEGIN(OPERANDS); return TOKEN_DIRECTIVE_IFLE;
<INITIAL>elseif BEGIN(OPERANDS); return TOKEN_DIRECTIVE_ELSEIF;
<INITIAL>else BEGIN(OPERANDS); return TOKEN_DIRECTIVE_ELSE;
<INITIAL>endc BEGIN(OPERANDS); return TOKEN_DIRECTIVE_ENDC;
Expand Down
1 change: 1 addition & 0 deletions options.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ typedef struct Options
cc_bool pedantic_warnings_enabled;
cc_bool expand_all_macros;
cc_bool automatic_even;
cc_bool allow_ifeq_directives;
} Options;

typedef struct Options_ListEntry
Expand Down
Loading