// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.npc.util.expression.compile.ast;

import java.util.function.Function;
import com.hypixel.hytale.server.npc.util.expression.Scope;
import com.hypixel.hytale.server.npc.util.expression.compile.CompileContext;
import com.hypixel.hytale.server.npc.util.expression.compile.Parser;
import com.hypixel.hytale.server.npc.util.expression.ExecutionContext;
import com.hypixel.hytale.server.npc.util.expression.compile.Token;
import javax.annotation.Nonnull;
import com.hypixel.hytale.server.npc.util.expression.ValueType;

public class ASTOperatorTuple extends ASTOperator
{
    public ASTOperatorTuple(@Nonnull final ValueType arrayType, @Nonnull final Token token, final int tokenPosition) {
        super(arrayType, token, tokenPosition);
        this.codeGen = (Function<Scope, ExecutionContext.Instruction>)(scope -> ExecutionContext.genPACK(this.getValueType(), this.getArguments().size()));
    }
    
    @Override
    public boolean isConstant() {
        return false;
    }
    
    public static void fromParsedTuple(@Nonnull final Parser.ParsedToken openingToken, final int argumentCount, @Nonnull final CompileContext compileContext) {
        // 
        // This method could not be decompiled.
        // 
        // Original Bytecode:
        // 
        //     1: getfield        com/hypixel/hytale/server/npc/util/expression/compile/Parser$ParsedToken.token:Lcom/hypixel/hytale/server/npc/util/expression/compile/Token;
        //     4: astore_3        /* token */
        //     5: aload_3         /* token */
        //     6: getstatic       com/hypixel/hytale/server/npc/util/expression/compile/Token.OPEN_SQUARE_BRACKET:Lcom/hypixel/hytale/server/npc/util/expression/compile/Token;
        //     9: if_acmpeq       29
        //    12: new             Ljava/lang/IllegalStateException;
        //    15: dup            
        //    16: aload_3         /* token */
        //    17: invokevirtual   com/hypixel/hytale/server/npc/util/expression/compile/Token.get:()Ljava/lang/String;
        //    20: invokedynamic   BootstrapMethod #1, makeConcatWithConstants:(Ljava/lang/String;)Ljava/lang/String;
        //    25: invokespecial   java/lang/IllegalStateException.<init>:(Ljava/lang/String;)V
        //    28: athrow         
        //    29: aload_0         /* openingToken */
        //    30: getfield        com/hypixel/hytale/server/npc/util/expression/compile/Parser$ParsedToken.tokenPosition:I
        //    33: istore          tokenPosition
        //    35: aload_2         /* compileContext */
        //    36: invokevirtual   com/hypixel/hytale/server/npc/util/expression/compile/CompileContext.getOperandStack:()Ljava/util/Stack;
        //    39: astore          operandStack
        //    41: iload_1         /* argumentCount */
        //    42: ifne            62
        //    45: aload           operandStack
        //    47: new             new            !!! ERROR
        //    50: dup            
        //    51: aload_3         /* token */
        //    52: iload           tokenPosition
        //    54: invokespecial   invokespecial  !!! ERROR
        //    57: invokevirtual   java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;
        //    60: pop            
        //    61: return         
        //    62: aload           operandStack
        //    64: invokevirtual   java/util/Stack.size:()I
        //    67: istore          len
        //    69: iload           len
        //    71: iload_1         /* argumentCount */
        //    72: isub           
        //    73: istore          firstArgument
        //    75: aload           operandStack
        //    77: iload           firstArgument
        //    79: invokevirtual   java/util/Stack.get:(I)Ljava/lang/Object;
        //    82: checkcast       Lcom/hypixel/hytale/server/npc/util/expression/compile/ast/AST;
        //    85: invokevirtual   com/hypixel/hytale/server/npc/util/expression/compile/ast/AST.getValueType:()Lcom/hypixel/hytale/server/npc/util/expression/ValueType;
        //    88: astore          argumentType
        //    90: getstatic       com/hypixel/hytale/server/npc/util/expression/compile/ast/ASTOperatorTuple$1.$SwitchMap$com$hypixel$hytale$server$npc$util$expression$ValueType:[I
        //    93: aload           argumentType
        //    95: invokevirtual   com/hypixel/hytale/server/npc/util/expression/ValueType.ordinal:()I
        //    98: iaload         
        //    99: tableswitch {
        //                2: 124
        //                3: 130
        //                4: 136
        //          default: 142
        //        }
        //   124: getstatic       com/hypixel/hytale/server/npc/util/expression/ValueType.NUMBER_ARRAY:Lcom/hypixel/hytale/server/npc/util/expression/ValueType;
        //   127: goto            160
        //   130: getstatic       com/hypixel/hytale/server/npc/util/expression/ValueType.STRING_ARRAY:Lcom/hypixel/hytale/server/npc/util/expression/ValueType;
        //   133: goto            160
        //   136: getstatic       com/hypixel/hytale/server/npc/util/expression/ValueType.BOOLEAN_ARRAY:Lcom/hypixel/hytale/server/npc/util/expression/ValueType;
        //   139: goto            160
        //   142: new             Ljava/lang/IllegalStateException;
        //   145: dup            
        //   146: aload           argumentType
        //   148: invokestatic    java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
        //   151: invokedynamic   BootstrapMethod #2, makeConcatWithConstants:(Ljava/lang/String;)Ljava/lang/String;
        //   156: invokespecial   java/lang/IllegalStateException.<init>:(Ljava/lang/String;)V
        //   159: athrow         
        //   160: astore          arrayType
        //   162: iconst_1       
        //   163: istore          isConstant
        //   165: iload           firstArgument
        //   167: istore          i
        //   169: iload           i
        //   171: iload           len
        //   173: if_icmpge       240
        //   176: aload           operandStack
        //   178: iload           i
        //   180: invokevirtual   java/util/Stack.get:(I)Ljava/lang/Object;
        //   183: checkcast       Lcom/hypixel/hytale/server/npc/util/expression/compile/ast/AST;
        //   186: astore          ast
        //   188: iload           isConstant
        //   190: aload           ast
        //   192: invokevirtual   com/hypixel/hytale/server/npc/util/expression/compile/ast/AST.isConstant:()Z
        //   195: iand           
        //   196: istore          isConstant
        //   198: aload           ast
        //   200: invokevirtual   com/hypixel/hytale/server/npc/util/expression/compile/ast/AST.getValueType:()Lcom/hypixel/hytale/server/npc/util/expression/ValueType;
        //   203: aload           argumentType
        //   205: if_acmpeq       234
        //   208: new             Ljava/lang/IllegalStateException;
        //   211: dup            
        //   212: aload           argumentType
        //   214: invokestatic    java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
        //   217: aload           ast
        //   219: invokevirtual   com/hypixel/hytale/server/npc/util/expression/compile/ast/AST.getValueType:()Lcom/hypixel/hytale/server/npc/util/expression/ValueType;
        //   222: invokestatic    java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
        //   225: invokedynamic   BootstrapMethod #3, makeConcatWithConstants:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
        //   230: invokespecial   java/lang/IllegalStateException.<init>:(Ljava/lang/String;)V
        //   233: athrow         
        //   234: iinc            i, 1
        //   237: goto            169
        //   240: iload           isConstant
        //   242: ifeq            370
        //   245: getstatic       com/hypixel/hytale/server/npc/util/expression/compile/ast/ASTOperatorTuple$1.$SwitchMap$com$hypixel$hytale$server$npc$util$expression$ValueType:[I
        //   248: aload           arrayType
        //   250: invokevirtual   com/hypixel/hytale/server/npc/util/expression/ValueType.ordinal:()I
        //   253: iaload         
        //   254: tableswitch {
        //                8: 280
        //                9: 298
        //               10: 316
        //          default: 334
        //        }
        //   280: new             new            !!! ERROR
        //   283: dup            
        //   284: aload_3         /* token */
        //   285: iload           tokenPosition
        //   287: aload           operandStack
        //   289: iload           firstArgument
        //   291: iload_1         /* argumentCount */
        //   292: invokespecial   invokespecial  !!! ERROR
        //   295: goto            352
        //   298: new             new            !!! ERROR
        //   301: dup            
        //   302: aload_3         /* token */
        //   303: iload           tokenPosition
        //   305: aload           operandStack
        //   307: iload           firstArgument
        //   309: iload_1         /* argumentCount */
        //   310: invokespecial   invokespecial  !!! ERROR
        //   313: goto            352
        //   316: new             new            !!! ERROR
        //   319: dup            
        //   320: aload_3         /* token */
        //   321: iload           tokenPosition
        //   323: aload           operandStack
        //   325: iload           firstArgument
        //   327: iload_1         /* argumentCount */
        //   328: invokespecial   invokespecial  !!! ERROR
        //   331: goto            352
        //   334: new             Ljava/lang/IllegalStateException;
        //   337: dup            
        //   338: aload           arrayType
        //   340: invokestatic    java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
        //   343: invokedynamic   BootstrapMethod #4, makeConcatWithConstants:(Ljava/lang/String;)Ljava/lang/String;
        //   348: invokespecial   java/lang/IllegalStateException.<init>:(Ljava/lang/String;)V
        //   351: athrow         
        //   352: astore          item
        //   354: aload           operandStack
        //   356: iload           firstArgument
        //   358: invokevirtual   java/util/Stack.setSize:(I)V
        //   361: aload           operandStack
        //   363: aload           item
        //   365: invokevirtual   java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;
        //   368: pop            
        //   369: return         
        //   370: new             Lcom/hypixel/hytale/server/npc/util/expression/compile/ast/ASTOperatorTuple;
        //   373: dup            
        //   374: aload           arrayType
        //   376: aload_3         /* token */
        //   377: iload           tokenPosition
        //   379: invokespecial   com/hypixel/hytale/server/npc/util/expression/compile/ast/ASTOperatorTuple.<init>:(Lcom/hypixel/hytale/server/npc/util/expression/ValueType;Lcom/hypixel/hytale/server/npc/util/expression/compile/Token;I)V
        //   382: astore          ast
        //   384: iload           firstArgument
        //   386: istore          i
        //   388: iload           i
        //   390: iload           len
        //   392: if_icmpge       416
        //   395: aload           ast
        //   397: aload           operandStack
        //   399: iload           i
        //   401: invokevirtual   java/util/Stack.get:(I)Ljava/lang/Object;
        //   404: checkcast       Lcom/hypixel/hytale/server/npc/util/expression/compile/ast/AST;
        //   407: invokevirtual   com/hypixel/hytale/server/npc/util/expression/compile/ast/ASTOperatorTuple.addArgument:(Lcom/hypixel/hytale/server/npc/util/expression/compile/ast/AST;)V
        //   410: iinc            i, 1
        //   413: goto            388
        //   416: aload           operandStack
        //   418: iload           firstArgument
        //   420: invokevirtual   java/util/Stack.setSize:(I)V
        //   423: aload           operandStack
        //   425: aload           ast
        //   427: invokevirtual   java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;
        //   430: pop            
        //   431: return         
        //    StackMapTable: 00 12 FC 00 1D 07 00 18 FD 00 20 01 07 00 39 FE 00 3D 01 01 07 00 52 05 05 05 51 07 00 52 FE 00 08 07 00 52 01 01 FB 00 40 FA 00 05 27 11 11 11 51 07 00 AE 11 FD 00 11 07 00 0C 01 FA 00 1B
        // 
        // The error that occurred was:
        // 
        // java.lang.ClassCastException
        // 
        throw new IllegalStateException("An error occurred while decompiling this method.");
    }
}
