JavaPatternMatching/src/de/dhbwstuttgart/syntaxtree/statement/Null.java

108 lines
2.9 KiB
Java
Raw Normal View History

2013-10-18 11:33:46 +00:00
// ino.module.Null.8644.package
2014-09-02 08:33:54 +00:00
package de.dhbwstuttgart.syntaxtree.statement;
2013-10-18 11:33:46 +00:00
// ino.end
// ino.module.Null.8644.import
import java.util.Hashtable;
import org.apache.bcel.generic.ClassGen;
2015-06-18 10:34:09 +00:00
import org.apache.bcel.generic.InstructionFactory;
import org.apache.bcel.generic.InstructionList;
2013-10-18 11:33:46 +00:00
import de.dhbwstuttgart.typeinference.Menge;
2014-10-09 10:01:16 +00:00
import de.dhbwstuttgart.logger.Logger;
2014-09-04 14:35:44 +00:00
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
import de.dhbwstuttgart.myexception.JVMCodeException;
2014-09-02 08:33:54 +00:00
import de.dhbwstuttgart.syntaxtree.Class;
2014-09-04 14:35:44 +00:00
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
2014-09-02 08:33:54 +00:00
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
import de.dhbwstuttgart.syntaxtree.type.Type;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.ConstraintsSet;
import de.dhbwstuttgart.typeinference.JavaCodeResult;
import de.dhbwstuttgart.typeinference.ResultSet;
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
2013-10-18 11:33:46 +00:00
// ino.class.Null.25919.declaration
public class Null extends Literal
// ino.end
// ino.class.Null.25919.body
{
// ino.attribute.parserlog.25923.declaration
protected static Logger parserlog = Logger.getLogger("parser");
// ino.end
// ino.method.Null.25926.definition
public Null()
// ino.end
// ino.method.Null.25926.body
{
super(-1,-1);
//this.setType(new Type("__NULL__",this,getOffset()));
2013-10-18 11:33:46 +00:00
}
// ino.end
// ino.method.get_Name.25929.definition
public String get_Name()
// ino.end
// ino.method.get_Name.25929.body
{
return null;
}
// ino.end
2014-11-04 12:47:05 +00:00
/*
2013-10-18 11:33:46 +00:00
// ino.method.sc_check.25932.definition
public void sc_check(Menge<Class> classname, Hashtable ch, Hashtable<String, String> bh, boolean ext, Hashtable parach, Hashtable<String, Hashtable> parabh)
2013-10-18 11:33:46 +00:00
// ino.end
// ino.method.sc_check.25932.body
{
if(ext)
parserlog.debug(" ---Null---");
}
// ino.end
2014-11-04 12:47:05 +00:00
*/
2013-10-18 11:33:46 +00:00
// ino.end
// ino.method.wandleRefTypeAttributes2GenericAttributes.25944.definition
public void wandleRefTypeAttributes2GenericAttributes(Menge<Type> paralist, Menge<GenericTypeVar> genericMethodParameters)
2013-10-18 11:33:46 +00:00
// ino.end
// ino.method.wandleRefTypeAttributes2GenericAttributes.25944.body
{
}
// ino.end
@Override
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
2015-01-20 17:32:51 +00:00
this.setType(TypePlaceholder.fresh(this));
return new ConstraintsSet();
2013-10-18 11:33:46 +00:00
}
@Override
public JavaCodeResult printJavaCode(ResultSet resultSet) {
return new JavaCodeResult("null");
}
2014-03-17 16:55:55 +00:00
@Override
public Menge<SyntaxTreeNode> getChildren() {
return new Menge<SyntaxTreeNode>();
2014-03-17 16:55:55 +00:00
}
@Override
2015-06-18 10:34:09 +00:00
public InstructionList genByteCode(ClassGen cg) {
InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool());
InstructionList il = new InstructionList();
2015-06-18 10:34:09 +00:00
il.append(_factory.ACONST_NULL);
2015-06-18 10:34:09 +00:00
return il;
}
2015-06-18 10:34:09 +00:00
2013-10-18 11:33:46 +00:00
}
// ino.end