GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#line 2 "calclex.c"1/* A lexical scanner generated by flex */23/* Scanner skeleton version:4* $Header: /home/cvsfiles/gmp42/demos/calc/calclex.c,v 1.1.1.1 2006/03/14 15:57:54 tege Exp $5*/67#define FLEX_SCANNER8#define YY_FLEX_MAJOR_VERSION 29#define YY_FLEX_MINOR_VERSION 51011#include <stdio.h>12#include <errno.h>1314/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */15#ifdef c_plusplus16#ifndef __cplusplus17#define __cplusplus18#endif19#endif202122#ifdef __cplusplus2324#include <stdlib.h>25#ifndef _WIN3226#include <unistd.h>27#endif2829/* Use prototypes in function declarations. */30#define YY_USE_PROTOS3132/* The "const" storage-class-modifier is valid. */33#define YY_USE_CONST3435#else /* ! __cplusplus */3637#if __STDC__3839#define YY_USE_PROTOS40#define YY_USE_CONST4142#endif /* __STDC__ */43#endif /* ! __cplusplus */4445#ifdef __TURBOC__46#pragma warn -rch47#pragma warn -use48#include <io.h>49#include <stdlib.h>50#define YY_USE_CONST51#define YY_USE_PROTOS52#endif5354#ifdef YY_USE_CONST55#define yyconst const56#else57#define yyconst58#endif596061#ifdef YY_USE_PROTOS62#define YY_PROTO(proto) proto63#else64#define YY_PROTO(proto) ()65#endif6667/* Returned upon end-of-file. */68#define YY_NULL 06970/* Promotes a possibly negative, possibly signed char to an unsigned71* integer for use as an array index. If the signed char is negative,72* we want to instead treat it as an 8-bit unsigned char, hence the73* double cast.74*/75#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)7677/* Enter a start condition. This macro really ought to take a parameter,78* but we do it the disgusting crufty way forced on us by the ()-less79* definition of BEGIN.80*/81#define BEGIN yy_start = 1 + 2 *8283/* Translate the current start state into a value that can be later handed84* to BEGIN to return to the state. The YYSTATE alias is for lex85* compatibility.86*/87#define YY_START ((yy_start - 1) / 2)88#define YYSTATE YY_START8990/* Action number for EOF rule of a given start state. */91#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)9293/* Special action meaning "start processing a new file". */94#define YY_NEW_FILE yyrestart( yyin )9596#define YY_END_OF_BUFFER_CHAR 09798/* Size of default input buffer. */99#define YY_BUF_SIZE 16384100101typedef struct yy_buffer_state *YY_BUFFER_STATE;102103extern int yyleng;104extern FILE *yyin, *yyout;105106#define EOB_ACT_CONTINUE_SCAN 0107#define EOB_ACT_END_OF_FILE 1108#define EOB_ACT_LAST_MATCH 2109110/* The funky do-while in the following #define is used to turn the definition111* int a single C statement (which needs a semi-colon terminator). This112* avoids problems with code like:113*114* if ( condition_holds )115* yyless( 5 );116* else117* do_something_else();118*119* Prior to using the do-while the compiler would get upset at the120* "else" because it interpreted the "if" statement as being all121* done when it reached the ';' after the yyless() call.122*/123124/* Return all but the first 'n' matched characters back to the input stream. */125126#define yyless(n) \127do \128{ \129/* Undo effects of setting up yytext. */ \130*yy_cp = yy_hold_char; \131YY_RESTORE_YY_MORE_OFFSET \132yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \133YY_DO_BEFORE_ACTION; /* set up yytext again */ \134} \135while ( 0 )136137#define unput(c) yyunput( c, yytext_ptr )138139/* The following is because we cannot portably get our hands on size_t140* (without autoconf's help, which isn't available because we want141* flex-generated scanners to compile on their own).142*/143typedef unsigned int yy_size_t;144145146struct yy_buffer_state147{148FILE *yy_input_file;149150char *yy_ch_buf; /* input buffer */151char *yy_buf_pos; /* current position in input buffer */152153/* Size of input buffer in bytes, not including room for EOB154* characters.155*/156yy_size_t yy_buf_size;157158/* Number of characters read into yy_ch_buf, not including EOB159* characters.160*/161int yy_n_chars;162163/* Whether we "own" the buffer - i.e., we know we created it,164* and can realloc() it to grow it, and should free() it to165* delete it.166*/167int yy_is_our_buffer;168169/* Whether this is an "interactive" input source; if so, and170* if we're using stdio for input, then we want to use getc()171* instead of fread(), to make sure we stop fetching input after172* each newline.173*/174int yy_is_interactive;175176/* Whether we're considered to be at the beginning of a line.177* If so, '^' rules will be active on the next match, otherwise178* not.179*/180int yy_at_bol;181182/* Whether to try to fill the input buffer when we reach the183* end of it.184*/185int yy_fill_buffer;186187int yy_buffer_status;188#define YY_BUFFER_NEW 0189#define YY_BUFFER_NORMAL 1190/* When an EOF's been seen but there's still some text to process191* then we mark the buffer as YY_EOF_PENDING, to indicate that we192* shouldn't try reading from the input source any more. We might193* still have a bunch of tokens to match, though, because of194* possible backing-up.195*196* When we actually see the EOF, we change the status to "new"197* (via yyrestart()), so that the user can continue scanning by198* just pointing yyin at a new input file.199*/200#define YY_BUFFER_EOF_PENDING 2201};202203static YY_BUFFER_STATE yy_current_buffer = 0;204205/* We provide macros for accessing buffer states in case in the206* future we want to put the buffer states in a more general207* "scanner state".208*/209#define YY_CURRENT_BUFFER yy_current_buffer210211212/* yy_hold_char holds the character lost when yytext is formed. */213static char yy_hold_char;214215static int yy_n_chars; /* number of characters read into yy_ch_buf */216217218int yyleng;219220/* Points to current character in buffer. */221static char *yy_c_buf_p = (char *) 0;222static int yy_init = 1; /* whether we need to initialize */223static int yy_start = 0; /* start state number */224225/* Flag which is used to allow yywrap()'s to do buffer switches226* instead of setting up a fresh yyin. A bit of a hack ...227*/228static int yy_did_buffer_switch_on_eof;229230void yyrestart YY_PROTO(( FILE *input_file ));231232void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));233void yy_load_buffer_state YY_PROTO(( void ));234YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));235void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));236void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));237void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));238#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )239240YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));241YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));242YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));243244static void *yy_flex_alloc YY_PROTO(( yy_size_t ));245static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));246static void yy_flex_free YY_PROTO(( void * ));247248#define yy_new_buffer yy_create_buffer249250#define yy_set_interactive(is_interactive) \251{ \252if ( ! yy_current_buffer ) \253yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \254yy_current_buffer->yy_is_interactive = is_interactive; \255}256257#define yy_set_bol(at_bol) \258{ \259if ( ! yy_current_buffer ) \260yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \261yy_current_buffer->yy_at_bol = at_bol; \262}263264#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)265266typedef unsigned char YY_CHAR;267FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;268typedef int yy_state_type;269extern char *yytext;270#define yytext_ptr yytext271272static yy_state_type yy_get_previous_state YY_PROTO(( void ));273static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));274static int yy_get_next_buffer YY_PROTO(( void ));275static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));276277/* Done after the current pattern has been matched and before the278* corresponding action - sets up yytext.279*/280#define YY_DO_BEFORE_ACTION \281yytext_ptr = yy_bp; \282yyleng = (int) (yy_cp - yy_bp); \283yy_hold_char = *yy_cp; \284*yy_cp = '\0'; \285yy_c_buf_p = yy_cp;286287#define YY_NUM_RULES 19288#define YY_END_OF_BUFFER 20289static yyconst short int yy_accept[39] =290{ 0,2910, 0, 20, 18, 1, 2, 7, 6, 7, 18,29216, 16, 2, 7, 7, 7, 16, 17, 18, 18,29311, 6, 5, 6, 14, 16, 0, 12, 8, 10,2949, 13, 16, 17, 3, 15, 4, 0295} ;296297static yyconst int yy_ec[256] =298{ 0,2991, 1, 1, 1, 1, 1, 1, 1, 2, 3,3001, 2, 1, 1, 1, 1, 1, 1, 1, 1,3011, 1, 1, 1, 1, 1, 1, 1, 1, 1,3021, 2, 4, 1, 5, 1, 6, 7, 1, 6,3036, 6, 6, 6, 6, 1, 6, 8, 9, 9,3049, 9, 9, 9, 9, 9, 9, 1, 10, 11,30512, 13, 1, 1, 14, 14, 14, 14, 14, 14,30615, 15, 15, 15, 15, 15, 15, 15, 15, 15,30715, 15, 15, 15, 15, 15, 15, 16, 15, 15,3081, 17, 1, 6, 1, 1, 15, 15, 15, 15,30931015, 15, 15, 15, 15, 15, 15, 15, 15, 15,31115, 15, 15, 15, 15, 15, 15, 15, 15, 16,31215, 15, 1, 18, 1, 1, 1, 1, 1, 1,3131, 1, 1, 1, 1, 1, 1, 1, 1, 1,3141, 1, 1, 1, 1, 1, 1, 1, 1, 1,3151, 1, 1, 1, 1, 1, 1, 1, 1, 1,3161, 1, 1, 1, 1, 1, 1, 1, 1, 1,3171, 1, 1, 1, 1, 1, 1, 1, 1, 1,3181, 1, 1, 1, 1, 1, 1, 1, 1, 1,3191, 1, 1, 1, 1, 1, 1, 1, 1, 1,3203211, 1, 1, 1, 1, 1, 1, 1, 1, 1,3221, 1, 1, 1, 1, 1, 1, 1, 1, 1,3231, 1, 1, 1, 1, 1, 1, 1, 1, 1,3241, 1, 1, 1, 1, 1, 1, 1, 1, 1,3251, 1, 1, 1, 1, 1, 1, 1, 1, 1,3261, 1, 1, 1, 1327} ;328329static yyconst int yy_meta[19] =330{ 0,3311, 1, 1, 1, 1, 1, 1, 2, 2, 1,3321, 1, 1, 2, 3, 2, 1, 1333} ;334335static yyconst short int yy_base[43] =336{ 0,3370, 0, 39, 49, 49, 49, 26, 16, 49, 30,33820, 19, 49, 9, 22, 10, 9, 0, 29, 13,33949, 23, 49, 24, 49, 0, 0, 49, 49, 49,34049, 49, 13, 0, 49, 49, 49, 49, 41, 28,34143, 45342} ;343344static yyconst short int yy_def[43] =345{ 0,34638, 1, 38, 38, 38, 38, 38, 39, 38, 38,34740, 40, 38, 38, 38, 38, 41, 42, 38, 38,34838, 39, 38, 39, 38, 12, 12, 38, 38, 38,34938, 38, 41, 42, 38, 38, 38, 0, 38, 38,35038, 38351} ;352353static yyconst short int yy_nxt[68] =354{ 0,3554, 5, 6, 7, 8, 9, 10, 11, 12, 13,35614, 15, 16, 17, 18, 18, 19, 20, 23, 28,35729, 31, 32, 34, 34, 23, 37, 34, 34, 26,35836, 35, 24, 30, 38, 27, 25, 21, 38, 24,35924, 22, 22, 22, 33, 33, 34, 34, 3, 38,36038, 38, 38, 38, 38, 38, 38, 38, 38, 38,36138, 38, 38, 38, 38, 38, 38362} ;363364static yyconst short int yy_chk[68] =365{ 0,3661, 1, 1, 1, 1, 1, 1, 1, 1, 1,3671, 1, 1, 1, 1, 1, 1, 1, 8, 14,36814, 16, 16, 17, 17, 22, 24, 33, 33, 40,36920, 19, 8, 15, 12, 11, 10, 7, 3, 22,37024, 39, 39, 39, 41, 41, 42, 42, 38, 38,37138, 38, 38, 38, 38, 38, 38, 38, 38, 38,37238, 38, 38, 38, 38, 38, 38373} ;374375static yy_state_type yy_last_accepting_state;376static char *yy_last_accepting_cpos;377378/* The intent behind this definition is that it'll catch379* any uses of REJECT which flex missed.380*/381#define REJECT reject_used_but_not_detected382#define yymore() yymore_used_but_not_detected383#define YY_MORE_ADJ 0384#define YY_RESTORE_YY_MORE_OFFSET385char *yytext;386#line 1 "calclex.l"387#define INITIAL 0388/* Lexical analyzer for calc program.389390Copyright 2000, 2001, 2002 Free Software Foundation, Inc.391392This file is part of the GNU MP Library.393394This program is free software; you can redistribute it and/or modify it under395the terms of the GNU General Public License as published by the Free Software396Foundation; either version 2 of the License, or (at your option) any later397version.398399This program is distributed in the hope that it will be useful, but WITHOUT ANY400WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A401PARTICULAR PURPOSE. See the GNU General Public License for more details.402403You should have received a copy of the GNU General Public License along with404this program; if not, write to the Free Software Foundation, Inc., 51 Franklin405Street, Fifth Floor, Boston, MA 02110-1301, USA. */406#line 21 "calclex.l"407#include <string.h>408#include "calc-common.h"409410411#if WITH_READLINE412/* Let GNU flex use readline. See the calcread.c redefined input() for a413way that might work for a standard lex too. */414#define YY_INPUT(buf,result,max_size) \415result = calc_input (buf, max_size);416#endif417418419/* Non-zero when reading the second or subsequent line of an expression,420used to give a different prompt when using readline. */421int calc_more_input = 0;422423424const struct calc_keywords_t calc_keywords[] = {425{ "abs", ABS },426{ "bin", BIN },427{ "decimal", DECIMAL },428{ "fib", FIB },429{ "hex", HEX },430{ "help", HELP },431{ "gcd", GCD },432{ "kron", KRON },433{ "lcm", LCM },434{ "lucnum", LUCNUM },435{ "nextprime", NEXTPRIME },436{ "powm", POWM },437{ "quit", QUIT },438{ "root", ROOT },439{ "sqrt", SQRT },440{ NULL }441};442#line 444 "calclex.c"443444/* Macros after this point can all be overridden by user definitions in445* section 1.446*/447448#ifndef YY_SKIP_YYWRAP449#ifdef __cplusplus450extern "C" int yywrap YY_PROTO(( void ));451#else452extern int yywrap YY_PROTO(( void ));453#endif454#endif455456#ifndef YY_NO_UNPUT457static void yyunput YY_PROTO(( int c, char *buf_ptr ));458#endif459460#ifndef yytext_ptr461static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));462#endif463464#ifdef YY_NEED_STRLEN465static int yy_flex_strlen YY_PROTO(( yyconst char * ));466#endif467468#ifndef YY_NO_INPUT469#ifdef __cplusplus470static int yyinput YY_PROTO(( void ));471#else472static int input YY_PROTO(( void ));473#endif474#endif475476#if YY_STACK_USED477static int yy_start_stack_ptr = 0;478static int yy_start_stack_depth = 0;479static int *yy_start_stack = 0;480#ifndef YY_NO_PUSH_STATE481static void yy_push_state YY_PROTO(( int new_state ));482#endif483#ifndef YY_NO_POP_STATE484static void yy_pop_state YY_PROTO(( void ));485#endif486#ifndef YY_NO_TOP_STATE487static int yy_top_state YY_PROTO(( void ));488#endif489490#else491#define YY_NO_PUSH_STATE 1492#define YY_NO_POP_STATE 1493#define YY_NO_TOP_STATE 1494#endif495496#ifdef YY_MALLOC_DECL497YY_MALLOC_DECL498#else499#if __STDC__500#ifndef __cplusplus501#include <stdlib.h>502#endif503#else504/* Just try to get by without declaring the routines. This will fail505* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)506* or sizeof(void*) != sizeof(int).507*/508#endif509#endif510511/* Amount of stuff to slurp up with each read. */512#ifndef YY_READ_BUF_SIZE513#define YY_READ_BUF_SIZE 8192514#endif515516/* Copy whatever the last rule matched to the standard output. */517518#ifndef ECHO519/* This used to be an fputs(), but since the string might contain NUL's,520* we now use fwrite().521*/522#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )523#endif524525/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,526* is returned in "result".527*/528#ifndef YY_INPUT529#define YY_INPUT(buf,result,max_size) \530if ( yy_current_buffer->yy_is_interactive ) \531{ \532int c = '*', n; \533for ( n = 0; n < max_size && \534(c = getc( yyin )) != EOF && c != '\n'; ++n ) \535buf[n] = (char) c; \536if ( c == '\n' ) \537buf[n++] = (char) c; \538if ( c == EOF && ferror( yyin ) ) \539YY_FATAL_ERROR( "input in flex scanner failed" ); \540result = n; \541} \542else \543{ \544errno=0; \545while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \546{ \547if( errno != EINTR) \548{ \549YY_FATAL_ERROR( "input in flex scanner failed" ); \550break; \551} \552errno=0; \553clearerr(yyin); \554} \555}556#endif557558/* No semi-colon after return; correct usage is to write "yyterminate();" -559* we don't want an extra ';' after the "return" because that will cause560* some compilers to complain about unreachable statements.561*/562#ifndef yyterminate563#define yyterminate() return YY_NULL564#endif565566/* Number of entries by which start-condition stack grows. */567#ifndef YY_START_STACK_INCR568#define YY_START_STACK_INCR 25569#endif570571/* Report a fatal error. */572#ifndef YY_FATAL_ERROR573#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )574#endif575576/* Default declaration of generated scanner - a define so the user can577* easily add parameters.578*/579#ifndef YY_DECL580#define YY_DECL int yylex YY_PROTO(( void ))581#endif582583/* Code executed at the beginning of each rule, after yytext and yyleng584* have been set up.585*/586#ifndef YY_USER_ACTION587#define YY_USER_ACTION588#endif589590/* Code executed at the end of each rule. */591#ifndef YY_BREAK592#define YY_BREAK break;593#endif594595#define YY_RULE_SETUP \596YY_USER_ACTION597598YY_DECL599{600register yy_state_type yy_current_state;601register char *yy_cp, *yy_bp;602register int yy_act;603604#line 58 "calclex.l"605606607#line 609 "calclex.c"608609if ( yy_init )610{611yy_init = 0;612613#ifdef YY_USER_INIT614YY_USER_INIT;615#endif616617if ( ! yy_start )618yy_start = 1; /* first start state */619620if ( ! yyin )621yyin = stdin;622623if ( ! yyout )624yyout = stdout;625626if ( ! yy_current_buffer )627yy_current_buffer =628yy_create_buffer( yyin, YY_BUF_SIZE );629630yy_load_buffer_state();631}632633while ( 1 ) /* loops until end-of-file is reached */634{635yy_cp = yy_c_buf_p;636637/* Support of yytext. */638*yy_cp = yy_hold_char;639640/* yy_bp points to the position in yy_ch_buf of the start of641* the current run.642*/643yy_bp = yy_cp;644645yy_current_state = yy_start;646yy_match:647do648{649register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];650if ( yy_accept[yy_current_state] )651{652yy_last_accepting_state = yy_current_state;653yy_last_accepting_cpos = yy_cp;654}655while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )656{657yy_current_state = (int) yy_def[yy_current_state];658if ( yy_current_state >= 39 )659yy_c = yy_meta[(unsigned int) yy_c];660}661yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];662++yy_cp;663}664while ( yy_base[yy_current_state] != 49 );665666yy_find_action:667yy_act = yy_accept[yy_current_state];668if ( yy_act == 0 )669{ /* have to back up */670yy_cp = yy_last_accepting_cpos;671yy_current_state = yy_last_accepting_state;672yy_act = yy_accept[yy_current_state];673}674675YY_DO_BEFORE_ACTION;676677678do_action: /* This label is used only to access EOF actions. */679680681switch ( yy_act )682{ /* beginning of action switch */683case 0: /* must back up */684/* undo the effects of YY_DO_BEFORE_ACTION */685*yy_cp = yy_hold_char;686yy_cp = yy_last_accepting_cpos;687yy_current_state = yy_last_accepting_state;688goto yy_find_action;689690case 1:691YY_RULE_SETUP692#line 60 "calclex.l"693{ /* white space is skipped */ }694YY_BREAK695case 2:696YY_RULE_SETUP697#line 62 "calclex.l"698{ /* semicolon or newline separates statements */699calc_more_input = 0;700return EOS; }701YY_BREAK702case 3:703YY_RULE_SETUP704#line 65 "calclex.l"705{ /* escaped newlines are skipped */ }706YY_BREAK707case 4:708YY_RULE_SETUP709#line 68 "calclex.l"710{711/* comment through to escaped newline is skipped */ }712YY_BREAK713case 5:714YY_RULE_SETUP715#line 70 "calclex.l"716{ /* comment through to newline is a separator */717calc_more_input = 0;718return EOS; }719YY_BREAK720case 6:721YY_RULE_SETUP722#line 73 "calclex.l"723{ /* comment through to EOF skipped */ }724YY_BREAK725case 7:726YY_RULE_SETUP727#line 76 "calclex.l"728{ return yytext[0]; }729YY_BREAK730case 8:731YY_RULE_SETUP732#line 77 "calclex.l"733{ return LE; }734YY_BREAK735case 9:736YY_RULE_SETUP737#line 78 "calclex.l"738{ return GE; }739YY_BREAK740case 10:741YY_RULE_SETUP742#line 79 "calclex.l"743{ return EQ; }744YY_BREAK745case 11:746YY_RULE_SETUP747#line 80 "calclex.l"748{ return NE; }749YY_BREAK750case 12:751YY_RULE_SETUP752#line 81 "calclex.l"753{ return LSHIFT; }754YY_BREAK755case 13:756YY_RULE_SETUP757#line 82 "calclex.l"758{ return RSHIFT; }759YY_BREAK760case 14:761YY_RULE_SETUP762#line 83 "calclex.l"763{ return LAND; }764YY_BREAK765case 15:766YY_RULE_SETUP767#line 84 "calclex.l"768{ return LOR; }769YY_BREAK770case 16:771YY_RULE_SETUP772#line 86 "calclex.l"773{774yylval.str = yytext;775return NUMBER; }776YY_BREAK777case 17:778YY_RULE_SETUP779#line 90 "calclex.l"780{781int i;782783for (i = 0; calc_keywords[i].name != NULL; i++)784if (strcmp (yytext, calc_keywords[i].name) == 0)785return calc_keywords[i].value;786787if (yytext[0] >= 'a' && yytext[0] <= 'z' && yytext[1] == '\0')788{789yylval.var = yytext[0] - 'a';790return VARIABLE;791}792793return BAD;794}795YY_BREAK796case 18:797YY_RULE_SETUP798#line 106 "calclex.l"799{ return BAD; }800YY_BREAK801case 19:802YY_RULE_SETUP803#line 108 "calclex.l"804ECHO;805YY_BREAK806#line 808 "calclex.c"807case YY_STATE_EOF(INITIAL):808yyterminate();809810case YY_END_OF_BUFFER:811{812/* Amount of text matched not including the EOB char. */813int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;814815/* Undo the effects of YY_DO_BEFORE_ACTION. */816*yy_cp = yy_hold_char;817YY_RESTORE_YY_MORE_OFFSET818819if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )820{821/* We're scanning a new file or input source. It's822* possible that this happened because the user823* just pointed yyin at a new source and called824* yylex(). If so, then we have to assure825* consistency between yy_current_buffer and our826* globals. Here is the right place to do so, because827* this is the first action (other than possibly a828* back-up) that will match for the new input source.829*/830yy_n_chars = yy_current_buffer->yy_n_chars;831yy_current_buffer->yy_input_file = yyin;832yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;833}834835/* Note that here we test for yy_c_buf_p "<=" to the position836* of the first EOB in the buffer, since yy_c_buf_p will837* already have been incremented past the NUL character838* (since all states make transitions on EOB to the839* end-of-buffer state). Contrast this with the test840* in input().841*/842if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )843{ /* This was really a NUL. */844yy_state_type yy_next_state;845846yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;847848yy_current_state = yy_get_previous_state();849850/* Okay, we're now positioned to make the NUL851* transition. We couldn't have852* yy_get_previous_state() go ahead and do it853* for us because it doesn't know how to deal854* with the possibility of jamming (and we don't855* want to build jamming into it because then it856* will run more slowly).857*/858859yy_next_state = yy_try_NUL_trans( yy_current_state );860861yy_bp = yytext_ptr + YY_MORE_ADJ;862863if ( yy_next_state )864{865/* Consume the NUL. */866yy_cp = ++yy_c_buf_p;867yy_current_state = yy_next_state;868goto yy_match;869}870871else872{873yy_cp = yy_c_buf_p;874goto yy_find_action;875}876}877878else switch ( yy_get_next_buffer() )879{880case EOB_ACT_END_OF_FILE:881{882yy_did_buffer_switch_on_eof = 0;883884if ( yywrap() )885{886/* Note: because we've taken care in887* yy_get_next_buffer() to have set up888* yytext, we can now set up889* yy_c_buf_p so that if some total890* hoser (like flex itself) wants to891* call the scanner after we return the892* YY_NULL, it'll still work - another893* YY_NULL will get returned.894*/895yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;896897yy_act = YY_STATE_EOF(YY_START);898goto do_action;899}900901else902{903if ( ! yy_did_buffer_switch_on_eof )904YY_NEW_FILE;905}906break;907}908909case EOB_ACT_CONTINUE_SCAN:910yy_c_buf_p =911yytext_ptr + yy_amount_of_matched_text;912913yy_current_state = yy_get_previous_state();914915yy_cp = yy_c_buf_p;916yy_bp = yytext_ptr + YY_MORE_ADJ;917goto yy_match;918919case EOB_ACT_LAST_MATCH:920yy_c_buf_p =921&yy_current_buffer->yy_ch_buf[yy_n_chars];922923yy_current_state = yy_get_previous_state();924925yy_cp = yy_c_buf_p;926yy_bp = yytext_ptr + YY_MORE_ADJ;927goto yy_find_action;928}929break;930}931932default:933YY_FATAL_ERROR(934"fatal flex scanner internal error--no action found" );935} /* end of action switch */936} /* end of scanning one token */937} /* end of yylex */938939940/* yy_get_next_buffer - try to read in a new buffer941*942* Returns a code representing an action:943* EOB_ACT_LAST_MATCH -944* EOB_ACT_CONTINUE_SCAN - continue scanning from current position945* EOB_ACT_END_OF_FILE - end of file946*/947948static int yy_get_next_buffer()949{950register char *dest = yy_current_buffer->yy_ch_buf;951register char *source = yytext_ptr;952register int number_to_move, i;953int ret_val;954955if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )956YY_FATAL_ERROR(957"fatal flex scanner internal error--end of buffer missed" );958959if ( yy_current_buffer->yy_fill_buffer == 0 )960{ /* Don't try to fill the buffer, so this is an EOF. */961if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )962{963/* We matched a single character, the EOB, so964* treat this as a final EOF.965*/966return EOB_ACT_END_OF_FILE;967}968969else970{971/* We matched some text prior to the EOB, first972* process it.973*/974return EOB_ACT_LAST_MATCH;975}976}977978/* Try to read more data. */979980/* First move last chars to start of buffer. */981number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;982983for ( i = 0; i < number_to_move; ++i )984*(dest++) = *(source++);985986if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )987/* don't do the read, it's not guaranteed to return an EOF,988* just force an EOF989*/990yy_current_buffer->yy_n_chars = yy_n_chars = 0;991992else993{994int num_to_read =995yy_current_buffer->yy_buf_size - number_to_move - 1;996997while ( num_to_read <= 0 )998{ /* Not enough room in the buffer - grow it. */999#ifdef YY_USES_REJECT1000YY_FATAL_ERROR(1001"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );1002#else10031004/* just a shorter name for the current buffer */1005YY_BUFFER_STATE b = yy_current_buffer;10061007int yy_c_buf_p_offset =1008(int) (yy_c_buf_p - b->yy_ch_buf);10091010if ( b->yy_is_our_buffer )1011{1012int new_size = b->yy_buf_size * 2;10131014if ( new_size <= 0 )1015b->yy_buf_size += b->yy_buf_size / 8;1016else1017b->yy_buf_size *= 2;10181019b->yy_ch_buf = (char *)1020/* Include room in for 2 EOB chars. */1021yy_flex_realloc( (void *) b->yy_ch_buf,1022b->yy_buf_size + 2 );1023}1024else1025/* Can't grow it, we don't own it. */1026b->yy_ch_buf = 0;10271028if ( ! b->yy_ch_buf )1029YY_FATAL_ERROR(1030"fatal error - scanner input buffer overflow" );10311032yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];10331034num_to_read = yy_current_buffer->yy_buf_size -1035number_to_move - 1;1036#endif1037}10381039if ( num_to_read > YY_READ_BUF_SIZE )1040num_to_read = YY_READ_BUF_SIZE;10411042/* Read in more data. */1043YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),1044yy_n_chars, num_to_read );10451046yy_current_buffer->yy_n_chars = yy_n_chars;1047}10481049if ( yy_n_chars == 0 )1050{1051if ( number_to_move == YY_MORE_ADJ )1052{1053ret_val = EOB_ACT_END_OF_FILE;1054yyrestart( yyin );1055}10561057else1058{1059ret_val = EOB_ACT_LAST_MATCH;1060yy_current_buffer->yy_buffer_status =1061YY_BUFFER_EOF_PENDING;1062}1063}10641065else1066ret_val = EOB_ACT_CONTINUE_SCAN;10671068yy_n_chars += number_to_move;1069yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;1070yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;10711072yytext_ptr = &yy_current_buffer->yy_ch_buf[0];10731074return ret_val;1075}107610771078/* yy_get_previous_state - get the state just before the EOB char was reached */10791080static yy_state_type yy_get_previous_state()1081{1082register yy_state_type yy_current_state;1083register char *yy_cp;10841085yy_current_state = yy_start;10861087for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )1088{1089register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);1090if ( yy_accept[yy_current_state] )1091{1092yy_last_accepting_state = yy_current_state;1093yy_last_accepting_cpos = yy_cp;1094}1095while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )1096{1097yy_current_state = (int) yy_def[yy_current_state];1098if ( yy_current_state >= 39 )1099yy_c = yy_meta[(unsigned int) yy_c];1100}1101yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];1102}11031104return yy_current_state;1105}110611071108/* yy_try_NUL_trans - try to make a transition on the NUL character1109*1110* synopsis1111* next_state = yy_try_NUL_trans( current_state );1112*/11131114#ifdef YY_USE_PROTOS1115static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )1116#else1117static yy_state_type yy_try_NUL_trans( yy_current_state )1118yy_state_type yy_current_state;1119#endif1120{1121register int yy_is_jam;1122register char *yy_cp = yy_c_buf_p;11231124register YY_CHAR yy_c = 1;1125if ( yy_accept[yy_current_state] )1126{1127yy_last_accepting_state = yy_current_state;1128yy_last_accepting_cpos = yy_cp;1129}1130while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )1131{1132yy_current_state = (int) yy_def[yy_current_state];1133if ( yy_current_state >= 39 )1134yy_c = yy_meta[(unsigned int) yy_c];1135}1136yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];1137yy_is_jam = (yy_current_state == 38);11381139return yy_is_jam ? 0 : yy_current_state;1140}114111421143#ifndef YY_NO_UNPUT1144#ifdef YY_USE_PROTOS1145static void yyunput( int c, register char *yy_bp )1146#else1147static void yyunput( c, yy_bp )1148int c;1149register char *yy_bp;1150#endif1151{1152register char *yy_cp = yy_c_buf_p;11531154/* undo effects of setting up yytext */1155*yy_cp = yy_hold_char;11561157if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )1158{ /* need to shift things up to make room */1159/* +2 for EOB chars. */1160register int number_to_move = yy_n_chars + 2;1161register char *dest = &yy_current_buffer->yy_ch_buf[1162yy_current_buffer->yy_buf_size + 2];1163register char *source =1164&yy_current_buffer->yy_ch_buf[number_to_move];11651166while ( source > yy_current_buffer->yy_ch_buf )1167*--dest = *--source;11681169yy_cp += (int) (dest - source);1170yy_bp += (int) (dest - source);1171yy_current_buffer->yy_n_chars =1172yy_n_chars = yy_current_buffer->yy_buf_size;11731174if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )1175YY_FATAL_ERROR( "flex scanner push-back overflow" );1176}11771178*--yy_cp = (char) c;117911801181yytext_ptr = yy_bp;1182yy_hold_char = *yy_cp;1183yy_c_buf_p = yy_cp;1184}1185#endif /* ifndef YY_NO_UNPUT */118611871188#ifdef __cplusplus1189static int yyinput()1190#else1191static int input()1192#endif1193{1194int c;11951196*yy_c_buf_p = yy_hold_char;11971198if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )1199{1200/* yy_c_buf_p now points to the character we want to return.1201* If this occurs *before* the EOB characters, then it's a1202* valid NUL; if not, then we've hit the end of the buffer.1203*/1204if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )1205/* This was really a NUL. */1206*yy_c_buf_p = '\0';12071208else1209{ /* need more input */1210int offset = yy_c_buf_p - yytext_ptr;1211++yy_c_buf_p;12121213switch ( yy_get_next_buffer() )1214{1215case EOB_ACT_LAST_MATCH:1216/* This happens because yy_g_n_b()1217* sees that we've accumulated a1218* token and flags that we need to1219* try matching the token before1220* proceeding. But for input(),1221* there's no matching to consider.1222* So convert the EOB_ACT_LAST_MATCH1223* to EOB_ACT_END_OF_FILE.1224*/12251226/* Reset buffer status. */1227yyrestart( yyin );12281229/* fall through */12301231case EOB_ACT_END_OF_FILE:1232{1233if ( yywrap() )1234return EOF;12351236if ( ! yy_did_buffer_switch_on_eof )1237YY_NEW_FILE;1238#ifdef __cplusplus1239return yyinput();1240#else1241return input();1242#endif1243}12441245case EOB_ACT_CONTINUE_SCAN:1246yy_c_buf_p = yytext_ptr + offset;1247break;1248}1249}1250}12511252c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */1253*yy_c_buf_p = '\0'; /* preserve yytext */1254yy_hold_char = *++yy_c_buf_p;125512561257return c;1258}125912601261#ifdef YY_USE_PROTOS1262void yyrestart( FILE *input_file )1263#else1264void yyrestart( input_file )1265FILE *input_file;1266#endif1267{1268if ( ! yy_current_buffer )1269yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );12701271yy_init_buffer( yy_current_buffer, input_file );1272yy_load_buffer_state();1273}127412751276#ifdef YY_USE_PROTOS1277void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )1278#else1279void yy_switch_to_buffer( new_buffer )1280YY_BUFFER_STATE new_buffer;1281#endif1282{1283if ( yy_current_buffer == new_buffer )1284return;12851286if ( yy_current_buffer )1287{1288/* Flush out information for old buffer. */1289*yy_c_buf_p = yy_hold_char;1290yy_current_buffer->yy_buf_pos = yy_c_buf_p;1291yy_current_buffer->yy_n_chars = yy_n_chars;1292}12931294yy_current_buffer = new_buffer;1295yy_load_buffer_state();12961297/* We don't actually know whether we did this switch during1298* EOF (yywrap()) processing, but the only time this flag1299* is looked at is after yywrap() is called, so it's safe1300* to go ahead and always set it.1301*/1302yy_did_buffer_switch_on_eof = 1;1303}130413051306#ifdef YY_USE_PROTOS1307void yy_load_buffer_state( void )1308#else1309void yy_load_buffer_state()1310#endif1311{1312yy_n_chars = yy_current_buffer->yy_n_chars;1313yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;1314yyin = yy_current_buffer->yy_input_file;1315yy_hold_char = *yy_c_buf_p;1316}131713181319#ifdef YY_USE_PROTOS1320YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )1321#else1322YY_BUFFER_STATE yy_create_buffer( file, size )1323FILE *file;1324int size;1325#endif1326{1327YY_BUFFER_STATE b;13281329b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );1330if ( ! b )1331YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );13321333b->yy_buf_size = size;13341335/* yy_ch_buf has to be 2 characters longer than the size given because1336* we need to put in 2 end-of-buffer characters.1337*/1338b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );1339if ( ! b->yy_ch_buf )1340YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );13411342b->yy_is_our_buffer = 1;13431344yy_init_buffer( b, file );13451346return b;1347}134813491350#ifdef YY_USE_PROTOS1351void yy_delete_buffer( YY_BUFFER_STATE b )1352#else1353void yy_delete_buffer( b )1354YY_BUFFER_STATE b;1355#endif1356{1357if ( ! b )1358return;13591360if ( b == yy_current_buffer )1361yy_current_buffer = (YY_BUFFER_STATE) 0;13621363if ( b->yy_is_our_buffer )1364yy_flex_free( (void *) b->yy_ch_buf );13651366yy_flex_free( (void *) b );1367}136813691370#ifndef _WIN321371#include <unistd.h>1372#else1373#ifndef YY_ALWAYS_INTERACTIVE1374#ifndef YY_NEVER_INTERACTIVE1375extern int isatty YY_PROTO(( int ));1376#endif1377#endif1378#endif13791380#ifdef YY_USE_PROTOS1381void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )1382#else1383void yy_init_buffer( b, file )1384YY_BUFFER_STATE b;1385FILE *file;1386#endif138713881389{1390yy_flush_buffer( b );13911392b->yy_input_file = file;1393b->yy_fill_buffer = 1;13941395#if YY_ALWAYS_INTERACTIVE1396b->yy_is_interactive = 1;1397#else1398#if YY_NEVER_INTERACTIVE1399b->yy_is_interactive = 0;1400#else1401b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;1402#endif1403#endif1404}140514061407#ifdef YY_USE_PROTOS1408void yy_flush_buffer( YY_BUFFER_STATE b )1409#else1410void yy_flush_buffer( b )1411YY_BUFFER_STATE b;1412#endif14131414{1415if ( ! b )1416return;14171418b->yy_n_chars = 0;14191420/* We always need two end-of-buffer characters. The first causes1421* a transition to the end-of-buffer state. The second causes1422* a jam in that state.1423*/1424b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;1425b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;14261427b->yy_buf_pos = &b->yy_ch_buf[0];14281429b->yy_at_bol = 1;1430b->yy_buffer_status = YY_BUFFER_NEW;14311432if ( b == yy_current_buffer )1433yy_load_buffer_state();1434}143514361437#ifndef YY_NO_SCAN_BUFFER1438#ifdef YY_USE_PROTOS1439YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )1440#else1441YY_BUFFER_STATE yy_scan_buffer( base, size )1442char *base;1443yy_size_t size;1444#endif1445{1446YY_BUFFER_STATE b;14471448if ( size < 2 ||1449base[size-2] != YY_END_OF_BUFFER_CHAR ||1450base[size-1] != YY_END_OF_BUFFER_CHAR )1451/* They forgot to leave room for the EOB's. */1452return 0;14531454b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );1455if ( ! b )1456YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );14571458b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */1459b->yy_buf_pos = b->yy_ch_buf = base;1460b->yy_is_our_buffer = 0;1461b->yy_input_file = 0;1462b->yy_n_chars = b->yy_buf_size;1463b->yy_is_interactive = 0;1464b->yy_at_bol = 1;1465b->yy_fill_buffer = 0;1466b->yy_buffer_status = YY_BUFFER_NEW;14671468yy_switch_to_buffer( b );14691470return b;1471}1472#endif147314741475#ifndef YY_NO_SCAN_STRING1476#ifdef YY_USE_PROTOS1477YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )1478#else1479YY_BUFFER_STATE yy_scan_string( yy_str )1480yyconst char *yy_str;1481#endif1482{1483int len;1484for ( len = 0; yy_str[len]; ++len )1485;14861487return yy_scan_bytes( yy_str, len );1488}1489#endif149014911492#ifndef YY_NO_SCAN_BYTES1493#ifdef YY_USE_PROTOS1494YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )1495#else1496YY_BUFFER_STATE yy_scan_bytes( bytes, len )1497yyconst char *bytes;1498int len;1499#endif1500{1501YY_BUFFER_STATE b;1502char *buf;1503yy_size_t n;1504int i;15051506/* Get memory for full buffer, including space for trailing EOB's. */1507n = len + 2;1508buf = (char *) yy_flex_alloc( n );1509if ( ! buf )1510YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );15111512for ( i = 0; i < len; ++i )1513buf[i] = bytes[i];15141515buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;15161517b = yy_scan_buffer( buf, n );1518if ( ! b )1519YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );15201521/* It's okay to grow etc. this buffer, and we should throw it1522* away when we're done.1523*/1524b->yy_is_our_buffer = 1;15251526return b;1527}1528#endif152915301531#ifndef YY_NO_PUSH_STATE1532#ifdef YY_USE_PROTOS1533static void yy_push_state( int new_state )1534#else1535static void yy_push_state( new_state )1536int new_state;1537#endif1538{1539if ( yy_start_stack_ptr >= yy_start_stack_depth )1540{1541yy_size_t new_size;15421543yy_start_stack_depth += YY_START_STACK_INCR;1544new_size = yy_start_stack_depth * sizeof( int );15451546if ( ! yy_start_stack )1547yy_start_stack = (int *) yy_flex_alloc( new_size );15481549else1550yy_start_stack = (int *) yy_flex_realloc(1551(void *) yy_start_stack, new_size );15521553if ( ! yy_start_stack )1554YY_FATAL_ERROR(1555"out of memory expanding start-condition stack" );1556}15571558yy_start_stack[yy_start_stack_ptr++] = YY_START;15591560BEGIN(new_state);1561}1562#endif156315641565#ifndef YY_NO_POP_STATE1566static void yy_pop_state()1567{1568if ( --yy_start_stack_ptr < 0 )1569YY_FATAL_ERROR( "start-condition stack underflow" );15701571BEGIN(yy_start_stack[yy_start_stack_ptr]);1572}1573#endif157415751576#ifndef YY_NO_TOP_STATE1577static int yy_top_state()1578{1579return yy_start_stack[yy_start_stack_ptr - 1];1580}1581#endif15821583#ifndef YY_EXIT_FAILURE1584#define YY_EXIT_FAILURE 21585#endif15861587#ifdef YY_USE_PROTOS1588static void yy_fatal_error( yyconst char msg[] )1589#else1590static void yy_fatal_error( msg )1591char msg[];1592#endif1593{1594(void) fprintf( stderr, "%s\n", msg );1595exit( YY_EXIT_FAILURE );1596}1597159815991600/* Redefine yyless() so it works in section 3 code. */16011602#undef yyless1603#define yyless(n) \1604do \1605{ \1606/* Undo effects of setting up yytext. */ \1607yytext[yyleng] = yy_hold_char; \1608yy_c_buf_p = yytext + n; \1609yy_hold_char = *yy_c_buf_p; \1610*yy_c_buf_p = '\0'; \1611yyleng = n; \1612} \1613while ( 0 )161416151616/* Internal utility routines. */16171618#ifndef yytext_ptr1619#ifdef YY_USE_PROTOS1620static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )1621#else1622static void yy_flex_strncpy( s1, s2, n )1623char *s1;1624yyconst char *s2;1625int n;1626#endif1627{1628register int i;1629for ( i = 0; i < n; ++i )1630s1[i] = s2[i];1631}1632#endif16331634#ifdef YY_NEED_STRLEN1635#ifdef YY_USE_PROTOS1636static int yy_flex_strlen( yyconst char *s )1637#else1638static int yy_flex_strlen( s )1639yyconst char *s;1640#endif1641{1642register int n;1643for ( n = 0; s[n]; ++n )1644;16451646return n;1647}1648#endif164916501651#ifdef YY_USE_PROTOS1652static void *yy_flex_alloc( yy_size_t size )1653#else1654static void *yy_flex_alloc( size )1655yy_size_t size;1656#endif1657{1658return (void *) malloc( size );1659}16601661#ifdef YY_USE_PROTOS1662static void *yy_flex_realloc( void *ptr, yy_size_t size )1663#else1664static void *yy_flex_realloc( ptr, size )1665void *ptr;1666yy_size_t size;1667#endif1668{1669/* The cast to (char *) in the following accommodates both1670* implementations that use char* generic pointers, and those1671* that use void* generic pointers. It works with the latter1672* because both ANSI C and C++ allow castless assignment from1673* any pointer type to void*, and deal with argument conversions1674* as though doing an assignment.1675*/1676return (void *) realloc( (char *) ptr, size );1677}16781679#ifdef YY_USE_PROTOS1680static void yy_flex_free( void *ptr )1681#else1682static void yy_flex_free( ptr )1683void *ptr;1684#endif1685{1686free( ptr );1687}16881689#if YY_MAIN1690int main()1691{1692yylex();1693return 0;1694}1695#endif1696#line 108 "calclex.l"169716981699int1700yywrap ()1701{1702return 1;1703}170417051706