-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIdent.java
49 lines (34 loc) · 1 KB
/
Ident.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import java.util.ArrayList;
//import com.modeliosoft.modelio.javadesigner.annotations.objid;
public abstract class Ident implements Constante{
private type type;
//public TabIdent tabIdent; ???
public Ident(type type){
this.type = type;
}
public abstract boolean equals(Ident id);
public abstract boolean estVariable();
public abstract boolean estFonction();
public abstract boolean estParametre();
public boolean estConstante(){return false;}
public abstract int getValeur();
public ArrayList<type> getParametres(){
return new ArrayList<type>();
}
public type getResultat(){
return type.ERREUR;
}
public type getType(){
return this.type;
}
public char getTypeToChar(){
switch(this.type){
case BOOL: return 'b';
case ENTIER: return 'e';
case ERREUR: return 'r';
case FONCTION: return 'f';
case PARAMETRE: return 'p';
default: return 'r';
}
}
}