1 /*****************************************************************************/
5 /* Parse a symbol name and search for it */
9 /* (C) 1998-2003 Ullrich von Bassewitz */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
47 /*****************************************************************************/
49 /*****************************************************************************/
53 /*****************************************************************************/
55 /*****************************************************************************/
59 SymEntry* ParseScopedSymName (int AllocNew)
60 /* Parse a (possibly scoped) symbol name, search for it in the symbol table
61 * and return the symbol table entry.
64 /* Get the starting table */
66 if (Tok == TOK_NAMESPACE) {
76 /* An identifier must follow. Remember and skip it. */
77 char Name[sizeof (SVal)];
78 if (Tok != TOK_IDENT) {
79 Error ("Identifier expected");
85 /* If the next token is a namespace token, handle the name as the
86 * name of a scope, otherwise it's the name of a symbol in that
90 if (Tok == TOK_NAMESPACE) {
92 /* Search for the child scope */
93 Scope = SymFindScope (Scope, Name, AllocNew);
95 /* Skip the namespace token */
98 /* If we didn't find the scope, bail out */
105 /* Search for the symbol and return it */
106 return SymFind (Scope, Name, AllocNew);