directory, but use '$am_scriptdir' instead. The complete list of
such "$am_...dir" variables can be found in tests/defs-static.in.
+ When writing input for lex, include the following in the definitions
+ section:
+ %{
+ #define YY_NO_UNISTD_H 1
+ %}
+ to accomodate non-ANSI systems, since GNU flex generates code that
+ includes unistd.h otherwise. Also add:
+ %option never-interactive
+ to the definitions section if the generated code is to be compiled
+ by a C++ compiler, for similar reasons (i.e., the isatty(3) function
+ from that same unistd.h header would be required otherwise).
+
Before commit: make sure the test is executable, add the tests to
TESTS in Makefile.am, add it to XFAIL_TESTS in addition if needed,
write a ChangeLog entry, send the diff to <automake-patches@gnu.org>.
test `$FGREP -c 'tparse.h:' Makefile.in` = 1
cat > tscan.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
%%
END
cat > parsefoo.lxx << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
+%option never-interactive
%%
"GOOD" return EOF;
.
END
cat > lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
END
cat > joe.ll << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
+%option never-interactive
%%
"foo" return EOF;
.
END
cat > joe.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"foo" return EOF;
.
END
cat > foo.l <<'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
END
cat > foo.l <<'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
END
cat > foo.l <<'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
END
cat > zardoz.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
lexer.l:
rm -f $@ $@-t
:; { : \
+ && echo '%{' \
+ && echo '#define YY_NO_UNISTD_H 1' \
+ && echo '%}' \
&& echo '%%' \
&& echo '"GOOD" return EOF;' \
&& echo '.'; \
cat > foo.l << 'END'
%option noyywrap
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
EOF
cat > lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
mkdir sub1 sub2
cat >sub1/s1.l <<\END
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
END
cat > foo.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
mkdir foo
cat > foo/foo.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
# Original lexer, with a "foobar" comment
cat > lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
# New lexer, with 'fubar' comment.
cat > ../lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
# New lexer, with 'maude' comment.
cat > ../lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
EOF
cat > foo.l <<'EOF'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
end
EOF
cat > foo5.l <<'EOF'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
end
EOF
cat > foo5.l <<'EOF'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.