forked from JavaTX/JavaCompilerCore
5f6525db19
nicht testbar.
146 lines
3.9 KiB
Java
Executable File
146 lines
3.9 KiB
Java
Executable File
// ino.module.IntLiteral.8635.package
|
|
package de.dhbwstuttgart.syntaxtree.statement;
|
|
// ino.end
|
|
// ino.module.IntLiteral.8635.import
|
|
import java.util.Hashtable;
|
|
|
|
import org.apache.bcel.generic.ClassGen;
|
|
import org.apache.bcel.generic.ConstantPoolGen;
|
|
import org.apache.bcel.generic.InstructionList;
|
|
import org.apache.bcel.generic.LDC;
|
|
import org.apache.bcel.generic.LDC2_W;
|
|
|
|
import de.dhbwstuttgart.typeinference.Menge;
|
|
import de.dhbwstuttgart.logger.Logger;
|
|
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
|
import de.dhbwstuttgart.myexception.JVMCodeException;
|
|
import de.dhbwstuttgart.syntaxtree.Class;
|
|
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
|
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
|
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
|
import de.dhbwstuttgart.syntaxtree.type.Type;
|
|
import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
|
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
|
import de.dhbwstuttgart.typeinference.ResultSet;
|
|
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
|
|
|
|
|
|
|
|
|
// ino.class.IntLiteral.25447.declaration
|
|
public class FloatLiteral extends Literal
|
|
// ino.end
|
|
// ino.class.IntLiteral.25447.body
|
|
{
|
|
// ino.attribute.Int.25451.declaration
|
|
private float Float;
|
|
// ino.end
|
|
// ino.attribute.parserlog.25454.declaration
|
|
protected static Logger parserlog = Logger.getLogger("parser");
|
|
// ino.end
|
|
|
|
|
|
// ino.method.IntLiteral.25457.definition
|
|
public FloatLiteral()
|
|
// ino.end
|
|
// ino.method.IntLiteral.25457.body
|
|
{
|
|
super(-1,-1);
|
|
|
|
this.setType(new RefType("Float",this,this.getOffset()));
|
|
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.set_Int.25460.definition
|
|
public void set_Float(float i)
|
|
// ino.end
|
|
// ino.method.set_Int.25460.body
|
|
{
|
|
this.Float = i;
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_Int.25463.definition
|
|
public float get_Float()
|
|
// ino.end
|
|
// ino.method.get_Int.25463.body
|
|
{
|
|
return Float;
|
|
}
|
|
// ino.end
|
|
|
|
/*
|
|
// ino.method.sc_check.25466.definition
|
|
public void sc_check(Menge<Class> classname, Hashtable ch, Hashtable<String, String> bh, boolean ext, Hashtable parach, Hashtable<String, Hashtable> parabh)
|
|
// ino.end
|
|
// ino.method.sc_check.25466.body
|
|
{
|
|
parserlog.debug("SC -> Semantik-Check f�r FloatLiteral wurde aufgerufen --> nichts zu tun!");
|
|
}
|
|
// ino.end
|
|
*/
|
|
|
|
// ino.method.get_Name.25469.definition
|
|
public String get_Name()
|
|
// ino.end
|
|
// ino.method.get_Name.25469.body
|
|
{
|
|
return null;
|
|
}
|
|
// ino.end
|
|
|
|
|
|
|
|
// ino.method.toString.25484.defdescription type=javadoc
|
|
/**
|
|
* <br/>Author: Martin Pl�micke
|
|
* @return
|
|
*/
|
|
// ino.end
|
|
// ino.method.toString.25484.definition
|
|
public String toString()
|
|
// ino.end
|
|
// ino.method.toString.25484.body
|
|
{
|
|
return type.toString() + " " + Float;
|
|
}
|
|
// ino.end
|
|
// ino.method.wandleRefTypeAttributes2GenericAttributes.25487.definition
|
|
public void wandleRefTypeAttributes2GenericAttributes(Menge<Type> paralist, Menge<GenericTypeVar> genericMethodParameters)
|
|
// ino.end
|
|
// ino.method.wandleRefTypeAttributes2GenericAttributes.25487.body
|
|
{
|
|
}
|
|
// ino.end
|
|
|
|
@Override
|
|
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
|
// TODO Auto-generated method stub
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public JavaCodeResult printJavaCode(ResultSet resultSet) {
|
|
// TODO Auto-generated method stub
|
|
return null;
|
|
}
|
|
@Override
|
|
public Menge<SyntaxTreeNode> getChildren() {
|
|
Menge<SyntaxTreeNode> ret = new Menge<SyntaxTreeNode>();
|
|
return ret;
|
|
}
|
|
|
|
@Override
|
|
public InstructionList genByteCode(ClassGen cg) {
|
|
ConstantPoolGen cp = cg.getConstantPool();
|
|
InstructionList il = new InstructionList();
|
|
|
|
cp.addFloat(get_Float());
|
|
il.append(new LDC(cp.getSize()-1));
|
|
return il;
|
|
|
|
}
|
|
}
|
|
// ino.end
|