~ubuntu-branches/ubuntu/natty/bc/natty

« back to all changes in this revision

Viewing changes to bc/scan.l

  • Committer: Bazaar Package Importer
  • Author(s): John Hasler
  • Date: 2007-12-02 14:46:56 UTC
  • mto: (3.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20071202144656-vz98qh9dd1zwdyny
Tags: upstream-1.06.94
ImportĀ upstreamĀ versionĀ 1.06.94

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%{
2
 
/* scan.l: the (f)lex description file for the scanner. */
3
 
 
4
1
/*  This file is part of GNU bc.
5
 
    Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
 
2
 
 
3
    Copyright (C) 1991-1994, 1997, 2006 Free Software Foundation, Inc.
6
4
 
7
5
    This program is free software; you can redistribute it and/or modify
8
6
    it under the terms of the GNU General Public License as published by
15
13
    GNU General Public License for more details.
16
14
 
17
15
    You should have received a copy of the GNU General Public License
18
 
    along with this program; see the file COPYING.  If not, write to
 
16
    along with this program; see the file COPYING.  If not, write to:
19
17
      The Free Software Foundation, Inc.
20
 
      59 Temple Place, Suite 330
21
 
      Boston, MA 02111 USA
 
18
      Foundation, Inc.  51 Franklin Street, Fifth Floor,
 
19
      Boston, MA 02110-1301  USA
22
20
 
23
21
    You may contact the author by:
24
22
       e-mail:  philnelson@acm.org
29
27
       
30
28
*************************************************************************/
31
29
 
 
30
/* scan.l: the (f)lex description file for the scanner. */
 
31
 
 
32
%{
 
33
 
32
34
#include "bcdefs.h"
33
35
#include "bc.h"
34
36
#include "global.h"
143
145
 
144
146
/* Definitions for readline access. */
145
147
extern FILE *rl_instream;
146
 
_PROTOTYPE(char *readline, (char *));
147
148
 
148
149
/* rl_input puts upto MAX characters into BUF with the number put in
149
150
   BUF placed in *RESULT.  If the yy input file is the same as
243
244
auto   return(Auto);
244
245
else   return(Else);
245
246
read   return(Read);
 
247
random return(Random);
246
248
halt   return(Halt);
247
249
last   return(Last);
 
250
void   return(Void); 
248
251
history {
249
252
#if defined(READLINE) || defined(LIBEDIT)
250
253
          return(HistoryVar);
269
272
&& { return(AND); }
270
273
\|\| { return(OR); }
271
274
"!" { return(NOT); }
272
 
"*"|"/"|"%" { yylval.c_value = yytext[0]; return((int)yytext[0]); }
 
275
"*"|"/"|"%"|"&" { yylval.c_value = yytext[0]; return((int)yytext[0]); }
273
276
"="|\+=|-=|\*=|\/=|%=|\^=  { yylval.c_value = yytext[0]; return(ASSIGN_OP); }
274
277
=\+|=-|=\*|=\/|=%|=\^  { 
275
278
#ifdef OLD_EQ_OP