| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
config.h may define macros that alter the API of the standard library
funtions, and so it should be included before any other standard
header, even before the skeleton's standard header inclusion.
For example: config.h may #define _GNU_SOURCE that would expose the
reallocarray() prototype from <stdlib.h> on glibc 2.26+ systems. If we
include <stdlib.h> before config.h, reallocarray() would not be
available for use in lex file since the second include doesn't help
due to header guard.
For now our config.h might `#define malloc rpl_malloc` -- this
substitution must work before including stdlib.h, or else the compiler
will complain about missing prototypes, and may result in incorrect
code in scan.l (gcc warning: return makes pointer from integer without
a cast [-Wint-conversion]).
Fixes #247.
|
|
|
|
| |
Unattributed patch carried over from sourceforge bug tracker.
|
|
|
|
|
| |
This can happen in the case of // comments (which Flex doesn't handle
specially).
|
|
|
|
|
| |
This really should never happen, but this at least fixes the
breakage on Verilator.
|
| |
|
|
|
|
|
|
|
|
|
| |
Removed a newline that caused a problem building the scanner in some
circumstances. Specifically:
'bad character' error when executing
/bin/sh ../build-aux/ylwrap scan.l lex.yy.c scan.c -- flex
|
|
|
|
|
|
|
| |
My changes caused Flex to mishandle string and character literals in
line comments. This commit fixes them.
Fixes #113.
|
|
|
|
|
|
| |
in non-indented verbatim section 2 code.
I also did some reformatting.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes M4 quotation of certain strings beginning with `yy` (in
section 3 of the input file only) and character literals. The new
quotation method is also less brittle and faster.
Tests that relied on the old behavior were fixed.
Also, `yyconst` is no longer defined; use `const` (which it
unconditionally was defined to) instead.
|
|
|
|
|
|
|
|
|
|
| |
This fixes M4 quoting of section 3 of the input file, including escape
sequences and character constants.
Tests were added to verify the behavior in section 3 with respect to
quoting. Both escaping of quotes and quoting of potential macro-start
characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros
in section 3. They needed to be updated for the new behavior.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Previously, `[[` and `]]` were not escaped in strings, which led
to bad interactions with m4.
Also, don't break strings on newline, as GCC et al support whitespace
between a backslash and the subsequent newline.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
rename these too for improved similiarity:
OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES
|
|
|
|
|
|
| |
these collide:
OPT_OUTFILE OPT_PREFIX OPT_YYCLASS
rename them TOK_... in the parser
|
|
|
|
|
|
|
| |
Allow specifying '%option noline' in the input file, leading to the same
effect as calling flex with the command line option --noline.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
| |
Consistently make use of the ANSI C function definition style instead of
the K&R style.
|
|
|
|
|
|
|
| |
As with flex_alloc(), replace with direct calls to free().
The function buf_destroy is now null safe and the logic was corrected to free()
correctly.
|
|
|
|
|
| |
As with flex_alloc(), replace calls to flex_realloc(), which was just a
wrapper around realloc().
|
|
|
|
|
|
|
|
|
|
|
| |
The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly.
Style elements cleaned up:
* superfluous spacing around parentheses
* non-constant initialization in variable declarations
* needless casts
* almost all uses of assignments as subexpressions
|
| |
|
| |
|
|
|
|
|
| |
copy_string() was a clone of the stdlib's strdup(). For safety,
simplicity, and speed, we should use that instead. We introduce xstrdup() which wraps strdup() in a failure upon memory allocation errors.
|
| |
|
|
|
|
|
|
|
|
| |
Thanks to Michael McConville for pointing out that the old Char macro
causes problems with static analysis. The macro has been removed and
replaced with 'unsigned char' throughout the flex sources. The macro is
not needed at best and was confusing at worst. It was not used in any of
the example files nor was it mentioned in the manual at all.
|
|
|
|
|
|
|
|
| |
flex was using K&R function definitions for some functions and
ANSI C style in others, sometimes even in the same file. Change
the code to consistently use ANSI C.
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
const fixes.
-Wconversion fixes for the skeleton files.
param namespace protection (add _ to inline function parameters).
unused variable/code removal.
rename warn to lwarn to avoid conflict with <err.h>.
ctype.h function argument correction.
merged the error functions lerrif and lerrsf -> lerr.
|
|
|
|
| |
clang-3.5.0 now complains about them: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
|
|
The *.[chly] sources are now in the src directory. This implies a
bunch of changes in Makefile.am and friends to account for the new
location. The .gitignore files are now more local to places where various object files and generated source files occur.
|