| [3031] | 1 | This is flex.info, produced by makeinfo version 4.5 from flex.texi.
|
|---|
| 2 |
|
|---|
| 3 | INFO-DIR-SECTION Programming
|
|---|
| 4 | START-INFO-DIR-ENTRY
|
|---|
| 5 | * flex: (flex). Fast lexical analyzer generator (lex replacement).
|
|---|
| 6 | END-INFO-DIR-ENTRY
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 | The flex manual is placed under the same licensing conditions as the
|
|---|
| 10 | rest of flex:
|
|---|
| 11 |
|
|---|
| 12 | Copyright (C) 1990, 1997 The Regents of the University of California.
|
|---|
| 13 | All rights reserved.
|
|---|
| 14 |
|
|---|
| 15 | This code is derived from software contributed to Berkeley by Vern
|
|---|
| 16 | Paxson.
|
|---|
| 17 |
|
|---|
| 18 | The United States Government has rights in this work pursuant to
|
|---|
| 19 | contract no. DE-AC03-76SF00098 between the United States Department of
|
|---|
| 20 | Energy and the University of California.
|
|---|
| 21 |
|
|---|
| 22 | Redistribution and use in source and binary forms, with or without
|
|---|
| 23 | modification, are permitted provided that the following conditions are
|
|---|
| 24 | met:
|
|---|
| 25 |
|
|---|
| 26 | 1. Redistributions of source code must retain the above copyright
|
|---|
| 27 | notice, this list of conditions and the following disclaimer.
|
|---|
| 28 |
|
|---|
| 29 | 2. Redistributions in binary form must reproduce the above copyright
|
|---|
| 30 | notice, this list of conditions and the following disclaimer in the
|
|---|
| 31 | documentation and/or other materials provided with the
|
|---|
| 32 | distribution.
|
|---|
| 33 | Neither the name of the University nor the names of its contributors
|
|---|
| 34 | may be used to endorse or promote products derived from this software
|
|---|
| 35 | without specific prior written permission.
|
|---|
| 36 |
|
|---|
| 37 | THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
|---|
| 38 | WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
|---|
| 39 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|---|
| 40 |
|
|---|
| 41 | File: flex.info, Node: unnamed-faq-76, Next: unnamed-faq-77, Prev: unnamed-faq-75, Up: FAQ
|
|---|
| 42 |
|
|---|
| 43 | unnamed-faq-76
|
|---|
| 44 | ==============
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 | To: "Frescatore, David (CRD, TAD)" <[email protected]>
|
|---|
| 48 | Subject: Re: FLEX 2.5 & THE YEAR 2000
|
|---|
| 49 | In-reply-to: Your message of Wed, 03 Jun 1998 11:26:22 PDT.
|
|---|
| 50 | Date: Wed, 03 Jun 1998 10:22:26 PDT
|
|---|
| 51 | From: Vern Paxson <vern>
|
|---|
| 52 |
|
|---|
| 53 | > I am researching the Y2K problem with General Electric R&D
|
|---|
| 54 | > and need to know if there are any known issues concerning
|
|---|
| 55 | > the above mentioned software and Y2K regardless of version.
|
|---|
| 56 |
|
|---|
| 57 | There shouldn't be, all it ever does with the date is ask the system
|
|---|
| 58 | for it and then print it out.
|
|---|
| 59 |
|
|---|
| 60 | Vern
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 | File: flex.info, Node: unnamed-faq-77, Next: unnamed-faq-78, Prev: unnamed-faq-76, Up: FAQ
|
|---|
| 64 |
|
|---|
| 65 | unnamed-faq-77
|
|---|
| 66 | ==============
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 | To: "Hans Dermot Doran" <[email protected]>
|
|---|
| 70 | Subject: Re: flex problem
|
|---|
| 71 | In-reply-to: Your message of Wed, 15 Jul 1998 21:30:13 PDT.
|
|---|
| 72 | Date: Tue, 21 Jul 1998 14:23:34 PDT
|
|---|
| 73 | From: Vern Paxson <vern>
|
|---|
| 74 |
|
|---|
| 75 | > To overcome this, I gets() the stdin into a string and lex the string. The
|
|---|
| 76 | > string is lexed OK except that the end of string isn't lexed properly
|
|---|
| 77 | > (yy_scan_string()), that is the lexer dosn't recognise the end of string.
|
|---|
| 78 |
|
|---|
| 79 | Flex doesn't contain mechanisms for recognizing buffer endpoints. But if
|
|---|
| 80 | you use fgets instead (which you should anyway, to protect against buffer
|
|---|
| 81 | overflows), then the final \n will be preserved in the string, and you can
|
|---|
| 82 | scan that in order to find the end of the string.
|
|---|
| 83 |
|
|---|
| 84 | Vern
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 | File: flex.info, Node: unnamed-faq-78, Next: unnamed-faq-79, Prev: unnamed-faq-77, Up: FAQ
|
|---|
| 88 |
|
|---|
| 89 | unnamed-faq-78
|
|---|
| 90 | ==============
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 | To: [email protected]
|
|---|
| 94 | Subject: Re: Flex++ 2.5.3 instance member vs. static member
|
|---|
| 95 | In-reply-to: Your message of Mon, 27 Jul 1998 02:10:04 PDT.
|
|---|
| 96 | Date: Tue, 28 Jul 1998 01:10:34 PDT
|
|---|
| 97 | From: Vern Paxson <vern>
|
|---|
| 98 |
|
|---|
| 99 | > %{
|
|---|
| 100 | > int mylineno = 0;
|
|---|
| 101 | > %}
|
|---|
| 102 | > ws [ \t]+
|
|---|
| 103 | > alpha [A-Za-z]
|
|---|
| 104 | > dig [0-9]
|
|---|
| 105 | > %%
|
|---|
| 106 | >
|
|---|
| 107 | > Now you'd expect mylineno to be a member of each instance of class
|
|---|
| 108 | > yyFlexLexer, but is this the case? A look at the lex.yy.cc file seems to
|
|---|
| 109 | > indicate otherwise; unless I am missing something the declaration of
|
|---|
| 110 | > mylineno seems to be outside any class scope.
|
|---|
| 111 | >
|
|---|
| 112 | > How will this work if I want to run a multi-threaded application with each
|
|---|
| 113 | > thread creating a FlexLexer instance?
|
|---|
| 114 |
|
|---|
| 115 | Derive your own subclass and make mylineno a member variable of it.
|
|---|
| 116 |
|
|---|
| 117 | Vern
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 | File: flex.info, Node: unnamed-faq-79, Next: unnamed-faq-80, Prev: unnamed-faq-78, Up: FAQ
|
|---|
| 121 |
|
|---|
| 122 | unnamed-faq-79
|
|---|
| 123 | ==============
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 | To: Adoram Rogel <[email protected]>
|
|---|
| 127 | Subject: Re: More than 32K states change hangs
|
|---|
| 128 | In-reply-to: Your message of Tue, 04 Aug 1998 16:55:39 PDT.
|
|---|
| 129 | Date: Tue, 04 Aug 1998 22:28:45 PDT
|
|---|
| 130 | From: Vern Paxson <vern>
|
|---|
| 131 |
|
|---|
| 132 | > Vern Paxson,
|
|---|
| 133 | >
|
|---|
| 134 | > I followed your advice, posted on Usenet bu you, and emailed to me
|
|---|
| 135 | > personally by you, on how to overcome the 32K states limit. I'm running
|
|---|
| 136 | > on Linux machines.
|
|---|
| 137 | > I took the full source of version 2.5.4 and did the following changes in
|
|---|
| 138 | > flexdef.h:
|
|---|
| 139 | > #define JAMSTATE -327660
|
|---|
| 140 | > #define MAXIMUM_MNS 319990
|
|---|
| |
|---|