URL
https://opencores.org/ocsvn/thor/thor/trunk
Subversion Repositories thor
[/] [thor/] [trunk/] [FT64v5/] [software/] [AS64/] [source/] [types.h] - Rev 54
Go to most recent revision | Compare with Previous | Blame | View Log
#ifndef _TYPES_H #define _TYPES_H 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
Go to most recent revision | Compare with Previous | Blame | View Log