- Moved special terms into their own (very) special file.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "substitution.h"
|
||||
#include "compiler.h"
|
||||
#include "switches.h"
|
||||
#include "specialterm.h"
|
||||
|
||||
/*
|
||||
Simple sys pointer as a global. Yields cleaner code although it's against programming standards.
|
||||
@@ -34,8 +35,6 @@ extern int protocolCount;
|
||||
void tacProcess (Tac tc);
|
||||
void levelInit (void);
|
||||
void levelDone (void);
|
||||
Term symbolDeclare (Symbol s, int isVar);
|
||||
void levelTacDeclaration (Tac tc, int isVar);
|
||||
Term levelFind (Symbol s, int i);
|
||||
Term symbolFind (Symbol s);
|
||||
Term tacTerm (Tac tc);
|
||||
@@ -43,29 +42,6 @@ Termlist tacTermlist (Tac tc);
|
||||
Term levelDeclare (Symbol s, int isVar, int level);
|
||||
void compute_role_variables (const System sys, Protocol p, Role r);
|
||||
|
||||
#define levelDeclareVar(s) levelTacDeclaration(s,1)
|
||||
#define levelDeclareConst(s) levelTacDeclaration(s,0)
|
||||
#define levelVar(s) symbolDeclare(s,1)
|
||||
#define levelConst(s) symbolDeclare(s,0)
|
||||
|
||||
/* externally used:
|
||||
* TERM_Function in termlists.c for inversekeys
|
||||
* TERM_Type in system.c for type determination.
|
||||
*/
|
||||
|
||||
Term TERM_Agent;
|
||||
Term TERM_Function;
|
||||
Term TERM_Hidden;
|
||||
Term TERM_Type;
|
||||
Term TERM_Nonce;
|
||||
Term TERM_Ticket;
|
||||
|
||||
Term TERM_Claim;
|
||||
Term CLAIM_Secret;
|
||||
Term CLAIM_Nisynch;
|
||||
Term CLAIM_Niagree;
|
||||
Term CLAIM_Empty;
|
||||
|
||||
/*
|
||||
* Global stuff
|
||||
*/
|
||||
@@ -92,24 +68,8 @@ compilerInit (const System mysys)
|
||||
level = -1;
|
||||
levelInit ();
|
||||
|
||||
/* Init system constants */
|
||||
#define langhide(x,y) x = levelConst(symbolSysConst(" _" y "_ "))
|
||||
#define langtype(x,y) x->stype = termlistAdd(x->stype,y);
|
||||
#define langcons(x,y,z) x = levelConst(symbolSysConst(y)); langtype(x,z)
|
||||
|
||||
langhide (TERM_Type, "Type");
|
||||
langhide (TERM_Hidden, "Hidden");
|
||||
langhide (TERM_Claim, "Claim");
|
||||
|
||||
langcons (TERM_Agent, "Agent", TERM_Type);
|
||||
langcons (TERM_Function, "Function", TERM_Type);
|
||||
langcons (TERM_Nonce, "Nonce", TERM_Type);
|
||||
langcons (TERM_Ticket, "Ticket", TERM_Type);
|
||||
|
||||
langcons (CLAIM_Secret, "Secret", TERM_Claim);
|
||||
langcons (CLAIM_Nisynch, "Nisynch", TERM_Claim);
|
||||
langcons (CLAIM_Niagree, "Niagree", TERM_Claim);
|
||||
langcons (CLAIM_Empty, "Empty", TERM_Claim);
|
||||
/* create special terms */
|
||||
specialTermInit (sys);
|
||||
}
|
||||
|
||||
//! Make a global constant
|
||||
|
||||
Reference in New Issue
Block a user