Differences between version 4 and revision by previous author of Flex.
Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History
Newer page: | version 4 | Last edited on Saturday, August 23, 2003 2:33:24 pm | by KarlBriscoe | Revert |
Older page: | version 3 | Last edited on Saturday, August 23, 2003 11:28:47 am | by WikiAdmin | Revert |
@@ -5,14 +5,18 @@
It is usually used in conjunction with [Bison]. The [Flex] code then passes the tokens it finds to the [Yacc] style parser generated by [Bison].
As a completely spurious example this is what the rules file could look like:
- {
-
#include <string.h>
- }
+ %
{
+
#include <string.h>
+ %
}
MATCHBOB "bob"|"BOB"
- /* pattern action */
- {MATCHBOB} {printf("bob has been found!"
);}
+ %%
+
/* pattern action */
+
+ {MATCHBOB} {printf("bob has been found!);}
+
+ %%
/*user supplied functions */