public String get_main_class_name() { if (_is_container) return _container_class == null ? "" : _container_class.getName(); if (_is_void) return ".internal.void"; if (_is_int) return ".internal.int"; if (_is_string) return ".internal.string"; return _class == null ? "" : _class.getName(); }
public boolean equals(Object o) { if (o == null || !(o instanceof PhantomType)) return false; PhantomType _t = (PhantomType) o; if (!_is_known || !_t._is_known) return false; if (_is_void && _t._is_void) return true; if (_is_void || _t._is_void) return false; if (_is_int && _t._is_int) return true; if (_is_int || _t._is_int) return false; if (_is_long && _t._is_long) return true; if (_is_long || _t._is_long) return false; if (_is_float && _t._is_float) return true; if (_is_float || _t._is_float) return false; if (_is_double && _t._is_double) return true; if (_is_double || _t._is_double) return false; if (_is_string && _t._is_string) return true; if (_is_string || _t._is_string) return false; if (_is_container != _t._is_container) return false; if (_container_class != _t._container_class) return false; return _class.equals(_t._class); }
public void emit_get_class_object(Codegen c, CodeGeneratorState s) throws PlcException, IOException { if (is_void() && !is_container()) // c.emit_summon_null(); throw new PlcException("PhantomType", "asked to emit void class object"); // Why not, btw? else if (is_int()) c.emitSummonByName(".internal.int"); else if (is_long()) c.emitSummonByName(".internal.long"); else if (is_float()) c.emitSummonByName(".internal.float"); else if (is_double()) c.emitSummonByName(".internal.double"); else if (is_string()) c.emitSummonByName(".internal.string"); else if (is_container()) { if (_container_class != null) c.emitSummonByName(_container_class.getName()); else if (_container_class_expression != null) _container_class_expression.generate_code(c, s); else c.emitSummonByName(".internal.container.array"); } else if (_class != null) c.emitSummonByName(_class.getName()); else if (_class_expression != null) _class_expression.generate_code(c, s); else throw new PlcException("emit_get_class_object", "can't get class object"); }
public String toString() { String type = "unknown"; if (_is_known) { if (_is_void) type = "void"; else if (_is_string) type = "string"; else if (_is_int) type = "int"; else if (_is_long) type = "long"; else if (_is_float) type = "float"; else if (_is_double) type = "double"; else if (_class != null) type = _class.toString(); } return type + (_is_container ? "[" + (_container_class == null ? "" : "*" + _container_class.toString()) + "]" : ""); }
public PhantomType(PhantomClass _c) throws PlcException { // if( _c == null ) throw new PlcException("PhantomType(PhantomClass)","Class is null"); _is_void = false; _is_string = false; _is_int = false; _is_long = false; _is_float = false; _is_double = false; _is_container = false; _is_known = (_c != null); _class = _c; _container_class = null; if (_c != null && _c.getName().equals(".internal.int")) _is_int = true; if (_c != null && _c.getName().equals(".internal.string")) _is_string = true; if (_c != null && _c.getName().equals(".internal.void")) _is_void = true; // if( _c != null && _c.get_name().equals(".internal.object") ) _is_void = true; }
public String get_contained_class_name() { if (_is_container) return _class == null ? "" : _class.getName(); return ""; }