OLD | NEW |
1 /* | 1 /* |
2 * NASM-compatible re2c lexer | 2 * NASM-compatible re2c lexer |
3 * | 3 * |
4 * Copyright (C) 2001-2007 Peter Johnson | 4 * Copyright (C) 2001-2007 Peter Johnson |
5 * | 5 * |
6 * Portions based on re2c's example code. | 6 * Portions based on re2c's example code. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
11 * 1. Redistributions of source code must retain the above copyright | 11 * 1. Redistributions of source code must retain the above copyright |
12 * notice, this list of conditions and the following disclaimer. | 12 * notice, this list of conditions and the following disclaimer. |
13 * 2. Redistributions in binary form must reproduce the above copyright | 13 * 2. Redistributions in binary form must reproduce the above copyright |
14 * notice, this list of conditions and the following disclaimer in the | 14 * notice, this list of conditions and the following disclaimer in the |
15 * documentation and/or other materials provided with the distribution. | 15 * documentation and/or other materials provided with the distribution. |
16 * | 16 * |
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' | 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' |
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE | 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE |
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
27 * POSSIBILITY OF SUCH DAMAGE. | 27 * POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 #include <util.h> | 29 #include <util.h> |
30 RCSID("$Id: nasm-token.re 2277 2010-01-19 07:03:15Z peter $"); | |
31 | 30 |
32 #include <libyasm.h> | 31 #include <libyasm.h> |
33 | 32 |
34 #include "modules/parsers/nasm/nasm-parser.h" | 33 #include "modules/parsers/nasm/nasm-parser.h" |
35 #include "modules/preprocs/nasm/nasm.h" | 34 #include "modules/preprocs/nasm/nasm.h" |
36 | 35 |
37 | 36 |
38 #define YYCURSOR cursor | 37 #define YYCURSOR cursor |
39 #define YYLIMIT (s->lim) | 38 #define YYLIMIT (s->lim) |
40 #define YYMARKER (s->ptr) | 39 #define YYMARKER (s->ptr) |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 stringconst_end: | 786 stringconst_end: |
788 strbuf[count] = '\0'; | 787 strbuf[count] = '\0'; |
789 lvalp->str.contents = (char *)strbuf; | 788 lvalp->str.contents = (char *)strbuf; |
790 lvalp->str.len = count; | 789 lvalp->str.len = count; |
791 RETURN(STRING); | 790 RETURN(STRING); |
792 | 791 |
793 endofinput: | 792 endofinput: |
794 parser_nasm->state = INITIAL; | 793 parser_nasm->state = INITIAL; |
795 RETURN(s->tok[0]); | 794 RETURN(s->tok[0]); |
796 } | 795 } |
OLD | NEW |