diff options
author | Kung Hsu <kung@cygnus> | 1994-11-02 23:11:47 +0000 |
---|---|---|
committer | Kung Hsu <kung@cygnus> | 1994-11-02 23:11:47 +0000 |
commit | a8d23c7364a84de67b945c8f9d96473894d35556 (patch) | |
tree | 144c62d038e41d6c95f5db9da885a89ea389921c /gdb/c-exp.y | |
parent | e640e6644dcc8b66209fbde0f32baeb3a7150f4c (diff) | |
download | gdb-a8d23c7364a84de67b945c8f9d96473894d35556.zip gdb-a8d23c7364a84de67b945c8f9d96473894d35556.tar.gz gdb-a8d23c7364a84de67b945c8f9d96473894d35556.tar.bz2 |
* c-exp.y (yylex): scan template names, and scan nested class
names.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 399b2aa..bb87545 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1363,9 +1363,12 @@ yylex () namelen = 0; for (c = tokstart[namelen]; (c == '_' || c == '$' || (c >= '0' && c <= '9') - || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); - c = tokstart[++namelen]) - ; + || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');) + { + if (c == '<') + while (tokstart[++namelen] != '>'); + c = tokstart[++namelen]; + } /* The token "if" terminates the expression and is NOT removed from the input stream. */ @@ -1574,11 +1577,17 @@ yylex () struct symbol *cur_sym; /* As big as the whole rest of the expression, which is at least big enough. */ - char *tmp = alloca (strlen (namestart)+1); - - memcpy (tmp, namestart, p - namestart); - tmp[p - namestart] = '\0'; - cur_sym = lookup_symbol (tmp, expression_context_block, + char *ncopy = alloca (strlen (tmp)+strlen (namestart)+3); + char *tmp1; + + tmp1 = ncopy; + memcpy (tmp1, tmp, strlen (tmp)); + tmp1 += strlen (tmp); + memcpy (tmp1, "::", 2); + tmp1 += 2; + memcpy (tmp1, namestart, p - namestart); + tmp1[p - namestart] = '\0'; + cur_sym = lookup_symbol (ncopy, expression_context_block, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL); if (cur_sym) |