diff options
author | Roger Sayle <roger@eyesopen.com> | 2007-09-02 17:44:37 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2007-09-02 17:44:37 +0000 |
commit | f2449db41c586a49bce8e512cdeb9f4e1330d998 (patch) | |
tree | 55128b82c7e60dce137d947dba21f608c81bbff0 /gcc/fortran/match.c | |
parent | b35c5f019f9dcbee023c54f25be644d90a5a76ac (diff) | |
download | gcc-f2449db41c586a49bce8e512cdeb9f4e1330d998.zip gcc-f2449db41c586a49bce8e512cdeb9f4e1330d998.tar.gz gcc-f2449db41c586a49bce8e512cdeb9f4e1330d998.tar.bz2 |
decl.c (match_string_p): New helper function to explicitly match a string of characters.
* decl.c (match_string_p): New helper function to explicitly match
a string of characters.
(match_attr_spec): Remove no longer needed DECL_COLON from decl_types.
Delete decls array and peek_char. Rewrite decl attribute parser to
avoid calling gfc_match_strings.
* match.c (gfc_match_strings): Delete unused function.
* match.h (gfc_match_strings): Delete prototype.
From-SVN: r128028
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index dcf6ad1..83b8873 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -417,90 +417,6 @@ gfc_match_label (void) } -/* Try and match the input against an array of possibilities. If one - potential matching string is a substring of another, the longest - match takes precedence. Spaces in the target strings are optional - spaces that do not necessarily have to be found in the input - stream. In fixed mode, spaces never appear. If whitespace is - matched, it matches unlimited whitespace in the input. For this - reason, the 'mp' member of the mstring structure is used to track - the progress of each potential match. - - If there is no match we return the tag associated with the - terminating NULL mstring structure and leave the locus pointer - where it started. If there is a match we return the tag member of - the matched mstring and leave the locus pointer after the matched - character. - - A '%' character is a mandatory space. */ - -int -gfc_match_strings (mstring *a) -{ - mstring *p, *best_match; - int no_match, c, possibles; - locus match_loc; - - possibles = 0; - - for (p = a; p->string != NULL; p++) - { - p->mp = p->string; - possibles++; - } - - no_match = p->tag; - - best_match = NULL; - match_loc = gfc_current_locus; - - gfc_gobble_whitespace (); - - while (possibles > 0) - { - c = gfc_next_char (); - - /* Apply the next character to the current possibilities. */ - for (p = a; p->string != NULL; p++) - { - if (p->mp == NULL) - continue; - - if (*p->mp == ' ') - { - /* Space matches 1+ whitespace(s). */ - if ((gfc_current_form == FORM_FREE) && gfc_is_whitespace (c)) - continue; - - p->mp++; - } - - if (*p->mp != c) - { - /* Match failed. */ - p->mp = NULL; - possibles--; - continue; - } - - p->mp++; - if (*p->mp == '\0') - { - /* Found a match. */ - match_loc = gfc_current_locus; - best_match = p; - possibles--; - p->mp = NULL; - } - } - } - - gfc_current_locus = match_loc; - - return (best_match == NULL) ? no_match : best_match->tag; -} - - /* See if the current input looks like a name of some sort. Modifies the passed buffer which must be GFC_MAX_SYMBOL_LEN+1 bytes long. Note that options.c restricts max_identifier_length to not more |