Changeset cc94b0a in git for Singular/scanner.l
- Timestamp:
- Mar 31, 1998, 11:00:50 AM (26 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- bc82d60fa171675a0c23a3e2051318500187aa39
- Parents:
- c9ea817ef59b4d9f8adaa507840ddb8ff4d4a945
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/scanner.l
rc9ea817 rcc94b0a 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 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 $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 19 19 #define ALLOC(a) Alloc((a)) 20 20 int yylineno = 0; 21 int noeof = 0;22 21 static int blocknest = 0; 23 22 extern char * yytext; … … 94 93 ^#![^\n]* { } 95 94 pause[ \t\n]*[\.;] { fePause(); } 96 while { blocknest = 0; noeof = noeof_brace; BEGIN(brace);95 while { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace); 97 96 return WHILE_CMD;} 98 for { blocknest = 0; noeof = noeof_brace; BEGIN(brace);97 for { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace); 99 98 return FOR_CMD;} 100 99 101 ("help"|"?")[ \t\n]* { noeof = noeof_asstring;100 ("help"|"?")[ \t\n]* { yy_noeof = noeof_asstring; 102 101 BEGIN(asstring); 103 102 return HELP_CMD; 104 }105 106 example[ \t\n]* { noeof = noeof_asstring;107 IsCmd("example",lvalp->i);108 BEGIN(asstring);109 return EXAMPLE_CMD;110 103 } 111 104 … … 113 106 char c; char *cp; 114 107 lvalp->name = mstrdup(iiProcName((char *)yytext,c,cp)); 115 noeof = noeof_procname;108 yy_noeof = noeof_procname; 116 109 blocknest = 1; 117 110 BEGIN(brace); … … 120 113 <asstring>[^;\n]+ { 121 114 lvalp->name = mstrdup((char *)yytext); 122 noeof = 0; BEGIN(INITIAL);115 yy_noeof = 0; BEGIN(INITIAL); 123 116 return STRINGTOK; 124 117 } 125 118 <asstring>; { 126 noeof = 0; BEGIN(INITIAL);119 yy_noeof = 0; BEGIN(INITIAL); 127 120 return *yytext; 128 121 } 129 122 130 123 <brace>"\"" { 131 noeof = noeof_string;124 yy_noeof = noeof_string; 132 125 BEGIN(bracestr); 133 126 yymore(); … … 145 138 if (--blocknest <= 0) 146 139 { 147 noeof = 0;140 yy_noeof = 0; 148 141 BEGIN(INITIAL); 149 142 lvalp->name = dupyytext(); … … 153 146 } 154 147 <bracestr>"\"" { 155 noeof = noeof_brace;148 yy_noeof = noeof_brace; 156 149 BEGIN(brace); 157 150 yymore(); … … 170 163 } 171 164 <bracket>")" { 172 noeof = 0; BEGIN(INITIAL);165 yy_noeof = 0; BEGIN(INITIAL); 173 166 return ')'; 174 167 } 175 168 176 169 "{" { 177 blocklineno = yylineno;170 yy_blocklineno = yylineno; 178 171 blocknest = 1; 179 noeof = noeof_block;172 yy_noeof = noeof_block; 180 173 BEGIN(block); 181 174 } 182 175 <block>"\"" { 183 noeof = noeof_string;176 yy_noeof = noeof_string; 184 177 BEGIN(blockstr); 185 178 yymore(); … … 189 182 <blockstr>"\\\"" { yymore(); } 190 183 <blockstr>"\"" { 191 noeof = noeof_block;184 yy_noeof = noeof_block; 192 185 BEGIN(block); 193 186 yymore(); … … 199 192 { 200 193 BEGIN(INITIAL); 201 noeof = 0;194 yy_noeof = 0; 202 195 lvalp->name = dupyytextNL(); 203 196 return BLOCKTOK; … … 205 198 yymore(); 206 199 } 207 "\"" { BEGIN(string); noeof = noeof_string;}200 "\"" { BEGIN(string); yy_noeof = noeof_string;} 208 201 ~ { return SYS_BREAK; } 209 202 <string>[^\"] { yymore(); } … … 212 205 <string>"\"" { 213 206 char * s; 214 noeof = 0;207 yy_noeof = 0; 215 208 BEGIN(INITIAL); 216 209 s = lvalp->name = dupyytext();
Note: See TracChangeset
for help on using the changeset viewer.