Abstract
It is usually claimed that lexical analysis routines are still coded by hand, despite the widespread availability of scanner generators, for efficiency reasons. While efficiency is a consideration, there exist freely available scanner generators such as GLA [Gray 1988] that can generate scanners that are faster than most hand-coded ones. However, most generated scanners are tailored for a particular environment, and retargeting these scanners to other environments, if possible, is usually complex enough to make a hand-coded scanner more appealing. In this paper we describe RE2C, a scanner generator that not only generates scanners that are faster (and usually smaller) than those produced by any other scanner generator known to the authors, including GLA, but that also adapt easily to any environment.
- AHO, A. V., SETm, R., AND ULLMAN, J.D. 1988. Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading, Mass. Google Scholar
- BERNSTEIN, R.L. 1985. Producing good code for the case statement. Softw. Pract. Exper. 15, 10 (Oct.), 1021-1024. Google Scholar
- DEREMER, F., AND PENNELLO, T. 1982. Efficient computation of LALR(1) look-ahead sets. ACM Trans. Program. Lang. Syst. 4, 4 (Oct.), 615-649. Google Scholar
- ELLIS, M., AND STROUSTRUP, B. 1990. The Annotated C ++ Reference Manual. Addison-Wesley, Reading, Mass. Google Scholar
- FRASER, C. W., AND HANSON, D.R. 1991. A retargetable compiler for ANSI C. SIGPLAN Not. (ACM) 26, 10 (Oct.), 29-43. Google Scholar
- GAREY, M. R., AND JOHNSON, D.S. 1991. Computers and Intractabihty: A Guide to the Theory of NP-Completeness. Freeman, San Francisco, Calif. Google Scholar
- GRAY, R.W. 1988. 7-GLA--A generator for lexical analyzers that programmers can use. In USENIX Conference Proceedings (June). USENIX Association, Berkeley, Calif., 147-160.Google Scholar
- GRAY, R. W., HEURING, V. P., LEVI, S. P., SLOANE, A. M., AND WAITE, W. M. 1992. Eli: A complete, flexible compiler construction system. Commun. ACM 35, 2 (Feb.), 121-131. Google Scholar
- GROSCH, J. 1989. Efficient generation of lexical ana}ysers. Softw. Pract. Exper. 19, 11, 1089-1103. Google Scholar
- HARRISON, M.A. 1978. Introductwn to Formal Language Theory. Addison-Wesley, Reading, Mass. Google Scholar
- HENNESSY, J. L., AND MENDELSOHN, N. 1982. Compilation of the Pascal case statement. Soflw. Pract. Exper. 12, 9 (Sept.), 879-882.Google Scholar
- HORSPOOL, R. N., AND WHITNEY, M. 1990. Even faster LR parsing. Softw. Pract. Exper. 20, 6, 515-535. Google Scholar
- JACOBSON, V. 1987. Tuning UNIX Lex or it's NOT true what they say about Lex. In USENIX Conference Proceedings (Washington, D.C.). USENIX Association, Berkeley, Calif., 163-164. (Abstract only.)Google Scholar
- KERNIGHAN, B. W., AND RITCHIE, D.M. 1988. The C Programming Language. 2nd ed. Prentice- Hall, Englewood Cliffs, N.J. Google Scholar
- LESK, M. E. 1975. LEX--A }exical analyzer generator. Comput. Sci. Tech. Rep. 39, Bell Telephone Laboratories, Murray Hill, N.J.Google Scholar
- PAXSON, V. 1988. flex--Man pages. In flex-2.3.7.tar.Z. (Available for anonymous ftp from ftp.uu.net in/packages / gnu.)Google Scholar
- PENNELLO, T.J. 1986. Very fast LR parsing. In Proceedtngs of the ACM SIGPLAN86 Symposium on Compiler Construction (July). ACM, New York. SIGPLAN Not. 21, 7 (July). Google Scholar
- SALE, A. 1981. The implementation of case statements in Pascal. Softw. Pract. Exper. 11, 9 (Sept.), 929-942.Google Scholar
Index Terms
RE2C: a more versatile scanner generator
Recommendations
Alex—A Simple and Efficient Scanner Generator
Alex is a scanner generator which translates the lexical description of a programming language into a scanner for that language. The scanner description language is easy to use, as it is intentionally small and simple. Alex as well as the generated ...
Alex - A simple and efficient scanner generator
Alex is a scanner generator which translates the lexical description of a programming language into a scanner for that language. The scanner description language is easy to use, as it is intentionally small and simple. Alex as well as the generated ...
Scanner hunter: understanding HTTP scanning traffic
ASIA CCS '14: Proceedings of the 9th ACM symposium on Information, computer and communications securityThis paper focuses on detecting and studying HTTP scanners, which are malicious entities that explore a website selectively for "opportunities" that can potentially be used for subsequent intrusion attempts. Interestingly, there is practically no prior ...








Comments