1 package org.simantics.scl.compiler.constants;
3 import org.cojen.classfile.TypeDesc;
4 import org.objectweb.asm.Label;
5 import org.simantics.scl.compiler.internal.codegen.continuations.Cont;
6 import org.simantics.scl.compiler.internal.codegen.references.IVal;
7 import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder;
8 import org.simantics.scl.compiler.internal.codegen.utils.TransientClassBuilder;
9 import org.simantics.scl.compiler.types.Types;
11 public class CharacterConstant extends Constant {
14 public CharacterConstant(char value) {
15 super(Types.CHARACTER);
20 public void push(MethodBuilder mb) {
21 mb.loadConstant(value);
25 public String toString() {
26 return "'" + Character.toString(value) + "'";
29 public char getValue() {
34 public int hashCode() {
39 public boolean equals(Object obj) {
44 if (getClass() != obj.getClass())
46 CharacterConstant other = (CharacterConstant) obj;
47 if (value != other.value)
53 public void deconstruct(MethodBuilder mb, IVal parameter, Cont success,
55 mb.push(parameter, Types.CHARACTER);
56 mb.loadConstant(value);
57 mb.ifComparisonBranch(failure, "!=", TypeDesc.CHAR);
62 public int constructorTag() {
67 public Object realizeValue(TransientClassBuilder classBuilder) {