Skip to content

Commit 8effe5c

Browse files
committed
Stub OFFSET and SECTOFF.`
1 parent 5dd27e5 commit 8effe5c

File tree

6 files changed

+1625
-1594
lines changed

6 files changed

+1625
-1594
lines changed

lexical.c

Lines changed: 700 additions & 693 deletions
Large diffs are not rendered by default.

lexical.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ extern int yylex \
716716
#undef yyTABLES_NAME
717717
#endif
718718

719-
#line 510 "lexical.l"
719+
#line 512 "lexical.l"
720720

721721

722722
#line 722 "lexical.h"

lexical.l

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ pc return TOKEN_PROGRAM_COUNTER;
345345
<OPERANDS>def return TOKEN_DEF;
346346
<OPERANDS>type return TOKEN_TYPE;
347347
<OPERANDS>filesize return TOKEN_FILESIZE;
348+
<OPERANDS>offset return TOKEN_OFFSET;
349+
<OPERANDS>sectoff return TOKEN_OFFSET;
348350

349351
/* Decimal number. */
350352
{decimal} {

syntactic.c

Lines changed: 912 additions & 897 deletions
Large diffs are not rendered by default.

syntactic.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,8 @@ typedef struct Statement
664664
TOKEN_INSTR = 440, /* TOKEN_INSTR */
665665
TOKEN_DEF = 441, /* TOKEN_DEF */
666666
TOKEN_TYPE = 442, /* TOKEN_TYPE */
667-
TOKEN_FILESIZE = 443 /* TOKEN_FILESIZE */
667+
TOKEN_FILESIZE = 443, /* TOKEN_FILESIZE */
668+
TOKEN_OFFSET = 444 /* TOKEN_OFFSET */
668669
};
669670
typedef enum m68kasm_tokentype m68kasm_token_kind_t;
670671
#endif
@@ -686,7 +687,7 @@ union M68KASM_STYPE
686687
IdentifierList identifier_list;
687688
Expression expression;
688689

689-
#line 690 "syntactic.h"
690+
#line 691 "syntactic.h"
690691

691692
};
692693
typedef union M68KASM_STYPE M68KASM_STYPE;
@@ -707,6 +708,6 @@ void DestroyExpression(Expression *expression);
707708
void DestroyStatement(Statement *statement);
708709

709710

710-
#line 711 "syntactic.h"
711+
#line 712 "syntactic.h"
711712

712713
#endif /* !YY_M68KASM_SYNTACTIC_H_INCLUDED */

syntactic.y

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ static void DestroyStatementInstruction(StatementInstruction *instruction);
668668
%token TOKEN_DEF
669669
%token TOKEN_TYPE
670670
%token TOKEN_FILESIZE
671+
%token TOKEN_OFFSET
671672

672673
%type<instruction> instruction
673674
%type<opcode> opcode
@@ -2203,6 +2204,11 @@ expression8
22032204
$$.type = EXPRESSION_FILESIZE;
22042205
$$.shared.string = $3;
22052206
}
2207+
| TOKEN_OFFSET '(' expression ')'
2208+
{
2209+
/* TODO: Make this actually do something besides pass the expression through. */
2210+
$$ = $3;
2211+
}
22062212
;
22072213

22082214
string

0 commit comments

Comments
 (0)