// ino.module.CharLiteral.8628.package package de.dhbwstuttgart.syntaxtree.statement; // ino.end // ino.module.CharLiteral.8628.import import java.util.Hashtable; import java.util.Vector; import de.dhbwstuttgart.logger.Logger; import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.bytecode.JVMCode; 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.CharacterType; 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; import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet; // ino.class.CharLiteral.25166.declaration public class CharLiteral extends Literal // ino.end // ino.class.CharLiteral.25166.body { // ino.attribute.Char.25170.declaration private char Char; // ino.end // ino.attribute.parserlog.25173.declaration protected static Logger parserlog = Logger.getLogger("parser"); // ino.end // ino.method.CharLiteral.25176.definition public CharLiteral() // ino.end // ino.method.CharLiteral.25176.body { super(-1,-1); // #JB# 20.04.2005 // ########################################################### this.setType(new CharacterType(this)); //this.setType(new Type("char")); // ########################################################### } // ino.end // ino.method.sc_check.25179.definition public void sc_check(Vector classname, Hashtable ch, Hashtable bh, boolean ext, Hashtable parach, Hashtable parabh) // ino.end // ino.method.sc_check.25179.body { if(ext) parserlog.debug(" ---CharLiteral---"); } // ino.end // ino.method.set_Char.25182.definition public void set_Char( char c) // ino.end // ino.method.set_Char.25182.body { this.Char = c ; } // ino.end // ino.method.get_Name.25185.definition public String get_Name() // ino.end // ino.method.get_Name.25185.body { return null; } // ino.end // ino.method.codegen.25188.definition public void codegen(ClassFile classfile, CodeAttribute code, Vector paralist) throws JVMCodeException // ino.end // ino.method.codegen.25188.body { // Wert des chars auf den Stack laden code.add_code(JVMCode.bipush); code.add_code_byte((byte)Char); // Auto-Boxing des Typs in Character code.add_code(JVMCode.invokestatic); code.add_code_short(classfile.add_method_ref("java/lang/Character", "valueOf", "(C)Ljava/lang/Character;")); } // ino.end // ino.method.ConstantCodegen.25191.definition public short ConstantCodegen(ClassFile classfile) throws JVMCodeException // ino.end // ino.method.ConstantCodegen.25191.body { return (short) classfile.add_CONSTANT_Integer_info(Char); } // ino.end @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { // TODO Auto-generated method stub return null; } @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { return new JavaCodeResult("'"+String.valueOf(this.Char)+"'"); } @Override public Vector getChildren() { Vector ret = new Vector(); return ret; } @Override public void wandleRefTypeAttributes2GenericAttributes( Vector paralist, Vector genericMethodParameters) { } } // ino.end