COMPORT – Compilador Portugol - Nilo Menezes
COMPORT – Compilador Portugol - Nilo Menezes
COMPORT – Compilador Portugol - Nilo Menezes
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CODEGENERATOR.H<br />
#ifndef ICODEGENERATOR<br />
#define ICODEGENERATOR<br />
#define maxCode 1000<br />
#define maxRel 200<br />
#define NofCom 16<br />
#define Head 0<br />
#define Var 1<br />
#define Par 2<br />
#define Const 3<br />
#define Fld 4<br />
#define Typ 5<br />
#define Proc 6<br />
#define SProc 7<br />
#define Reg 10<br />
#define Cond 11<br />
#define Boolean 0<br />
#define Integer 1<br />
#define Array 2<br />
#define Record 3<br />
#define Literal 4<br />
// Registradores reservados<br />
#define FP 29<br />
#define SP 30<br />
#define LNK 31<br />
// Tipos<br />
typedef struct ObjDesc *Object;<br />
typedef struct TypeDesc *Type;<br />
typedef struct Item<br />
{<br />
int mode, lev;<br />
Type type;<br />
long a, b, c, r;<br />
} Item;<br />
struct ObjDesc<br />
{<br />
int Class, lev;<br />
Object next, dsc;<br />
Type type;<br />
Ident name;<br />
long val;<br />
};<br />
struct TypeDesc<br />
{<br />
int form;<br />
Object fields;<br />
ComPort <strong>–</strong> <strong>Compilador</strong> <strong>Portugol</strong><br />
84