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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [software/] [AS64/] [source/] [types.h] - Blame information for rev 55

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 robfinch
#ifndef _TYPES_H
2
#define _TYPES_H
3
 
4 55 robfinch
// Compressed instructions table entry
5
 
6
typedef struct _tagHBLE
7
{
8
        int count;
9
        int64_t opcode;
10
} HTBLE;
11
 
12 48 robfinch
class Arg
13
{
14
public:
15 54 robfinch
        std::string text;
16 48 robfinch
public:
17
        void Get();
18
        void Clear();
19
};
20
 
21
class Arglist
22
{
23
public:
24
        int count;
25 54 robfinch
        Arg args[20];
26 48 robfinch
public:
27
        void Get();
28
};
29
 
30
class Macro
31
{
32
public:
33
        static int inst;
34
        char *body;     // template for macro body
35 54 robfinch
        Arglist parms;
36 48 robfinch
public:
37 54 robfinch
        char *SubArgs(Arglist *al);
38
        //char *GetArg();
39
        char *GetBody();
40
        int GetParmList();
41
        static void Substitute(char *, int);
42 48 robfinch
};
43
 
44 54 robfinch
class FileInfo
45
{
46
public:
47
        std::string name;
48
        int lineno;
49
};
50
 
51
class FilenameStack
52
{
53
public:
54
        FileInfo stack[21];
55
        int sp;
56
public:
57
        FilenameStack() { sp = 0; };
58
        void Push(std::string nm, int ln) {
59
                if (sp > 20) {
60
                        printf("Too many nested files.\n");
61
                        return;
62
                }
63
                stack[sp].name = nm;
64
                stack[sp].lineno = ln;
65
                sp++;
66
        }
67
        void Pop(std::string *nm, int *ln) {
68
                if (sp == 0) {
69
                        printf("Filename stack underflow.\n");
70
                        return;
71
                }
72
                --sp;
73
                *nm = stack[sp].name;
74
                *ln = stack[sp].lineno;
75
        }
76
        FileInfo *GetTos() {
77
                return (&stack[sp - 1]);
78
        }
79
};
80
 
81 48 robfinch
#endif

powered by: WebSVN 2.1.0

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