summaryrefslogtreecommitdiff
path: root/tests/top.l
diff options
context:
space:
mode:
authorWill Estes <westes575@gmail.com>2014-06-14 11:46:44 -0400
committerWill Estes <westes575@gmail.com>2014-11-12 05:14:27 -0500
commita0243585d226e5ce5d72bd21c31833517e55c26a (patch)
tree2d83602689b79f7e164d7ad81debf248016a1830 /tests/top.l
parent5c48969b76b2141997af228b8cbbbb73bc3e4e57 (diff)
refactor top test for new test suite layout
Diffstat (limited to 'tests/top.l')
-rw-r--r--tests/top.l53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/top.l b/tests/top.l
new file mode 100644
index 0000000..92a2c02
--- /dev/null
+++ b/tests/top.l
@@ -0,0 +1,53 @@
+/*
+ * This file is part of flex.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+%{
+/* Build "scanner.c".
+ The scanner is not important.
+ This test is really about compilation. See "main.c".
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+#ifndef DEFINE_ME
+#error "DEFINE_ME undefined!"
+#endif
+%}
+
+%top{
+#define DEFINE_ME 1
+}
+
+%option reentrant
+%option 8bit header="top.h" prefix="test"
+%option nounput nomain noyywrap
+%option warn
+
+
+%%
+
+.|\n { }
+
+%%
+