// File: navrajsaini[P]PL_Compiler_design_project/parser.cpp
// Function: Parse::Def()
void Parse::Def()//definition function
{where="D";check();

   
   if(LHS=="const")
   {
      //addone to the number of variables at the current block
      valLength[valLenPtr]++;

      //into const deff.
      ConstDef();
      //this adds the constant to the stack
      if(!checkDefConst())
	 scopeError("Ambiguous definition of constant");
      
   }else if(LHS=="integer"||LHS=="boolean"||LHS=="Boolean")
   {
      
      VarDef();
      if(!checkDefList())
	 scopeError("Ambiguious declaration in variable list");
   }else if(LHS=="proc")
   {
      //incriment to the next block
      valLenPtr++;

      ProcDef();

      //decrement to the previous block since end has been reached for current procedure
      valLenPtr--;
   }else
      errorReport();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x70(%rbp)
addq $0x5098, %rdi           # imm = 0x5098
leaq 0x9639(%rip), %rsi      # 0x1f91e
callq 0x2280
movq -0x70(%rbp), %rdi
callq 0x15310
movq -0x70(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x9031(%rip), %rsi      # 0x1f336
callq 0x10ea0
testb $0x1, %al
jne 0x16313
jmp 0x163bd
movq -0x70(%rbp), %rdi
movslq 0x71ec(%rdi), %rax
movl 0x71c4(%rdi,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, 0x71c4(%rdi,%rax,4)
callq 0x16510
movq -0x70(%rbp), %rdi
callq 0x15550
testb $0x1, %al
jne 0x163b8
leaq -0x29(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x2350
movq -0x78(%rbp), %rdx
leaq 0x94c0(%rip), %rsi      # 0x1f819
leaq -0x28(%rbp), %rdi
callq 0x2290
jmp 0x16364
movq -0x70(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x15400
jmp 0x16373
leaq -0x28(%rbp), %rdi
callq 0x2130
leaq -0x29(%rbp), %rdi
callq 0x21e0
jmp 0x163b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x163aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2130
leaq -0x29(%rbp), %rdi
callq 0x21e0
jmp 0x164ff
jmp 0x164f6
movq -0x70(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x8f6d(%rip), %rsi      # 0x1f33c
callq 0x10ea0
testb $0x1, %al
jne 0x16413
movq -0x70(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x9427(%rip), %rsi      # 0x1f811
callq 0x10ea0
testb $0x1, %al
jne 0x16413
movq -0x70(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x8f3f(%rip), %rsi      # 0x1f344
callq 0x10ea0
testb $0x1, %al
jne 0x16413
jmp 0x1649f
movq -0x70(%rbp), %rdi
callq 0x165c0
movq -0x70(%rbp), %rdi
callq 0x15680
testb $0x1, %al
jne 0x1649d
leaq -0x61(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x2350
movq -0x80(%rbp), %rdx
leaq 0x93f9(%rip), %rsi      # 0x1f83a
leaq -0x60(%rbp), %rdi
callq 0x2290
jmp 0x1644c
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x15400
jmp 0x1645b
leaq -0x60(%rbp), %rdi
callq 0x2130
leaq -0x61(%rbp), %rdi
callq 0x21e0
jmp 0x1649d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x16492
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2130
leaq -0x61(%rbp), %rdi
callq 0x21e0
jmp 0x164ff
jmp 0x164f4
movq -0x70(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x8b7b(%rip), %rsi      # 0x1f02c
callq 0x10ea0
testb $0x1, %al
jne 0x164bc
jmp 0x164e9
movq -0x70(%rbp), %rdi
movl 0x71ec(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x71ec(%rdi)
callq 0x16680
movq -0x70(%rbp), %rax
movl 0x71ec(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x71ec(%rax)
jmp 0x164f2
movq -0x70(%rbp), %rdi
callq 0x15110
jmp 0x164f4
jmp 0x164f6
addq $0x80, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2340
nopl (%rax,%rax)