📄 lpgparse.c
字号:
file_prefix[MIN(5, strlen(temp))] = '\0'; } else if ((strcmp(token, "GP") == 0) || (memcmp(ogenprsr, token, len) == 0) || (memcmp(ogenprsr2, token, len) == 0) || (memcmp(ogenprsr3, token, len) == 0)) { BOOLEAN invalid_language = TRUE; if (temp[0] == 'c' || temp[0] == 'C') { if (temp[1] == '\0') { c_bit = TRUE; cpp_bit = FALSE; java_bit = FALSE; invalid_language = FALSE; } else if (((temp[1] == '+' && temp[2] == '+') || ((temp[1] == 'p' || temp[1] == 'P') && (temp[2] == 'p' || temp[2] == 'P'))) && temp[3] == '\0') { c_bit = FALSE; cpp_bit = TRUE; java_bit = FALSE; invalid_language = FALSE; } } else if ((len == 1 && (*temp == 'j' || *temp == 'J')) || (len == 2 && strxeq(temp, "ja")) || (len == 3 && strxeq(temp, "jav")) || (len == 4 && strxeq(temp, "java"))) { c_bit = FALSE; cpp_bit = FALSE; java_bit = TRUE; invalid_language = FALSE; } if (invalid_language) { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } }#if (defined(C370) || defined(CW)) && (!defined(MVS)) else if ((strcmp(token, "HN") == 0) || ((len >= 9) && ((memcmp(token, ohactfile_name, len) == 0) || (memcmp(token, ohactfile_name2, len) == 0) || (memcmp(token, ohactfile_name3, len) == 0)))) { memcpy(han, temp, 8); pn[MIN(strlen(temp), 8)] = '\0'; strupr(han); } else if ((strcmp(token, "HT") == 0) || ((len >= 9) && ((memcmp(token, ohactfile_type, len) == 0) || (memcmp(token, ohactfile_type2, len) == 0) || (memcmp(token, ohactfile_type3, len) == 0)))) { memcpy(hat, temp, 8); hat[MIN(strlen(temp), 8)] = '\0'; strupr(hat); } else if ((strcmp(token, "HM") == 0) || ((len >= 9) && ((memcmp(token, ohactfile_mode, len) == 0) || (memcmp(token, ohactfile_mode2, len) == 0) || (memcmp(token, ohactfile_mode3, len) == 0)))) { memcpy(ham, temp, 2); ham[MIN(strlen(temp), 2)] = '\0'; strupr(ham); }#else else if ((strcmp(token, "HN") == 0) || ((len >= 2) && ((memcmp(token, ohactfile_name, len) == 0) || (memcmp(token, ohactfile_name2, len) == 0) || (memcmp(token, ohactfile_name3, len) == 0)))) strcpy(hact_file, temp);#endif else if (len >= 2 && strcmp(token, ohblockb) == 0) strcpy(hblockb, temp); else if (len >= 2 && strcmp(token, ohblocke) == 0) strcpy(hblocke, temp); else if (memcmp (olalr, token, len) == 0) { len = strlen(temp); if (len > MAX_PARM_SIZE) temp[MAX_PARM_SIZE - 1] = '\0'; if ((! verify(temp)) && (memcmp(translate(temp, len), omax, len) != 0)) { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } else { slr_bit = FALSE; if (memcmp(omax, translate(temp, len), len) == 0) lalr_level = MAXIMUM_LA_LEVEL; else { lalr_level = atoi(temp); if (lalr_level > MAXIMUM_LA_LEVEL) { sprintf(msg_line, "\"%s\" exceeds maximum value " "of %d allowed for %s", temp, MAXIMUM_LA_LEVEL, token); PRNTWNG(msg_line); lalr_level = MAXIMUM_LA_LEVEL; } } } } else if ((len >= 2) && ((memcmp(token, omaximum_distance,len) == 0) || (memcmp(token, omaximum_distance2, len) == 0) || (memcmp(token, omaximum_distance3, len) == 0))) { if (verify(temp)) maximum_distance = atoi(temp); else { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } } else if ((len >= 2) && ((memcmp(token, ominimum_distance,len) == 0) || (memcmp(token, ominimum_distance2, len) == 0) || (memcmp(token, ominimum_distance3, len) == 0))) { if (verify(temp)) minimum_distance = atoi(temp); else { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } } else if ((memcmp(onames, token, len) == 0)) { len = strlen(temp); if (len >= 2 && memcmp(omax, translate(temp, len), len) == 0) names_opt = MAXIMUM_NAMES; else if (len >= 2 && memcmp(omin, translate(temp, len), len) == 0) names_opt = MINIMUM_NAMES; else if (memcmp(translate(temp, len), ooptimized, len) == 0) names_opt = OPTIMIZE_PHRASES; else if ((temp[0] == 'm' || temp[0] == 'M') && temp[1] != '\0') { sprintf(msg_line, "\"M\" is an ambiguous value for %s: " "MAXIMUM, MINIMUM?", token); PRNTERR(msg_line); } else { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } } else if (len >= 2 && memcmp(token, oormark, len) == 0) ormark = temp[0]; else if ((len >= 2) && ((strcmp(token, "OS") == 0) || (memcmp(token, ooutputsize, len) == 0) || (memcmp(token, ooutputsize2, len) == 0) || (memcmp(token, ooutputsize3, len) == 0))) { if (verify(temp)) { int tmpval; tmpval = atoi(temp); if (tmpval > MAX_LINE_SIZE) { sprintf(msg_line, "OUTPUT_SIZE cannot exceed %d", MAX_LINE_SIZE); PRNTERR(msg_line); } else output_size = tmpval; } else { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } } else if (memcmp(token, oprefix, len) == 0) strcpy(prefix,temp);#if defined(C370) || defined(CW) else if ((strcmp(token, "RF") == 0) || (strcmp(token, "RECFM") == 0) || (memcmp(token, orecordformat, len) == 0) || (memcmp(token, orecordformat2, len) == 0) || (memcmp(token, orecordformat3, len) == 0)) { len = strlen(temp); if (len > MAX_PARM_SIZE) temp[MAX_PARM_SIZE-1] = '\0'; if (memcmp(ofixed, translate(temp, len), len) == 0) record_format = 'F'; else if (memcmp(translate(temp, len), ovariable,len) == 0) record_format = 'V'; else { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } }#endif else if (strcmp(token, "SS") == 0 || ((memcmp(token, ostack_size,len) == 0) || (memcmp(token, ostack_size2, len) == 0) || (memcmp(token, ostack_size3, len) == 0))) { if (verify(temp)) stack_size = atoi(temp); else { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } } else if (len >= 2 && memcmp(token, osuffix, len) == 0) strcpy(suffix,temp); else if (len >= 2 && memcmp(token,otable, len) == 0) { len = strlen(temp); if (len > MAX_PARM_SIZE) temp[MAX_PARM_SIZE - 1] = '\0'; if (memcmp(ospace, translate(temp, len), len) == 0) table_opt = OPTIMIZE_SPACE; else if (memcmp(translate(temp, len), otime, len) == 0) table_opt = OPTIMIZE_TIME; else { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } } else if (len >= 2 && memcmp(token, otrace, len) == 0) { len = strlen(temp); if (len > MAX_PARM_SIZE) temp[MAX_PARM_SIZE-1] = '\0'; if (memcmp(oconflicts, translate(temp, len), len) == 0) trace_opt = TRACE_CONFLICTS; else if (memcmp(translate(temp, len), ofull, len) == 0) trace_opt = TRACE_FULL; else { sprintf(msg_line, "\"%s\" is an invalid value for %s", temp, token); PRNTERR(msg_line); } }#if (defined(C370) || defined(CW)) && (!defined(MVS)) else if (memcmp(token, oactfile_name2, len) == 0 || memcmp(token, oactfile_name3, len) == 0) { sprintf(msg_line, "Option \"%s\" is ambiguous: " "ACTFILE-NAME, ACTFILE-TYPE, ACTFILE-MODE?", token); PRNTERR(msg_line); }#endif else if (strcmp(token, "BLOCK") == 0) { PRNTERR("Option \"BLOCK\" is ambiguous: BLOCKB, BLOCKE ?"); } else if (strcmp("E",token) == 0) { PRNTERR("Option \"E\" is ambiguous: " "ERROR-PROC, ERROR-MAPS ?"); } else if (strcmp(token, "H") == 0) { PRNTERR("Option \"H\" is ambiguous: HBLOCKB, HBLOCKE ?"); }#if (defined(C370) || defined(CW)) && (!defined(MVS)) else if (memcmp(token, ohactfile_name2, len) == 0 || memcmp(token, ohactfile_name3, len) == 0) { sprintf(msg_line, "Option \"%s\" is ambiguous: " "HACTFILE-NAME, HACTFILE-TYPE, HACTFILE-MODE?", token); PRNTERR(msg_line); }#endif else if (strcmp(token, "HBLOCK") == 0) { PRNTERR("Option \"HBLOCK\" is ambiguous: HBLOCKB, HBLOCKE ?"); } else if (strcmp("M",token) == 0 || strcmp("MD",token) == 0) { sprintf(msg_line, "Option \"%s\" is ambiguous: " "MAX-DISTANCE, MIN-DISTANCE?", token); PRNTERR(msg_line); } else if (strcmp("O",token) == 0) { PRNTERR("Option \"O\" is ambiguous: OUTPUT-SIZE, ORMARK ?"); } else if (strcmp("T", token) == 0) { PRNTERR("Option \"T\" is ambiguous: TABLE, TRACE?"); } else { sprintf(msg_line, "\"%s\" is an invalid option", token); PRNTERR(msg_line); } } while ((parm[i] != '\0')&& /* clean after paramter */ ((parm[i] == ',') || (parm[i] == '/') ||
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -