Personal tools
You are here: Home Projects C++ Cfront releases Release 3.0.3 source libSC demangle osrc nplist.c
Document Actions

nplist.c

by Michael L Powell last modified 2007-01-26 03:23

Click here to get the file

Size 1.8 kB - File type text/plain

File contents

/*ident	"@(#)cls4:tools/demangler/osrc/nplist.c	1.1" */

/*******************************************************************************
 
C++ source for the C++ Language System, Release 3.0.  This product
is a new release of the original cfront developed in the computer
science research center of AT&T Bell Laboratories.

Copyright (c) 1991 AT&T and UNIX System Laboratories, Inc.
Copyright (c) 1984, 1989, 1990 AT&T.  All Rights Reserved.

THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of AT&T and UNIX System
Laboratories, Inc.  The copyright notice above does not evidence
any actual or intended publication of such source code.

*******************************************************************************/

/*
 * C++ Demangler Source Code
 * @(#)master	1.5
 * 7/27/88 13:54:37
 */
#include "elf_dem.h"

struct name_pair {
	char *s1,*s2;
};

static struct name_pair nplist[100] = {
	{"lt","<"},    {"ls","<<"},      {"dv","/"}, 
	{"gt",">"},    {"rs",">>"},      {"md","%"}, 
	{"le","<="},   {"ml","*"},       {"pl","+"}, 
	{"ge",">="},   {"ad","&"},       {"mi","-"}, 
	{"ne","!="},   {"or","|"},       {"er","^"}, 
	{"aa","&&"},   {"oo","||"},      {"as","="}, 
	{"apl","+="},  {"ami","-="},     {"amu","*="}, 
	{"adv","/="},  {"amd","%="},     {"aad","&="}, 
	{"aor","|="},  {"aer","^="},     {"als","<<="},
	{"ars",">>="}, {"pp","++"},      {"mm","--"},
	{"vc","[]"},   {"cl","()"},      {"rf","->"},
	{"eq","=="},   {"co","~"},       {"nt","!"},
	{"nw"," new"}, {"dl"," delete"}, {"cm",","},
	 {0,0} };

/* This routine demangles an overloaded operator function */
char *
findop(c,oplen)
char *c;
int *oplen;
{
	register int i,opl;
	for(opl=0; c[opl] && c[opl] != '_'; opl++)
		;
	*oplen = opl;
	for(i=0; nplist[i].s1; i++) {
		if(memcmp(nplist[i].s1,c,opl) == 0)
			return nplist[i].s2;
	}
	return 0;
}
« April 2024 »
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: