Lines Matching +defs:start +defs:line

86  *			Try to parse the given line as a variable assignment.
209 * The target to be made if no targets are specified in the command line.
216 * active dependency line, or NULL if the current line does not belong to a
217 * dependency line, for example because it is a variable assignment.
235 * is seen, then set to each successive source on the line.
243 * the command line, followed by the included files or .for loops, up to and
428 /* entry->lineno is not a useful line number */
436 /* Check if the current character is escaped on the current line. */
438 IsEscaped(const char *line, const char *p)
441 while (p > line && *--p == '\\')
465 int start = 0;
468 while (start <= end) {
469 int curr = start + (end - start) / 2;
477 start = curr + 1;
502 (void)fprintf(f, "\"%s\" line %u: ", fname, lineno);
516 (void)fprintf(f, "\"%s/%s\" line %u: ", dir.str, base.str, lineno);
681 * dependency line, since each of these dependency groups has
781 * In a line like ".MAIN: source1 source2", add all sources to the list of
783 * command line and .MAIN occurs for the first time.
843 * Given the name of a source in a dependency line, figure out if it is an
866 * user input, we want the first target on the first dependency line that is
889 InvalidLineType(const char *line, const char *unexpanded_line)
900 } else if (strcmp(line, unexpanded_line) == 0)
901 Parse_Error(PARSE_FATAL, "Invalid line '%s'", line);
904 "Invalid line '%s', expanded to '%s'",
905 unexpanded_line, line);
952 * Allow targets from the command line to override the
1104 const char *start = *pp;
1105 cpp_skip_whitespace(&start);
1107 (int)(p - start), start);
1139 * In a dependency line like 'targets: sources' or 'targets! sources', parse
1245 * line options.
1290 /* Handle a "dependency" line like '.SPECIAL:' without any sources. */
1339 * something like suffixes, we take each space-separated word on the line as
1453 ParseDependencySourcesSpecial(char *start,
1457 while (*start != '\0') {
1459 char *end = start;
1464 ParseDependencySourceSpecial(special, start, paths);
1469 start = end;
1483 ParseDependencySourcesMundane(char *start,
1486 while (*start != '\0') {
1487 char *end = start;
1492 * rest of the line is the value.
1494 if (Parse_IsVar(start, &var)) {
1511 if (*end == '(' && end > start && end[-1] != '$') {
1514 * isn't at the start of a word (that'll be
1525 if (!Arch_ParseArchive(&start, &sources,
1529 start);
1539 end = start;
1546 ApplyDependencySource(targetAttr, start, special);
1549 start = end;
1555 * From a dependency line like 'targets: sources', parse the sources.
1611 * Parse a dependency line consisting of targets, followed by a dependency
1729 * Used for both lines in a file and command line arguments.
1937 const char *start;
1939 for (start = cmd; *start != '\0'; start++) {
1940 const char *p = start;
1945 if (start == cmd || !ch_isalnum(p[-1]))
2163 DEBUG3(PARSE, "Parse_PushInput: %s %s, line %u\n",
2202 /* Check if the line is a SYSV include directive. */
2204 IsSysVInclude(const char *line)
2208 if (!IsInclude(line, true))
2211 /* Avoid interpreting a dependency line as an include */
2212 for (p = line; (p = strchr(p, ':')) != NULL;) {
2214 /* end of line -> it's a dependency */
2225 /* Push to another file. The line points to the word "include". */
2227 ParseTraditionalInclude(char *line)
2231 bool silent = line[0] != 'i';
2232 char *file = line + (silent ? 8 : 7);
2243 /* Skip to end of line or next whitespace */
2260 ParseGmakeExport(char *line)
2262 char *variable = line + 6;
2342 DEBUG2(PARSE, "ParseEOF: returning to file %s, line %u\n",
2356 * Parse until the end of a line, taking into account lines that end with
2357 * backslash-newline. The resulting line goes from out_line to out_line_end;
2358 * the line is not null-terminated.
2364 char *line = curFile->buf_ptr;
2366 char *p = line;
2367 char *line_end = line;
2412 !(p > line && p[-1] == '['))
2425 *out_line = line;
2433 * Beginning at start, unescape '\#' to '#' and replace backslash-newline
2437 UnescapeBackslash(char *line, char *start)
2439 const char *src = start;
2440 char *dst = start;
2441 char *spaceStart = line;
2460 if (ch == '#' && line[0] != '\t')
2469 /* Keep an escaped ' ' at the line end. */
2482 * Return the next line that is neither empty nor a comment.
2483 * Backslash line continuations are folded into a single space.
2489 * Return the next line, even if it is empty or a comment.
2490 * Preserve backslash-newline to keep the line numbers correct.
2498 * Return the next line that starts with a dot.
2499 * Backslash line continuations are folded into a single space.
2509 * Return the next "interesting" logical line from the current file. The
2517 char *line;
2525 &line, &line_end, &firstBackslash, &commentLineEnd);
2529 if (line == line_end || line == commentLineEnd) {
2536 /* We now have a line of data */
2541 return line; /* Don't join the physical lines. */
2543 if (kind == LK_DOT && line[0] != '.')
2548 if (commentLineEnd != NULL && line[0] != '\t')
2551 UnescapeBackslash(line, firstBackslash);
2552 return line;
2558 const char *line;
2560 while ((line = ReadLowLevelLine(LK_DOT)) != NULL)
2561 if (Cond_EvalLine(line) == CR_TRUE)
2567 ParseForLoop(const char *line)
2574 rval = For_Eval(line);
2576 return false; /* Not a .for line */
2578 return true; /* Syntax error - error printed, ignore line */
2586 line = ReadLowLevelLine(LK_FOR_BODY);
2587 if (line == NULL) {
2592 } while (For_Accum(line, &forLevel));
2599 * Read an entire line from the input file.
2605 * Return a line without trailing whitespace, or NULL for EOF. The returned
2611 char *line;
2616 line = ReadLowLevelLine(LK_NONEMPTY);
2621 if (line == NULL)
2624 DEBUG2(PARSE, "Parsing line %u: %s\n", curFile->lineno, line);
2626 && ((curFile->guardState == GS_START && line[0] != '.')
2629 if (line[0] != '.')
2630 return line;
2632 condResult = Cond_EvalLine(line);
2636 && (guard = Cond_ExtractGuard(line)) != NULL) {
2649 case CR_ERROR: /* Not a conditional line */
2650 if (ParseForLoop(line))
2654 return line;
2736 * See if the line starts with one of the known directives, and if so, handle
2740 ParseDirective(char *line)
2742 char *p = line + 1;
2752 dir.start = p;
2791 Parse_VarAssign(const char *line, bool finishDependencyGroup, GNode *scope)
2795 if (!Parse_IsVar(line, &var))
2843 ParseDependencyLine(char *line)
2850 char *semicolon = FindSemicolon(line);
2859 * We now know it's a dependency line, so it needs to have all
2862 * XXX: Ideally the dependency line would first be split into
2869 * Parsing the line first would also prevent that targets
2892 expanded_line = Var_Subst(line, SCOPE_CMDLINE, emode);
2900 ParseDependency(expanded_line, line);
2908 ParseLine(char *line)
2910 if (line[0] == '.' && ParseDirective(line))
2913 if (line[0] == '\t') {
2914 ParseLine_ShellCommand(line + 1);
2918 if (IsSysVInclude(line)) {
2919 ParseTraditionalInclude(line);
2923 if (strncmp(line, "export", 6) == 0 && ch_isspace(line[6]) &&
2924 strchr(line, ':') == NULL) {
2925 ParseGmakeExport(line);
2929 if (Parse_VarAssign(line, true, SCOPE_GLOBAL))
2934 ParseDependencyLine(line);
2941 char *line;
2953 while ((line = ReadHighLevelLine()) != NULL) {
2954 ParseLine(line);