OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [software/] [AS64/] [source/] [types.h] - Rev 55

Compare with Previous | Blame | View Log

#ifndef _TYPES_H
#define _TYPES_H
 
// Compressed instructions table entry
 
typedef struct _tagHBLE
{
	int count;
	int64_t opcode;
} HTBLE;
 
class Arg
{
public:
	std::string text;
public:
	void Get();
	void Clear();
};
 
class Arglist
{
public:
	int count;
	Arg args[20];
public:
	void Get();
};
 
class Macro
{
public:
	static int inst;
	char *body;	// template for macro body
	Arglist parms;
public:
	char *SubArgs(Arglist *al);
	//char *GetArg();
	char *GetBody();
	int GetParmList();
	static void Substitute(char *, int);
};
 
class FileInfo
{
public:
	std::string name;
	int lineno;
};
 
class FilenameStack
{
public:
	FileInfo stack[21];
	int sp;
public:
	FilenameStack() { sp = 0; };
	void Push(std::string nm, int ln) {
		if (sp > 20) {
			printf("Too many nested files.\n");
			return;
		}
		stack[sp].name = nm;
		stack[sp].lineno = ln;
		sp++;
	}
	void Pop(std::string *nm, int *ln) {
		if (sp == 0) {
			printf("Filename stack underflow.\n");
			return;
		}
		--sp;
		*nm = stack[sp].name;
		*ln = stack[sp].lineno;
	}
	FileInfo *GetTos() {
		return (&stack[sp - 1]);
	}
};
 
#endif
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.