2004-04-23 11:58:43 +01:00
|
|
|
#ifndef TAC_H
|
|
|
|
#define TAC_H
|
|
|
|
|
2004-07-24 20:07:29 +01:00
|
|
|
#include "symbol.h"
|
2004-04-23 11:58:43 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* TAC instructions
|
|
|
|
*/
|
|
|
|
|
2004-08-09 11:05:58 +01:00
|
|
|
enum tactypes
|
|
|
|
{
|
2004-07-29 12:26:59 +01:00
|
|
|
TAC_UNDEF,
|
|
|
|
TAC_SYM,
|
|
|
|
TAC_TUPLE,
|
|
|
|
TAC_ENCRYPT,
|
|
|
|
TAC_VAR,
|
|
|
|
TAC_CONST,
|
|
|
|
TAC_READ,
|
|
|
|
TAC_SEND,
|
|
|
|
TAC_CLAIM,
|
|
|
|
TAC_FUNC,
|
|
|
|
TAC_STRING,
|
|
|
|
TAC_ROLE,
|
|
|
|
TAC_PROTOCOL,
|
|
|
|
TAC_RUN,
|
|
|
|
TAC_ROLEREF,
|
|
|
|
TAC_SECRET,
|
|
|
|
TAC_INVERSEKEYS,
|
|
|
|
TAC_UNTRUSTED,
|
|
|
|
TAC_COMPROMISED,
|
|
|
|
TAC_USERTYPE
|
|
|
|
};
|
2004-04-23 11:58:43 +01:00
|
|
|
|
|
|
|
struct tacnode
|
|
|
|
{
|
|
|
|
struct tacnode *next;
|
|
|
|
struct tacnode *prev;
|
|
|
|
struct tacnode *allnext;
|
|
|
|
int op;
|
|
|
|
int lineno;
|
|
|
|
union
|
|
|
|
{
|
2004-05-26 09:26:40 +01:00
|
|
|
Symbol sym;
|
|
|
|
struct tacnode *tac;
|
|
|
|
char *str;
|
|
|
|
} t1;
|
2004-08-09 11:05:58 +01:00
|
|
|
union
|
2004-04-23 11:58:43 +01:00
|
|
|
{
|
2004-05-26 09:26:40 +01:00
|
|
|
Symbol sym;
|
|
|
|
struct tacnode *tac;
|
|
|
|
char *str;
|
|
|
|
} t2;
|
2004-04-23 11:58:43 +01:00
|
|
|
union
|
|
|
|
{
|
2004-05-26 09:26:40 +01:00
|
|
|
Symbol sym;
|
|
|
|
struct tacnode *tac;
|
|
|
|
char *str;
|
|
|
|
} t3;
|
2004-04-23 11:58:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct tacnode *Tac;
|
|
|
|
|
|
|
|
void tacInit (void);
|
|
|
|
void tacDone (void);
|
|
|
|
Tac tacCreate (int op);
|
|
|
|
Tac tacSymb (char *s);
|
|
|
|
Tac tacJoin (int op, Tac t1, Tac t2, Tac t3);
|
|
|
|
Tac tacTuple (Tac taclist);
|
|
|
|
Tac tacCat (Tac t1, Tac t2);
|
|
|
|
void tacPrint (Tac t);
|
|
|
|
|
|
|
|
#endif
|