Added classes for type representation

entity_declaration_type_checking
Tristan B. V. Kildaire 2021-04-21 23:27:44 +02:00
parent 114f0c5c39
commit 040d79ecfb
1 changed files with 52 additions and 0 deletions

View File

@ -17,6 +17,58 @@ import compiler.symbols.data;
public class Type : Entity public class Type : Entity
{ {
/**
* TODO: See what we need in here, Entity name could be our Type name
* But to make it look nice we could just have `getType`
* Actually yeah, we should, as Number types won't be entities
* Wait lmao they will
*/
this(string name)
{
super(name);
}
}
public class Number : Type
{
this(string name)
{
super(name);
}
}
public class Integer : Number
{
/* Number of bytes (1,2,4,8) */
private ubyte width;
this(string name)
{
super(name);
}
}
public class Float : Number
{
this(string name)
{
super(name);
}
}
public class Double : Number
{
this(string name)
{
super(name);
}
}
public class Pointer : Type
{
/* Datum wdith */
private ubyte datumWidth;
this(string name) this(string name)
{ {
super(name); super(name);