| 1 | /* yylex - scanner front-end for flex */
|
|---|
| 2 |
|
|---|
| 3 | /* Copyright (c) 1990 The Regents of the University of California. */
|
|---|
| 4 | /* All rights reserved. */
|
|---|
| 5 |
|
|---|
| 6 | /* This code is derived from software contributed to Berkeley by */
|
|---|
| 7 | /* Vern Paxson. */
|
|---|
| 8 |
|
|---|
| 9 | /* The United States Government has rights in this work pursuant */
|
|---|
| 10 | /* to contract no. DE-AC03-76SF00098 between the United States */
|
|---|
| 11 | /* Department of Energy and the University of California. */
|
|---|
| 12 |
|
|---|
| 13 | /* This file is part of flex. */
|
|---|
| 14 |
|
|---|
| 15 | /* Redistribution and use in source and binary forms, with or without */
|
|---|
| 16 | /* modification, are permitted provided that the following conditions */
|
|---|
| 17 | /* are met: */
|
|---|
| 18 |
|
|---|
| 19 | /* 1. Redistributions of source code must retain the above copyright */
|
|---|
| 20 | /* notice, this list of conditions and the following disclaimer. */
|
|---|
| 21 | /* 2. Redistributions in binary form must reproduce the above copyright */
|
|---|
| 22 | /* notice, this list of conditions and the following disclaimer in the */
|
|---|
| 23 | /* documentation and/or other materials provided with the distribution. */
|
|---|
| 24 |
|
|---|
| 25 | /* Neither the name of the University nor the names of its contributors */
|
|---|
| 26 | /* may be used to endorse or promote products derived from this software */
|
|---|
| 27 | /* without specific prior written permission. */
|
|---|
| 28 |
|
|---|
| 29 | /* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
|
|---|
| 30 | /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
|
|---|
| 31 | /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
|
|---|
| 32 | /* PURPOSE. */
|
|---|
| 33 |
|
|---|
| 34 | #include <ctype.h>
|
|---|
| 35 | #include "flexdef.h"
|
|---|
| 36 | #include "parse.h"
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | /* yylex - scan for a regular expression token */
|
|---|
| 40 |
|
|---|
| 41 | int yylex ()
|
|---|
| 42 | {
|
|---|
| 43 | int toktype;
|
|---|
| 44 | static int beglin = false;
|
|---|
| 45 | extern char *yytext;
|
|---|
| 46 |
|
|---|
| 47 | if (eofseen)
|
|---|
| 48 | toktype = EOF;
|
|---|
| 49 | else
|
|---|
| 50 | toktype = flexscan ();
|
|---|
| 51 |
|
|---|
| 52 | if (toktype == EOF || toktype == 0) {
|
|---|
| 53 | eofseen = 1;
|
|---|
| 54 |
|
|---|
|
|---|