133965Sjdp%{ 233965Sjdp/* arlex.l - Strange script language lexer */ 333965Sjdp 4218822Sdim/* Copyright 1992, 1997, 2000, 2001, 2002, 2003, 2004 5218822Sdim Free Software Foundation, Inc. 633965Sjdp 733965SjdpThis file is part of GNU Binutils. 833965Sjdp 933965SjdpThis program is free software; you can redistribute it and/or modify 1033965Sjdpit under the terms of the GNU General Public License as published by 1133965Sjdpthe Free Software Foundation; either version 2 of the License, or 1233965Sjdp(at your option) any later version. 1333965Sjdp 1433965SjdpThis program is distributed in the hope that it will be useful, 1533965Sjdpbut WITHOUT ANY WARRANTY; without even the implied warranty of 1633965SjdpMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1733965SjdpGNU General Public License for more details. 1833965Sjdp 1933965SjdpYou should have received a copy of the GNU General Public License 2033965Sjdpalong with this program; if not, write to the Free Software 21218822SdimFoundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 2233965Sjdp 2333965Sjdp 24218822Sdim/* Contributed by Steve Chamberlain <sac@cygnus.com>. */ 2533965Sjdp 2633965Sjdp#define DONTDECLARE_MALLOC 27104834Sobrien#include "ansidecl.h" 2833965Sjdp#include "libiberty.h" 2933965Sjdp#include "arparse.h" 3033965Sjdp 31130561Sobrienextern int yylex (void); 3289857Sobrien 3333965Sjdpint linenumber; 3433965Sjdp%} 3561843Sobrien 36250227Sjkim%option nounput 37250227Sjkim 3861843Sobrien%a 10000 3961843Sobrien%o 25000 4061843Sobrien 4133965Sjdp%% 4233965Sjdp 4333965Sjdp"ADDLIB" { return ADDLIB; } 4433965Sjdp"ADDMOD" { return ADDMOD; } 4533965Sjdp"CLEAR" { return CLEAR; } 4633965Sjdp"CREATE" { return CREATE; } 4733965Sjdp"DELETE" { return DELETE; } 4833965Sjdp"DIRECTORY" { return DIRECTORY; } 4933965Sjdp"END" { return END; } 5033965Sjdp"EXTRACT" { return EXTRACT; } 5133965Sjdp"FULLDIR" { return FULLDIR; } 5233965Sjdp"HELP" { return HELP; } 5333965Sjdp"LIST" { return LIST; } 5433965Sjdp"OPEN" { return OPEN; } 5533965Sjdp"REPLACE" { return REPLACE; } 5633965Sjdp"VERBOSE" { return VERBOSE; } 5733965Sjdp"SAVE" { return SAVE; } 5833965Sjdp"addlib" { return ADDLIB; } 5933965Sjdp"addmod" { return ADDMOD; } 6033965Sjdp"clear" { return CLEAR; } 6133965Sjdp"create" { return CREATE; } 6233965Sjdp"delete" { return DELETE; } 6333965Sjdp"directory" { return DIRECTORY; } 6433965Sjdp"end" { return END; } 6533965Sjdp"extract" { return EXTRACT; } 6633965Sjdp"fulldir" { return FULLDIR; } 6733965Sjdp"help" { return HELP; } 6833965Sjdp"list" { return LIST; } 6933965Sjdp"open" { return OPEN; } 7033965Sjdp"replace" { return REPLACE; } 7133965Sjdp"verbose" { return VERBOSE; } 7233965Sjdp"save" { return SAVE; } 7333965Sjdp"+\n" { linenumber ++; } 7433965Sjdp"(" { return '('; } 7533965Sjdp")" { return ')'; } 7633965Sjdp"," { return ','; } 7789857Sobrien[A-Za-z0-9/\\$:.\-\_]+ { 7833965Sjdp yylval.name = xstrdup (yytext); 7933965Sjdp return FILENAME; 8033965Sjdp } 8133965Sjdp"*".* { } 8233965Sjdp";".* { } 8333965Sjdp" " { } 8433965Sjdp"\n" { linenumber ++; return NEWLINE; } 8533965Sjdp 8633965Sjdp%% 8733965Sjdp#ifndef yywrap 8833965Sjdp/* Needed for lex, though not flex. */ 89130561Sobrienint yywrap(void) { return 1; } 9033965Sjdp#endif 91