Changeset cc94b0a in git for Singular/scanner.l


Ignore:
Timestamp:
Mar 31, 1998, 11:00:50 AM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
bc82d60fa171675a0c23a3e2051318500187aa39
Parents:
c9ea817ef59b4d9f8adaa507840ddb8ff4d4a945
Message:
Tue Mar 31 10:47:06 MET DST 1998 hannes
        * feread.cc: fixed handling of empty history
	* clapsing.cc: fixed gcd(0,..) and gcd(..,0) -> pOne()
	* febase.h/febase.inc: renaming of scanner variables
	  ( yy_blocklineno, yy_noeof)
	* febase.inc: increased speed in feReadLine
	* minor changes in scanner/grammar/iparith.cc (example)


git-svn-id: file:///usr/local/Singular/svn/trunk@1291 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/scanner.l

    rc9ea817 rcc94b0a  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: scanner.l,v 1.9 1998-02-27 14:06:24 Singular Exp $ */
     5/* $Id: scanner.l,v 1.10 1998-03-31 09:00:44 Singular Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    1919#define ALLOC(a) Alloc((a))
    2020int yylineno  = 0;
    21 int noeof = 0;
    2221static int blocknest = 0;
    2322extern char * yytext;
     
    9493^#![^\n]*                { }
    9594pause[ \t\n]*[\.;]       { fePause(); }
    96 while                    { blocknest = 0; noeof = noeof_brace; BEGIN(brace);
     95while                    { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace);
    9796                           return WHILE_CMD;}
    98 for                      { blocknest = 0; noeof = noeof_brace; BEGIN(brace);
     97for                      { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace);
    9998                           return FOR_CMD;}
    10099
    101 ("help"|"?")[ \t\n]*     { noeof = noeof_asstring;
     100("help"|"?")[ \t\n]*     { yy_noeof = noeof_asstring;
    102101                           BEGIN(asstring);
    103102                           return HELP_CMD;
    104                          }
    105 
    106 example[ \t\n]*          { noeof = noeof_asstring;
    107                            IsCmd("example",lvalp->i);
    108                            BEGIN(asstring);
    109                            return EXAMPLE_CMD;
    110103                         }
    111104
     
    113106                           char c; char *cp;
    114107                           lvalp->name = mstrdup(iiProcName((char *)yytext,c,cp));
    115                            noeof = noeof_procname;
     108                           yy_noeof = noeof_procname;
    116109                           blocknest = 1;
    117110                           BEGIN(brace);
     
    120113<asstring>[^;\n]+        {
    121114                           lvalp->name = mstrdup((char *)yytext);
    122                            noeof = 0; BEGIN(INITIAL);
     115                           yy_noeof = 0; BEGIN(INITIAL);
    123116                           return STRINGTOK;
    124117                         }
    125118<asstring>;              {
    126                            noeof = 0; BEGIN(INITIAL);
     119                           yy_noeof = 0; BEGIN(INITIAL);
    127120                           return *yytext;
    128121                         }
    129122
    130123<brace>"\""              {
    131                            noeof = noeof_string;
     124                           yy_noeof = noeof_string;
    132125                           BEGIN(bracestr);
    133126                           yymore();
     
    145138                           if (--blocknest <= 0)
    146139                           {
    147                              noeof = 0;
     140                             yy_noeof = 0;
    148141                             BEGIN(INITIAL);
    149142                             lvalp->name = dupyytext();
     
    153146                         }
    154147<bracestr>"\""           {
    155                            noeof = noeof_brace;
     148                           yy_noeof = noeof_brace;
    156149                           BEGIN(brace);
    157150                           yymore();
     
    170163                         }
    171164<bracket>")"             {
    172                            noeof = 0; BEGIN(INITIAL);
     165                           yy_noeof = 0; BEGIN(INITIAL);
    173166                           return ')';
    174167                         }
    175168
    176169"{"                      {
    177                            blocklineno = yylineno;
     170                           yy_blocklineno = yylineno;
    178171                           blocknest = 1;
    179                            noeof = noeof_block;
     172                           yy_noeof = noeof_block;
    180173                           BEGIN(block);
    181174                         }
    182175<block>"\""              {
    183                            noeof = noeof_string;
     176                           yy_noeof = noeof_string;
    184177                           BEGIN(blockstr);
    185178                           yymore();
     
    189182<blockstr>"\\\""         { yymore(); }
    190183<blockstr>"\""           {
    191                            noeof = noeof_block;
     184                           yy_noeof = noeof_block;
    192185                           BEGIN(block);
    193186                           yymore();
     
    199192                           {
    200193                             BEGIN(INITIAL);
    201                              noeof = 0;
     194                             yy_noeof = 0;
    202195                             lvalp->name = dupyytextNL();
    203196                             return BLOCKTOK;
     
    205198                           yymore();
    206199                         }
    207 "\""                     { BEGIN(string); noeof = noeof_string;}
     200"\""                     { BEGIN(string); yy_noeof = noeof_string;}
    208201~                        { return SYS_BREAK; }
    209202<string>[^\"]            { yymore(); }
     
    212205<string>"\""             {
    213206                           char * s;
    214                            noeof = 0;
     207                           yy_noeof = 0;
    215208                           BEGIN(INITIAL);
    216209                           s = lvalp->name = dupyytext();
Note: See TracChangeset for help on using the changeset viewer.