From 80d4431cde7dec47d2cd549ec581cc98dab67d5d Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Fri, 16 May 2008 14:59:45 +0200 Subject: [PATCH] b43-asm: Terminate instructions with ; instead of | This removes support for assembly comments with ";" Use C/C++ style comments, please /* comment */ // comment The preprocessor will take care of them. Signed-off-by: Michael Buesch --- assembler/b43-asm | 2 +- assembler/parser.y | 6 +++--- assembler/scanner.l | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assembler/b43-asm b/assembler/b43-asm index f910a6b..2fbccce 100755 --- a/assembler/b43-asm +++ b/assembler/b43-asm @@ -48,4 +48,4 @@ if [ "$infile" != "-" ]; then fi fi -$CPP -traditional-cpp "$infile" | $B43_ASM "-" "$outfile" $@ +$CPP -x c++ -traditional-cpp "$infile" | $B43_ASM "-" "$outfile" $@ diff --git a/assembler/parser.y b/assembler/parser.y index c589195..5e256ab 100644 --- a/assembler/parser.y +++ b/assembler/parser.y @@ -38,7 +38,7 @@ extern struct initvals_sect *cur_initvals_sect; %token SECTION_TEXT SECTION_IVALS -%token ASM_ARCH ASM_START SPR GPR OFFR LR COMMA BRACK_OPEN BRACK_CLOSE PAREN_OPEN PAREN_CLOSE HEXNUM DECNUM ARCH_NEWWORLD ARCH_OLDWORLD LABEL IDENT LABELREF +%token ASM_ARCH ASM_START SPR GPR OFFR LR COMMA SEMICOLON BRACK_OPEN BRACK_CLOSE PAREN_OPEN PAREN_CLOSE HEXNUM DECNUM ARCH_NEWWORLD ARCH_OLDWORLD LABEL IDENT LABELREF %token PLUS MINUS MULTIPLY DIVIDE BITW_OR BITW_AND BITW_XOR BITW_NOT LEFTSHIFT RIGHTSHIFT @@ -72,9 +72,9 @@ line : line_terminator { } ; -/* Allow terminating lines with the "|" char */ +/* Allow terminating lines with the ";" char */ line_terminator : /* Nothing */ - | BITW_OR line_terminator + | SEMICOLON line_terminator ; section_switch : SECTION_TEXT { diff --git a/assembler/scanner.l b/assembler/scanner.l index 1fa83d5..bb866a9 100644 --- a/assembler/scanner.l +++ b/assembler/scanner.l @@ -48,7 +48,6 @@ NEWLINE ((\r)|(\n)|(\r\n)) {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; } @@ -62,6 +61,7 @@ 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; } -- 2.31.1