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

Subversion Repositories thor

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

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 48 Rev 54
Line 2... Line 2...
#define _TYPES_H
#define _TYPES_H
 
 
class Arg
class Arg
{
{
public:
public:
        char text[120];
        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[10];
        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;
public:
public:
        char *SubArgs(Arglist *args);
        char *SubArgs(Arglist *al);
        char *GetArg();
        //char *GetArg();
        char *GetBody(char *parmlist[]);
        char *GetBody();
        int GetParmList(char *[]);
        int GetParmList();
        void Substitute(char *, int);
        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
#endif
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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