cpp курсач

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
case 1:
return new Token<TokType>(PRINT, coord);
case 2:
return new AttrToken<TokType, double>(NUMBER, 8, coord);
case 3:
return new Token<TokType>(PLUS, coord);
case 4:
return new AttrToken<TokType, double>(NUMBER, 10, coord);
case 5:
return new Token<TokType>(PLUS, coord);
case 6:
return new AttrToken<TokType, double>(NUMBER, 10, coord);
case 7:
return new Token<TokType>(END_OF_TEXT, coord);
////case 1:
//// return new Token<TokType>(PLUS, coord);
////case 2:
//// return new Token<TokType>(END_OF_TEXT, coord);
//case 1:
// return new AttrToken<TokType, double>(NUMBER, 8, coord);
// //return new AttrToken<TokType, std::string>(VARNAME, "n", coord);
//case 2:
// //return new AttrToken<TokType, std::string>(VARNAME, "n", coord);
// return new Token<TokType>(PLUS, coord);
////case 3:
//// return new Token<TokType>(PLUS, coord);
//case 3:
// return new AttrToken<TokType, double>(NUMBER, 10, coord);
//case 4:
// return new Token<TokType>(END_OF_TEXT, coord);
//
// //return new Token((TokType)0, coord);
}
//
/*return new Token<TokType>(PRINT, coord);
return new AttrToken<TokType, std::string>(VARNAME, varname, coord);
...
return new AttrToken<TokType, double>(NUMBER, value, coord);
...
return new Token<TokType>(0, coord);*/ // Конец ввода всегда должен иметь значение 0