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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [software/] [AS64/] [source/] [types.h] - Diff between revs 54 and 55

Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

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