summaryrefslogtreecommitdiff
path: root/plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java
blob: 4fa2ab385ceeb4f35422b734ff462dfd0fe10756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
/*
 * Copyright 2000-2014 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jetbrains.java.decompiler.modules.decompiler.exps;

import org.jetbrains.java.decompiler.code.CodeConstants;
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
import org.jetbrains.java.decompiler.modules.decompiler.vars.CheckTypesResult;
import org.jetbrains.java.decompiler.struct.gen.VarType;
import org.jetbrains.java.decompiler.util.InterpreterUtil;
import org.jetbrains.java.decompiler.util.ListStack;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;


public class FunctionExprent extends Exprent {

  public static final int FUNCTION_ADD = 0;
  public static final int FUNCTION_SUB = 1;
  public static final int FUNCTION_MUL = 2;
  public static final int FUNCTION_DIV = 3;

  public static final int FUNCTION_AND = 4;
  public static final int FUNCTION_OR = 5;
  public static final int FUNCTION_XOR = 6;

  public static final int FUNCTION_REM = 7;

  public static final int FUNCTION_SHL = 8;
  public static final int FUNCTION_SHR = 9;
  public static final int FUNCTION_USHR = 10;

  public static final int FUNCTION_BITNOT = 11;
  public static final int FUNCTION_BOOLNOT = 12;
  public static final int FUNCTION_NEG = 13;

  public final static int FUNCTION_I2L = 14;
  public final static int FUNCTION_I2F = 15;
  public final static int FUNCTION_I2D = 16;
  public final static int FUNCTION_L2I = 17;
  public final static int FUNCTION_L2F = 18;
  public final static int FUNCTION_L2D = 19;
  public final static int FUNCTION_F2I = 20;
  public final static int FUNCTION_F2L = 21;
  public final static int FUNCTION_F2D = 22;
  public final static int FUNCTION_D2I = 23;
  public final static int FUNCTION_D2L = 24;
  public final static int FUNCTION_D2F = 25;
  public final static int FUNCTION_I2B = 26;
  public final static int FUNCTION_I2C = 27;
  public final static int FUNCTION_I2S = 28;

  public final static int FUNCTION_CAST = 29;
  public final static int FUNCTION_INSTANCEOF = 30;

  public final static int FUNCTION_ARRAYLENGTH = 31;

  public final static int FUNCTION_IMM = 32;
  public final static int FUNCTION_MMI = 33;

  public final static int FUNCTION_IPP = 34;
  public final static int FUNCTION_PPI = 35;

  public final static int FUNCTION_IIF = 36;

  public final static int FUNCTION_LCMP = 37;
  public final static int FUNCTION_FCMPL = 38;
  public final static int FUNCTION_FCMPG = 39;
  public final static int FUNCTION_DCMPL = 40;
  public final static int FUNCTION_DCMPG = 41;

  public static final int FUNCTION_EQ = 42;
  public static final int FUNCTION_NE = 43;
  public static final int FUNCTION_LT = 44;
  public static final int FUNCTION_GE = 45;
  public static final int FUNCTION_GT = 46;
  public static final int FUNCTION_LE = 47;

  public static final int FUNCTION_CADD = 48;
  public static final int FUNCTION_COR = 49;

  public static final int FUNCTION_STRCONCAT = 50;

  private static final VarType[] types = new VarType[]{
    VarType.VARTYPE_LONG,
    VarType.VARTYPE_FLOAT,
    VarType.VARTYPE_DOUBLE,
    VarType.VARTYPE_INT,
    VarType.VARTYPE_FLOAT,
    VarType.VARTYPE_DOUBLE,
    VarType.VARTYPE_INT,
    VarType.VARTYPE_LONG,
    VarType.VARTYPE_DOUBLE,
    VarType.VARTYPE_INT,
    VarType.VARTYPE_LONG,
    VarType.VARTYPE_FLOAT,
    VarType.VARTYPE_BYTE,
    VarType.VARTYPE_CHAR,
    VarType.VARTYPE_SHORT
  };

  private static final String[] operators = new String[]{
    " + ",
    " - ",
    " * ",
    " / ",
    " & ",
    " | ",
    " ^ ",
    " % ",
    " << ",
    " >> ",
    " >>> ",
    " == ",
    " != ",
    " < ",
    " >= ",
    " > ",
    " <= ",
    " && ",
    " || ",
    " + "
  };

  private static final int[] precedence = new int[]{
    3,        //		FUNCTION_ADD
    3,        //		FUNCTION_SUB
    2,        //		FUNCTION_MUL
    2,        //		FUNCTION_DIV
    7,        //		FUNCTION_AND
    9,        //		FUNCTION_OR
    8,        //		FUNCTION_XOR
    2,        //		FUNCTION_REM
    4,        //		FUNCTION_SHL
    4,        //		FUNCTION_SHR
    4,        //		FUNCTION_USHR
    1,        //		FUNCTION_BITNOT
    1,        //		FUNCTION_BOOLNOT
    1,        //		FUNCTION_NEG
    1,        //		FUNCTION_I2L
    1,        //		FUNCTION_I2F
    1,        //		FUNCTION_I2D
    1,        //		FUNCTION_L2I
    1,        //		FUNCTION_L2F
    1,        //		FUNCTION_L2D
    1,        //		FUNCTION_F2I
    1,        //		FUNCTION_F2L
    1,        //		FUNCTION_F2D
    1,        //		FUNCTION_D2I
    1,        //		FUNCTION_D2L
    1,        //		FUNCTION_D2F
    1,        //		FUNCTION_I2B
    1,        //		FUNCTION_I2C
    1,        //		FUNCTION_I2S
    1,        //		FUNCTION_CAST
    6,        //		FUNCTION_INSTANCEOF
    0,        //		FUNCTION_ARRAYLENGTH
    1,        //		FUNCTION_IMM
    1,        //		FUNCTION_MMI
    1,        //		FUNCTION_IPP
    1,        //		FUNCTION_PPI
    12,        //		FUNCTION_IFF
    -1,        //		FUNCTION_LCMP
    -1,        //		FUNCTION_FCMPL
    -1,        //		FUNCTION_FCMPG
    -1,        //		FUNCTION_DCMPL
    -1,        //		FUNCTION_DCMPG
    6,        //		FUNCTION_EQ = 41;
    6,        //		FUNCTION_NE = 42;
    5,        //		FUNCTION_LT = 43;
    5,        //		FUNCTION_GE = 44;
    5,        //		FUNCTION_GT = 45;
    5,        //		FUNCTION_LE = 46;
    10,        //		FUNCTION_CADD = 47;
    11,        //		FUNCTION_COR = 48;
    3        //		FUNCTION_STRCONCAT = 49;
  };

  private static final HashSet<Integer> associativity =
    new HashSet<Integer>(Arrays.asList(new Integer[]{FUNCTION_ADD, FUNCTION_MUL, FUNCTION_AND,
      FUNCTION_OR, FUNCTION_XOR, FUNCTION_CADD, FUNCTION_COR, FUNCTION_STRCONCAT}));

  private int functype;

  private VarType implicitType;

  private List<Exprent> lstOperands = new ArrayList<Exprent>();

  {
    this.type = EXPRENT_FUNCTION;
  }

  public FunctionExprent(int functype, ListStack<Exprent> stack) {
    this.functype = functype;
    if (functype >= FUNCTION_BITNOT && functype <= FUNCTION_PPI && functype != FUNCTION_CAST
        && functype != FUNCTION_INSTANCEOF) {
      lstOperands.add(stack.pop());
    }
    else if (functype == FUNCTION_IIF) {
      throw new RuntimeException("no direct instantiation possible");
    }
    else {
      Exprent expr = stack.pop();
      lstOperands.add(stack.pop());
      lstOperands.add(expr);
    }
  }

  public FunctionExprent(int functype, List<Exprent> operands) {
    this.functype = functype;
    this.lstOperands = operands;
  }

  public VarType getExprType() {
    VarType exprType = null;

    if (functype <= FUNCTION_NEG || functype == FUNCTION_IPP || functype == FUNCTION_PPI
        || functype == FUNCTION_IMM || functype == FUNCTION_MMI) {

      VarType type1 = lstOperands.get(0).getExprType();
      VarType type2 = null;
      if (lstOperands.size() > 1) {
        type2 = lstOperands.get(1).getExprType();
      }

      switch (functype) {
        case FUNCTION_IMM:
        case FUNCTION_MMI:
        case FUNCTION_IPP:
        case FUNCTION_PPI:
          exprType = implicitType;
          break;
        case FUNCTION_BOOLNOT:
          exprType = VarType.VARTYPE_BOOLEAN;
          break;
        case FUNCTION_SHL:
        case FUNCTION_SHR:
        case FUNCTION_USHR:
        case FUNCTION_BITNOT:
        case FUNCTION_NEG:
          exprType = getMaxVarType(new VarType[]{type1});
          break;
        case FUNCTION_ADD:
        case FUNCTION_SUB:
        case FUNCTION_MUL:
        case FUNCTION_DIV:
        case FUNCTION_REM:
          exprType = getMaxVarType(new VarType[]{type1, type2});
          break;
        case FUNCTION_AND:
        case FUNCTION_OR:
        case FUNCTION_XOR:
          if (type1.type == CodeConstants.TYPE_BOOLEAN & type2.type == CodeConstants.TYPE_BOOLEAN) {
            exprType = VarType.VARTYPE_BOOLEAN;
          }
          else {
            exprType = getMaxVarType(new VarType[]{type1, type2});
          }
      }
    }
    else if (functype == FUNCTION_CAST) {
      exprType = lstOperands.get(1).getExprType();
    }
    else if (functype == FUNCTION_IIF) {
      Exprent param1 = lstOperands.get(1);
      Exprent param2 = lstOperands.get(2);
      VarType supertype = VarType.getCommonSupertype(param1.getExprType(), param2.getExprType());

      if (param1.type == Exprent.EXPRENT_CONST && param2.type == Exprent.EXPRENT_CONST &&
          supertype.type != CodeConstants.TYPE_BOOLEAN && VarType.VARTYPE_INT.isSuperset(supertype)) {
        exprType = VarType.VARTYPE_INT;
      }
      else {
        exprType = supertype;
      }
    }
    else if (functype == FUNCTION_STRCONCAT) {
      exprType = VarType.VARTYPE_STRING;
    }
    else if (functype >= FUNCTION_EQ || functype == FUNCTION_INSTANCEOF) {
      exprType = VarType.VARTYPE_BOOLEAN;
    }
    else if (functype >= FUNCTION_ARRAYLENGTH) {
      exprType = VarType.VARTYPE_INT;
    }
    else {
      exprType = types[functype - FUNCTION_I2L];
    }

    return exprType;
  }

  public int getExprentUse() {

    if (functype >= FUNCTION_IMM && functype <= FUNCTION_PPI) {
      return 0;
    }
    else {
      int ret = Exprent.MULTIPLE_USES | Exprent.SIDE_EFFECTS_FREE;
      for (Exprent expr : lstOperands) {
        ret &= expr.getExprentUse();
      }
      return ret;
    }
  }

  public CheckTypesResult checkExprTypeBounds() {
    CheckTypesResult result = new CheckTypesResult();

    Exprent param1 = lstOperands.get(0);
    VarType type1 = param1.getExprType();
    Exprent param2 = null;
    VarType type2 = null;

    if (lstOperands.size() > 1) {
      param2 = lstOperands.get(1);
      type2 = param2.getExprType();
    }

    switch (functype) {
      case FUNCTION_IIF:
        VarType supertype = getExprType();
        if (supertype == null) {
          supertype = getExprType();
        }
        result.addMinTypeExprent(param1, VarType.VARTYPE_BOOLEAN);
        result.addMinTypeExprent(param2, VarType.getMinTypeInFamily(supertype.type_family));
        result.addMinTypeExprent(lstOperands.get(2), VarType.getMinTypeInFamily(supertype.type_family));
        break;
      case FUNCTION_I2L:
      case FUNCTION_I2F:
      case FUNCTION_I2D:
      case FUNCTION_I2B:
      case FUNCTION_I2C:
      case FUNCTION_I2S:
        result.addMinTypeExprent(param1, VarType.VARTYPE_BYTECHAR);
        result.addMaxTypeExprent(param1, VarType.VARTYPE_INT);
        break;
      case FUNCTION_IMM:
      case FUNCTION_IPP:
      case FUNCTION_MMI:
      case FUNCTION_PPI:
        result.addMinTypeExprent(param1, implicitType);
        result.addMaxTypeExprent(param1, implicitType);
        break;
      case FUNCTION_ADD:
      case FUNCTION_SUB:
      case FUNCTION_MUL:
      case FUNCTION_DIV:
      case FUNCTION_REM:
      case FUNCTION_SHL:
      case FUNCTION_SHR:
      case FUNCTION_USHR:
      case FUNCTION_LT:
      case FUNCTION_GE:
      case FUNCTION_GT:
      case FUNCTION_LE:
        result.addMinTypeExprent(param2, VarType.VARTYPE_BYTECHAR);
      case FUNCTION_BITNOT:
        // case FUNCTION_BOOLNOT:
      case FUNCTION_NEG:
        result.addMinTypeExprent(param1, VarType.VARTYPE_BYTECHAR);
        break;
      case FUNCTION_AND:
      case FUNCTION_OR:
      case FUNCTION_XOR:
      case FUNCTION_EQ:
      case FUNCTION_NE: {
        if (type1.type == CodeConstants.TYPE_BOOLEAN) {

          if (type2.isStrictSuperset(type1)) {

            result.addMinTypeExprent(param1, VarType.VARTYPE_BYTECHAR);
          }
          else { // both are booleans

            boolean param1_false_boolean =
              type1.isFalseBoolean() || (param1.type == Exprent.EXPRENT_CONST && !((ConstExprent)param1).hasBooleanValue());
            boolean param2_false_boolean =
              type1.isFalseBoolean() || (param2.type == Exprent.EXPRENT_CONST && !((ConstExprent)param2).hasBooleanValue());

            if (param1_false_boolean || param2_false_boolean) {
              result.addMinTypeExprent(param1, VarType.VARTYPE_BYTECHAR);
              result.addMinTypeExprent(param2, VarType.VARTYPE_BYTECHAR);
            }
          }
        }
        else if (type2.type == CodeConstants.TYPE_BOOLEAN) {

          if (type1.isStrictSuperset(type2)) {
            result.addMinTypeExprent(param2, VarType.VARTYPE_BYTECHAR);
          }
        }
      }
    }

    return result;
  }

  public List<Exprent> getAllExprents() {
    List<Exprent> lst = new ArrayList<Exprent>();
    lst.addAll(lstOperands);
    return lst;
  }

  public Exprent copy() {
    List<Exprent> lst = new ArrayList<Exprent>();
    for (Exprent expr : lstOperands) {
      lst.add(expr.copy());
    }
    FunctionExprent func = new FunctionExprent(functype, lst);
    func.setImplicitType(implicitType);

    return func;
  }

  public boolean equals(Object o) {
    if (o == this) return true;
    if (o == null || !(o instanceof FunctionExprent)) return false;

    FunctionExprent fe = (FunctionExprent)o;
    return functype == fe.getFunctype() &&
           InterpreterUtil.equalLists(lstOperands, fe.getLstOperands()); // TODO: order of operands insignificant
  }

  public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
    for (int i = 0; i < lstOperands.size(); i++) {
      if (oldexpr == lstOperands.get(i)) {
        lstOperands.set(i, newexpr);
      }
    }
  }

  public String toJava(int indent) {

    if (functype <= FUNCTION_USHR) {
      return wrapOperandString(lstOperands.get(0), false, indent) + operators[functype] +
             wrapOperandString(lstOperands.get(1), true, indent);
    }

    if (functype >= FUNCTION_EQ) {
      return wrapOperandString(lstOperands.get(0), false, indent) + operators[functype - FUNCTION_EQ + 11] +
             wrapOperandString(lstOperands.get(1), true, indent);
    }

    switch (functype) {
      case FUNCTION_BITNOT:
        return "~" + wrapOperandString(lstOperands.get(0), true, indent);
      case FUNCTION_BOOLNOT:
        return "!" + wrapOperandString(lstOperands.get(0), true, indent);
      case FUNCTION_NEG:
        return "-" + wrapOperandString(lstOperands.get(0), true, indent);
      case FUNCTION_CAST:
        return "(" + lstOperands.get(1).toJava(indent) + ")" + wrapOperandString(lstOperands.get(0), true, indent);
      case FUNCTION_ARRAYLENGTH:
        Exprent arr = lstOperands.get(0);

        String res = wrapOperandString(arr, false, indent);
        if (arr.getExprType().arraydim == 0) {
          VarType objarr = VarType.VARTYPE_OBJECT.copy();
          objarr.arraydim = 1; // type family does not change

          res = "((" + ExprProcessor.getCastTypeName(objarr) + ")" + res + ")";
        }
        return res + ".length";
      case FUNCTION_IIF:
        return wrapOperandString(lstOperands.get(0), true, indent) + "?" + wrapOperandString(lstOperands.get(1), true, indent) + ":" +
               wrapOperandString(lstOperands.get(2), true, indent);
      case FUNCTION_IPP:
        return wrapOperandString(lstOperands.get(0), true, indent) + "++";
      case FUNCTION_PPI:
        return "++" + wrapOperandString(lstOperands.get(0), true, indent);
      case FUNCTION_IMM:
        return wrapOperandString(lstOperands.get(0), true, indent) + "--";
      case FUNCTION_MMI:
        return "--" + wrapOperandString(lstOperands.get(0), true, indent);
      case FUNCTION_INSTANCEOF:
        return wrapOperandString(lstOperands.get(0), true, indent) + " instanceof " + wrapOperandString(lstOperands.get(1), true, indent);
      case FUNCTION_LCMP: // shouldn't appear in the final code
        return "__lcmp__(" +
               wrapOperandString(lstOperands.get(0), true, indent) +
               "," +
               wrapOperandString(lstOperands.get(1), true, indent) +
               ")";
      case FUNCTION_FCMPL: // shouldn't appear in the final code
        return "__fcmpl__(" +
               wrapOperandString(lstOperands.get(0), true, indent) +
               "," +
               wrapOperandString(lstOperands.get(1), true, indent) +
               ")";
      case FUNCTION_FCMPG: // shouldn't appear in the final code
        return "__fcmpg__(" +
               wrapOperandString(lstOperands.get(0), true, indent) +
               "," +
               wrapOperandString(lstOperands.get(1), true, indent) +
               ")";
      case FUNCTION_DCMPL: // shouldn't appear in the final code
        return "__dcmpl__(" +
               wrapOperandString(lstOperands.get(0), true, indent) +
               "," +
               wrapOperandString(lstOperands.get(1), true, indent) +
               ")";
      case FUNCTION_DCMPG: // shouldn't appear in the final code
        return "__dcmpg__(" +
               wrapOperandString(lstOperands.get(0), true, indent) +
               "," +
               wrapOperandString(lstOperands.get(1), true, indent) +
               ")";
    }

    if (functype <= FUNCTION_I2S) {
      return "(" + ExprProcessor.getTypeName(types[functype - FUNCTION_I2L]) + ")" + wrapOperandString(lstOperands.get(0), true, indent);
    }

    //		return "<unknown function>";
    throw new RuntimeException("invalid function");
  }

  public int getPrecedence() {
    return getPrecedence(functype);
  }

  public static int getPrecedence(int func) {
    return precedence[func];
  }

  public VarType getSimpleCastType() {
    return types[functype - FUNCTION_I2L];
  }

  private String wrapOperandString(Exprent expr, boolean eq, int indent) {

    int myprec = getPrecedence();
    int exprprec = expr.getPrecedence();

    boolean parentheses = exprprec > myprec;
    if (!parentheses && eq) {
      parentheses = (exprprec == myprec);
      if (parentheses) {
        if (expr.type == Exprent.EXPRENT_FUNCTION &&
            ((FunctionExprent)expr).getFunctype() == functype) {
          parentheses = !associativity.contains(functype);
        }
      }
    }

    String res = expr.toJava(indent);

    if (parentheses) {
      res = "(" + res + ")";
    }

    return res;
  }

  private static VarType getMaxVarType(VarType[] arr) {

    int[] types = new int[]{CodeConstants.TYPE_DOUBLE, CodeConstants.TYPE_FLOAT, CodeConstants.TYPE_LONG};
    VarType[] vartypes = new VarType[]{VarType.VARTYPE_DOUBLE, VarType.VARTYPE_FLOAT, VarType.VARTYPE_LONG};

    for (int i = 0; i < types.length; i++) {
      for (int j = 0; j < arr.length; j++) {
        if (arr[j].type == types[i]) {
          return vartypes[i];
        }
      }
    }

    return VarType.VARTYPE_INT;
  }

  // *****************************************************************************
  // getter and setter methods
  // *****************************************************************************

  public int getFunctype() {
    return functype;
  }

  public void setFunctype(int functype) {
    this.functype = functype;
  }

  public List<Exprent> getLstOperands() {
    return lstOperands;
  }

  public void setLstOperands(List<Exprent> lstOperands) {
    this.lstOperands = lstOperands;
  }

  public VarType getImplicitType() {
    return implicitType;
  }

  public void setImplicitType(VarType implicitType) {
    this.implicitType = implicitType;
  }
}