EOS 2  1.1.0
Einfache Objektbasierte Sprache
Property.java
gehe zur Dokumentation dieser Datei
1 package de.lathanda.eos.baseparser;
2 
3 import java.util.LinkedList;
4 
10 public class Property extends Declaration {
11  private UserClass uc;
12 
13  public Property(UserClass uc) {
14  super();
15  this.uc = uc;
16  }
17 
18  @Override
19  public void resolveNamesAndTypes(Expression with, Environment env) {
20  if (vartype.isUnknown()) {
21  env.addError(marker, "UnknownType", vartype);
22  } else if (vartype == SystemType.getWindow()) {
23  // a window variable was found, this information is used to
24  // determine if automatic window has to be generated
25  env.setWindowExists();
26  } else if (vartype.inherits(SystemType.getFigure())) {
27  // a figure variable was found, this information is used to
28  // determine if automatic window has to be generated
29  env.setFigureExists();
30  }
31  }
32 
33  public LinkedList<AutoCompleteInformation> getAutoCompletes() {
34  LinkedList<AutoCompleteInformation> result = new LinkedList<>();
35  for (String name : names) {
36  result.add(new AutoCompleteInfo(name, uc.getType(), AutoCompleteInformation.PROPERTY, name.length(), 0));
37  }
38  return result;
39  }
40 
41  public Type getPropertyType() {
42  return vartype;
43  }
44 
45 
46 }
void addError(Marker marker, String errorId, Object... data)
void resolveNamesAndTypes(Expression with, Environment env)
Definition: Property.java:19
LinkedList< AutoCompleteInformation > getAutoCompletes()
Definition: Property.java:33
boolean inherits(Type b)
Definition: Type.java:163
Impressum