projects
/
b43-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
asm/dasm: Improve cflags
[b43-tools.git]
/
assembler
/
scanner.l
diff --git
a/assembler/scanner.l
b/assembler/scanner.l
index 34559c67c15e56cb6d60035369747b969b59c79f..11f38907da743740a13996007436eb4fdfb5bafe 100644
(file)
--- a/
assembler/scanner.l
+++ b/
assembler/scanner.l
@@
-48,25
+48,30
@@
NEWLINE ((\r)|(\n)|(\r\n))
{WS}+ { update_lineinfo(); /* whitespace */ }
{NEWLINE} { cur_lineinfo.lineno++; update_lineinfo(); }
{WS}+ { update_lineinfo(); /* whitespace */ }
{NEWLINE} { cur_lineinfo.lineno++; update_lineinfo(); }
-;.*$ { update_lineinfo(); /* comment */ }
^{WS}*"%"{WS}*arch { update_lineinfo(); return ASM_ARCH; }
^{WS}*"%"{WS}*start { update_lineinfo(); return ASM_START; }
^{WS}*"%"{WS}*arch { update_lineinfo(); return ASM_ARCH; }
^{WS}*"%"{WS}*start { update_lineinfo(); return ASM_START; }
+"%"{WS}*assert { update_lineinfo(); return ASM_ASSERT; }
-^{WS}*\.text{WS}*$
{ update_lineinfo(); return SECTION_TEXT; }
-^{WS}*\.initvals/\({IDENTIFIER}\)
{WS}*{NEWLINE}
{ update_lineinfo(); return SECTION_IVALS; }
+^{WS}*\.text{WS}*$ { update_lineinfo(); return SECTION_TEXT; }
+^{WS}*\.initvals/\({IDENTIFIER}\) { update_lineinfo(); return SECTION_IVALS; }
-spr[0-9a-fA-F]{
3,3
} { update_lineinfo(); return SPR; }
+spr[0-9a-fA-F]{
1,4
} { update_lineinfo(); return SPR; }
r/([0-9]|([1-5][0-9])|(6[0-3])) { update_lineinfo(); return GPR; }
off/[0-6] { update_lineinfo(); return OFFR; }
lr/[0-3] { update_lineinfo(); return LR; }
, { update_lineinfo(); return COMMA; }
r/([0-9]|([1-5][0-9])|(6[0-3])) { update_lineinfo(); return GPR; }
off/[0-6] { update_lineinfo(); return OFFR; }
lr/[0-3] { update_lineinfo(); return LR; }
, { update_lineinfo(); return COMMA; }
+; { update_lineinfo(); return SEMICOLON; }
\[ { update_lineinfo(); return BRACK_OPEN; }
\] { update_lineinfo(); return BRACK_CLOSE; }
\( { update_lineinfo(); return PAREN_OPEN; }
\) { update_lineinfo(); return PAREN_CLOSE; }
\[ { update_lineinfo(); return BRACK_OPEN; }
\] { update_lineinfo(); return BRACK_CLOSE; }
\( { update_lineinfo(); return PAREN_OPEN; }
\) { update_lineinfo(); return PAREN_CLOSE; }
+== { update_lineinfo(); return EQUAL; }
+!= { update_lineinfo(); return NOT_EQUAL; }
+\|\| { update_lineinfo(); return LOGICAL_OR; }
+\&\& { update_lineinfo(); return LOGICAL_AND; }
\+ { update_lineinfo(); return PLUS; }
\- { update_lineinfo(); return MINUS; }
\* { update_lineinfo(); return MULTIPLY; }
\+ { update_lineinfo(); return PLUS; }
\- { update_lineinfo(); return MINUS; }
\* { update_lineinfo(); return MULTIPLY; }
@@
-122,7
+127,9
@@
jext { update_lineinfo(); return OP_JEXT; }
jnext { update_lineinfo(); return OP_JNEXT; }
call { update_lineinfo(); return OP_CALL; }
jnext { update_lineinfo(); return OP_JNEXT; }
call { update_lineinfo(); return OP_CALL; }
+calls { update_lineinfo(); return OP_CALLS; }
ret { update_lineinfo(); return OP_RET; }
ret { update_lineinfo(); return OP_RET; }
+rets { update_lineinfo(); return OP_RETS; }
tkiph { update_lineinfo(); return OP_TKIPH; }
tkiphs { update_lineinfo(); return OP_TKIPHS; }
tkiph { update_lineinfo(); return OP_TKIPH; }
tkiphs { update_lineinfo(); return OP_TKIPHS; }
@@
-137,21
+144,20
@@
phy { update_lineinfo(); return IVAL_PHY; }
radio { update_lineinfo(); return IVAL_RADIO; }
shm16 { update_lineinfo(); return IVAL_SHM16; }
shm32 { update_lineinfo(); return IVAL_SHM32; }
radio { update_lineinfo(); return IVAL_RADIO; }
shm16 { update_lineinfo(); return IVAL_SHM16; }
shm32 { update_lineinfo(); return IVAL_SHM32; }
+tram { update_lineinfo(); return IVAL_TRAM; }
-@[0-9a-fA-F]{
3,3
} { update_lineinfo(); return RAW_CODE; }
+@[0-9a-fA-F]{
1,4
} { update_lineinfo(); return RAW_CODE; }
0x[0-9a-fA-F]+ { update_lineinfo(); return HEXNUM; }
-?[0-9]+ { update_lineinfo(); return DECNUM; }
0x[0-9a-fA-F]+ { update_lineinfo(); return HEXNUM; }
-?[0-9]+ { update_lineinfo(); return DECNUM; }
-bcm43xx_newworld { update_lineinfo(); return ARCH_NEWWORLD; }
-bcm43xx_oldworld { update_lineinfo(); return ARCH_OLDWORLD; }
-
{IDENTIFIER}: { update_lineinfo(); return LABEL; }
{IDENTIFIER} { update_lineinfo(); return IDENT; }
%%
struct lineinfo cur_lineinfo;
{IDENTIFIER}: { update_lineinfo(); return LABEL; }
{IDENTIFIER} { update_lineinfo(); return IDENT; }
%%
struct lineinfo cur_lineinfo;
+//FIXME The linenumber sometimes is wrong.
static void interpret_cppinfo(const char *str)
{
static void interpret_cppinfo(const char *str)
{
@@
-177,8
+183,8
@@
static void interpret_cppinfo(const char *str)
goto error;
memset(tmp, 0, sizeof(tmp));
memcpy(tmp, str, min(sizeof(tmp) - 1,
goto error;
memset(tmp, 0, sizeof(tmp));
memcpy(tmp, str, min(sizeof(tmp) - 1,
- (
in
t)(found - str)));
- cur_lineinfo.lineno = strtoul(tmp, NULL, 10);
+ (
size_
t)(found - str)));
+ cur_lineinfo.lineno = strtoul(tmp, NULL, 10)
- 1
;
str = found;
str++;
str = found;
str++;
@@
-194,10
+200,7
@@
static void interpret_cppinfo(const char *str)
memset(cur_lineinfo.file, 0, sizeof(cur_lineinfo.file));
memcpy(cur_lineinfo.file, str,
min(sizeof(cur_lineinfo.file) - 1,
memset(cur_lineinfo.file, 0, sizeof(cur_lineinfo.file));
memcpy(cur_lineinfo.file, str,
min(sizeof(cur_lineinfo.file) - 1,
- (int)(found - str)));
-
- if (strcmp(cur_lineinfo.file, "<stdin>") == 0)
- strcpy(cur_lineinfo.file, "Input File");
+ (size_t)(found - str)));
return;
error:
return;
error: