svn commit: r1306 - in trunk/yasm/modules/parsers/gas: . tests/bin

peter at tortall.net peter at tortall.net
Wed Nov 2 00:24:22 PST 2005


Author: peter
Date: Wed Nov  2 00:24:19 2005
New Revision: 1306

Added:
   trunk/yasm/modules/parsers/gas/tests/bin/
   trunk/yasm/modules/parsers/gas/tests/bin/Makefile.inc
   trunk/yasm/modules/parsers/gas/tests/bin/gas_bin_test.sh   (contents, props changed)
   trunk/yasm/modules/parsers/gas/tests/bin/rept-err.asm
   trunk/yasm/modules/parsers/gas/tests/bin/rept-err.errwarn
   trunk/yasm/modules/parsers/gas/tests/bin/reptempty.asm
   trunk/yasm/modules/parsers/gas/tests/bin/reptempty.errwarn
   trunk/yasm/modules/parsers/gas/tests/bin/reptempty.hex
   trunk/yasm/modules/parsers/gas/tests/bin/reptlong.asm
   trunk/yasm/modules/parsers/gas/tests/bin/reptlong.errwarn
   trunk/yasm/modules/parsers/gas/tests/bin/reptlong.hex
   trunk/yasm/modules/parsers/gas/tests/bin/reptnested-err.asm
   trunk/yasm/modules/parsers/gas/tests/bin/reptnested-err.errwarn
   trunk/yasm/modules/parsers/gas/tests/bin/reptsimple.asm
   trunk/yasm/modules/parsers/gas/tests/bin/reptsimple.errwarn
   trunk/yasm/modules/parsers/gas/tests/bin/reptsimple.hex
   trunk/yasm/modules/parsers/gas/tests/bin/reptwarn.asm
   trunk/yasm/modules/parsers/gas/tests/bin/reptwarn.errwarn
   trunk/yasm/modules/parsers/gas/tests/bin/reptwarn.hex
   trunk/yasm/modules/parsers/gas/tests/bin/reptzero.asm
   trunk/yasm/modules/parsers/gas/tests/bin/reptzero.errwarn
   trunk/yasm/modules/parsers/gas/tests/bin/reptzero.hex
Modified:
   trunk/yasm/modules/parsers/gas/gas-bison.y
   trunk/yasm/modules/parsers/gas/gas-parser.c
   trunk/yasm/modules/parsers/gas/gas-parser.h
   trunk/yasm/modules/parsers/gas/gas-token.re
   trunk/yasm/modules/parsers/gas/tests/Makefile.inc
Changeset:
   http://www.tortall.net/projects/yasm/changeset/1306

Log:
Add support for single-level GAS .rept directive.  Nested .rept's are not
allowed at the moment.  The implementation works mostly like a preproc; it
copies source lines and replays them to the lexer.  A new .line directive
was added to fix up line numbers for errors and warnings.

* gas-parser.h (yasm_parser_gas): Add rept structure storage.
(gas_rept): New data structure for .rept state.
(gas_rept_line): Data structure to store source lines within .rept block.

* gas-parser.c: Initialize rept to NULL and check for unclosed rept.

* gas-bison.y: Add support for .line, .rept, and .endr directives.  The
DIR_REPT handler just creates the rept structure, and the DIR_ENDR handler
just errors (.endr without .rept).  All the real work is done in the lexer.

* gas-token.re (rept_input): Replays captured .rept block source lines back
to fill().
(fill): Call rept_input() instead of yasm_preproc_input() if expanding a
rept block.
(gas_parser_lex): Capture source lines and store into rept data structures.

Also added a whole bunch of testcases.



More information about the yasm-cvs mailing list