aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2007-07-30 20:22:37 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2007-07-30 20:22:37 +0000
commit5c9beb6180bf9d3a6bbbbf42eb5c82dcda1e0f85 (patch)
tree9cbfb86dfe1b0a83c37e8528dc019ef3885e0733 /wiretap
parentc17ebb799f3bce6b87858ab69c4f134a0439ad2e (diff)
Add comments to various %option items to explain what they're doing.
Move the %options to the beginning if they weren't already there, and put them in the same order in all files. Add "prefix=" options to .l files that don't already have them, so we don't have to pass a "-P" option. Add "never-interactive" and "noyywrap" options to our lexical analyzers, to remove extra isatty() checks and to eliminate the need for yywrap() from the Flex library. Get rid of %option nostdinit - that's the default. Add .l.c: rules to Makefile.am files, replacing the rules for specific .l files. Have those rules all check that $(LEX) is set. Update the address for the FSF. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22424 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/Makefile.am7
-rw-r--r--wiretap/ascend-scanner.l21
-rw-r--r--wiretap/k12text.l22
3 files changed, 39 insertions, 11 deletions
diff --git a/wiretap/Makefile.am b/wiretap/Makefile.am
index 078486cbd4..4aeb98cacc 100644
--- a/wiretap/Makefile.am
+++ b/wiretap/Makefile.am
@@ -79,12 +79,9 @@ ascend-grammar.c : ascend-grammar.y
fi
$(YACC) -d -p ascend -o ascend-grammar.c $(srcdir)/ascend-grammar.y
-ascend-scanner.c : ascend-scanner.l
+.l.c:
@if [ ! -x "$(LEX)" ]; then \
echo "Neither lex nor flex was found"; \
exit 1; \
fi
- $(LEX) -Pascend -oascend-scanner.c $(srcdir)/ascend-scanner.l
-
-k12text.c : k12text.l
- $(LEX) -ok12text.c $(srcdir)/k12text.l
+ $(LEX) -o$@ $<
diff --git a/wiretap/ascend-scanner.l b/wiretap/ascend-scanner.l
index 762e868e55..a586078c63 100644
--- a/wiretap/ascend-scanner.l
+++ b/wiretap/ascend-scanner.l
@@ -1,3 +1,19 @@
+/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
+ * We don't read from the terminal.
+ */
+%option never-interactive
+
+/*
+ * Prefix scanner routines with "ascend" rather than "yy", so this scanner
+ * can coexist with other scanners.
+ */
+%option prefix="ascend"
+
%{
/* ascend-scanner.l
*
@@ -18,7 +34,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
@@ -59,9 +75,6 @@ int mul, scratch;
%}
-%option nostdinit
-%option noyywrap
-
D [0-9]
H [A-Fa-f0-9]
diff --git a/wiretap/k12text.l b/wiretap/k12text.l
index 5c5ec54864..6494c5fee9 100644
--- a/wiretap/k12text.l
+++ b/wiretap/k12text.l
@@ -1,8 +1,26 @@
+/*
+ * We want to stop processing when we get to the end of the input.
+ */
%option noyywrap
+
+/*
+ * We don't use unput, so don't generate code for it.
+ */
%option nounput
-%option outfile="k12text.c"
-%option prefix="K12Text_"
+
+/*
+ * We don't read from the terminal.
+ */
%option never-interactive
+
+/*
+ * Prefix scanner routines with "K12Text_" rather than "yy", so this scanner
+ * can coexist with other scanners.
+ */
+%option prefix="K12Text_"
+
+%option outfile="k12text.c"
+
%{
/* k12text.l
*