ENH: More cleanups

This commit is contained in:
Andy Cedilnik 2005-06-13 10:27:05 -04:00
parent 043ddabc91
commit 385cced66c
2 changed files with 5 additions and 87 deletions

View File

@ -147,8 +147,6 @@ static void cmCommandArgumentError(yyscan_t yyscanner, const char* message);
//#define YYINITDEPTH 10000 //#define YYINITDEPTH 10000
#define calCheckEmpty(cnt) yyGetParser->CheckEmpty(__LINE__, cnt, yyvsp);
#define calElementStart(cnt) yyGetParser->PrepareElement(&yyval)
/* Disable some warnings in the generated code. */ /* Disable some warnings in the generated code. */
#ifdef __BORLANDC__ #ifdef __BORLANDC__
# pragma warn -8004 /* Variable assigned a value that is not used. */ # pragma warn -8004 /* Variable assigned a value that is not used. */
@ -364,9 +362,9 @@ static const yysigned_char yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned char yyrline[] = static const unsigned char yyrline[] =
{ {
0, 97, 97, 106, 113, 121, 127, 135, 142, 150, 0, 95, 95, 102, 107, 113, 117, 123, 128, 134,
157, 164, 171, 178, 185, 193, 201, 209, 217, 222, 139, 144, 149, 154, 159, 165, 171, 177, 183, 187,
230, 237 193, 198
}; };
#endif #endif
@ -1080,8 +1078,6 @@ yyreduce:
case 2: case 2:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = 0; yyval.str = 0;
yyGetParser->SetResult(yyvsp[0].str); yyGetParser->SetResult(yyvsp[0].str);
} }
@ -1090,8 +1086,6 @@ yyreduce:
case 3: case 3:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1099,8 +1093,6 @@ yyreduce:
case 4: case 4:
{ {
calElementStart(2);
calCheckEmpty(2);
yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str); yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str);
} }
break; break;
@ -1108,8 +1100,6 @@ yyreduce:
case 5: case 5:
{ {
calElementStart(0);
calCheckEmpty(0);
yyval.str = 0; yyval.str = 0;
} }
break; break;
@ -1117,8 +1107,6 @@ yyreduce:
case 6: case 6:
{ {
calElementStart(2);
calCheckEmpty(2);
yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str); yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str);
} }
break; break;
@ -1126,8 +1114,6 @@ yyreduce:
case 7: case 7:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1135,8 +1121,6 @@ yyreduce:
case 8: case 8:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1144,8 +1128,6 @@ yyreduce:
case 9: case 9:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1153,8 +1135,6 @@ yyreduce:
case 10: case 10:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1162,8 +1142,6 @@ yyreduce:
case 11: case 11:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1171,8 +1149,6 @@ yyreduce:
case 12: case 12:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1180,8 +1156,6 @@ yyreduce:
case 13: case 13:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1189,8 +1163,6 @@ yyreduce:
case 14: case 14:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1198,8 +1170,6 @@ yyreduce:
case 15: case 15:
{ {
calElementStart(3);
calCheckEmpty(3);
yyval.str = yyGetParser->ExpandSpecialVariable(yyvsp[-2].str,yyvsp[-1].str); yyval.str = yyGetParser->ExpandSpecialVariable(yyvsp[-2].str,yyvsp[-1].str);
//std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
} }
@ -1208,8 +1178,6 @@ yyreduce:
case 16: case 16:
{ {
calElementStart(3);
calCheckEmpty(3);
yyval.str = yyGetParser->ExpandVariable(yyvsp[-1].str); yyval.str = yyGetParser->ExpandVariable(yyvsp[-1].str);
//std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
} }
@ -1218,8 +1186,6 @@ yyreduce:
case 17: case 17:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyGetParser->ExpandVariable(yyvsp[0].str); yyval.str = yyGetParser->ExpandVariable(yyvsp[0].str);
} }
break; break;
@ -1227,16 +1193,13 @@ yyreduce:
case 18: case 18:
{ {
calElementStart(0); yyval.str = 0;
calCheckEmpty(0);
} }
break; break;
case 19: case 19:
{ {
calElementStart(2);
calCheckEmpty(2);
yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str); yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str);
} }
break; break;
@ -1244,8 +1207,6 @@ yyreduce:
case 20: case 20:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;
@ -1253,8 +1214,6 @@ yyreduce:
case 21: case 21:
{ {
calElementStart(1);
calCheckEmpty(1);
yyval.str = yyvsp[0].str; yyval.str = yyvsp[0].str;
} }
break; break;

View File

@ -53,8 +53,6 @@ static void cmCommandArgumentError(yyscan_t yyscanner, const char* message);
//#define YYINITDEPTH 10000 //#define YYINITDEPTH 10000
#define calCheckEmpty(cnt) yyGetParser->CheckEmpty(__LINE__, cnt, yyvsp);
#define calElementStart(cnt) yyGetParser->PrepareElement(&yyval)
/* Disable some warnings in the generated code. */ /* Disable some warnings in the generated code. */
#ifdef __BORLANDC__ #ifdef __BORLANDC__
# pragma warn -8004 /* Variable assigned a value that is not used. */ # pragma warn -8004 /* Variable assigned a value that is not used. */
@ -96,8 +94,6 @@ static void cmCommandArgumentError(yyscan_t yyscanner, const char* message);
Start: Start:
GoalWithOptionalBackSlash GoalWithOptionalBackSlash
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = 0; $<str>$ = 0;
yyGetParser->SetResult($<str>1); yyGetParser->SetResult($<str>1);
} }
@ -105,139 +101,102 @@ GoalWithOptionalBackSlash
GoalWithOptionalBackSlash: GoalWithOptionalBackSlash:
Goal Goal
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
| |
Goal cal_BSLASH Goal cal_BSLASH
{ {
calElementStart(2);
calCheckEmpty(2);
$<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2); $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
} }
Goal: Goal:
{ {
calElementStart(0);
calCheckEmpty(0);
$<str>$ = 0; $<str>$ = 0;
} }
| |
String Goal String Goal
{ {
calElementStart(2);
calCheckEmpty(2);
$<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2); $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
} }
String: String:
OuterText OuterText
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
| |
Variable Variable
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
OuterText: OuterText:
cal_NAME cal_NAME
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
| |
cal_AT cal_AT
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
| |
cal_DOLLAR cal_DOLLAR
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
| |
cal_LCURLY cal_LCURLY
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
| |
cal_RCURLY cal_RCURLY
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
| |
cal_SYMBOL cal_SYMBOL
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
Variable: Variable:
cal_NCURLY MultipleIds cal_RCURLY cal_NCURLY MultipleIds cal_RCURLY
{ {
calElementStart(3);
calCheckEmpty(3);
$<str>$ = yyGetParser->ExpandSpecialVariable($<str>1,$<str>2); $<str>$ = yyGetParser->ExpandSpecialVariable($<str>1,$<str>2);
//std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
} }
| |
cal_DCURLY MultipleIds cal_RCURLY cal_DCURLY MultipleIds cal_RCURLY
{ {
calElementStart(3);
calCheckEmpty(3);
$<str>$ = yyGetParser->ExpandVariable($<str>2); $<str>$ = yyGetParser->ExpandVariable($<str>2);
//std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
} }
| |
cal_ATNAME cal_ATNAME
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = yyGetParser->ExpandVariable($<str>1); $<str>$ = yyGetParser->ExpandVariable($<str>1);
} }
MultipleIds: MultipleIds:
{ {
calElementStart(0); $<str>$ = 0;
calCheckEmpty(0);
} }
| |
ID MultipleIds ID MultipleIds
{ {
calElementStart(2);
calCheckEmpty(2);
$<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2); $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
} }
ID: ID:
cal_NAME cal_NAME
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }
| |
Variable Variable
{ {
calElementStart(1);
calCheckEmpty(1);
$<str>$ = $<str>1; $<str>$ = $<str>1;
} }