// File: /workspace/github_cpp_makefile_star2_O2/Blaze2305[P]Compiler-Design-2021-Assignment/src/Parser/Parser.cpp
// Function: Parser::accept(TokenType)
void Parser::accept(TokenType expected){
	if(expected == Identifier && identifierCheckFlag){
		if(!this->symtab.checkIfSymbolExists(currentToken.Value)){
			std::ostringstream out;
			out << "Syntax error on line ";
			out << currentToken.lineNumber;
			out << "  UNKNOWN IDENTIFIER ";
			out << currentToken.Value;
			throw  std::runtime_error(out.str());
		}
	}
	if(currentToken.tokenType == expected){
		printAcceptedToken(currentToken.tokenType,currentToken.lineNumber,currentToken.Value);
		currentToken =  scanner->getToken();
	}else{
		std::ostringstream out;
		out << "Syntax error on line ";
		out << currentToken.lineNumber;
		out << "  CURRENT TOKEN IS ";
		out << TOKEN_ENUM_TYPE_NAMES[currentToken.tokenType];
		out << "  CURRENT TOKEN NAME IS ";
		out << currentToken.Value;
		out << " BUT EXPECTED TOKEN IS ";
		out << TOKEN_ENUM_TYPE_NAMES[expected];
		throw  std::runtime_error(out.str());
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movl %esi, %r14d
movq %rdi, %rbx
testl %esi, %esi
jne 0x5d67
cmpb $0x1, 0x6c(%rbx)
jne 0x5d67
leaq 0x38(%rbx), %r12
leaq 0x8(%rbx), %r15
leaq -0x88(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x22a0
movq %r12, %rdi
movq %r13, %rsi
callq 0x85ea
movl %eax, %r12d
leaq -0x88(%rbp), %rdi
callq 0x23b8
testb %r12b, %r12b
je 0x5ec9
cmpl %r14d, (%rbx)
jne 0x5dd3
movl 0x28(%rbx), %r15d
leaq 0x8(%rbx), %rsi
leaq -0x68(%rbp), %r12
movq %r12, %rdi
callq 0x22a0
movl %r14d, %edi
movl %r15d, %esi
movq %r12, %rdx
callq 0x94c2
leaq -0x68(%rbp), %rdi
callq 0x23b8
movq 0x30(%rbx), %rsi
leaq -0x200(%rbp), %r14
movq %r14, %rdi
callq 0x8054
movq %rbx, %rdi
movq %r14, %rsi
callq 0x773a
leaq -0x1f8(%rbp), %rdi
callq 0x23b8
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x200(%rbp), %r15
movq %r15, %rdi
callq 0x2280
leaq 0x4423(%rip), %rsi      # 0xa20c
movq %r15, %rdi
callq 0x21d0
movl 0x28(%rbx), %esi
leaq -0x200(%rbp), %rdi
callq 0x2360
leaq 0x4431(%rip), %rsi      # 0xa238
leaq -0x200(%rbp), %rdi
callq 0x21d0
movl (%rbx), %esi
shlq $0x5, %rsi
leaq 0x9e08(%rip), %r15      # 0xfc28
addq %r15, %rsi
leaq -0x200(%rbp), %rdi
callq 0x21c0
leaq 0x4416(%rip), %rsi      # 0xa24c
leaq -0x200(%rbp), %rdi
callq 0x21d0
addq $0x8, %rbx
leaq -0x200(%rbp), %rdi
movq %rbx, %rsi
callq 0x21c0
leaq 0x4409(%rip), %rsi      # 0xa265
leaq -0x200(%rbp), %rdi
callq 0x21d0
movl %r14d, %eax
shlq $0x5, %rax
addq %rax, %r15
leaq -0x200(%rbp), %rdi
movq %r15, %rsi
callq 0x21c0
pushq $0x10
popq %rdi
callq 0x2120
movq %rax, %r14
leaq -0x1f8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2300
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x2310
xorl %r15d, %r15d
movq 0x913b(%rip), %rsi      # 0xeff0
movq 0x910c(%rip), %rdx      # 0xefc8
movq %r14, %rdi
callq 0x2350
jmp 0x5f5b
leaq -0x200(%rbp), %r14
movq %r14, %rdi
callq 0x2280
leaq 0x432d(%rip), %rsi      # 0xa20c
movq %r14, %rdi
callq 0x21d0
movl 0x28(%rbx), %esi
leaq -0x200(%rbp), %rdi
callq 0x2360
leaq 0x4325(%rip), %rsi      # 0xa222
leaq -0x200(%rbp), %rdi
callq 0x21d0
leaq -0x200(%rbp), %rdi
movq %r15, %rsi
callq 0x21c0
pushq $0x10
popq %rdi
callq 0x2120
movq %rax, %r14
leaq -0x1f8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2300
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x2310
xorl %r15d, %r15d
movq 0x90a4(%rip), %rsi      # 0xeff0
movq 0x9075(%rip), %rdx      # 0xefc8
movq %r14, %rdi
callq 0x2350
jmp 0x5f5f
jmp 0x5f72
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x23b8
testb %r15b, %r15b
jne 0x5f75
jmp 0x5f90
movq %rax, %rbx
movq %r14, %rdi
callq 0x2170
jmp 0x5f90
jmp 0x5f8d
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
jmp 0x5fa5
movq %rax, %rbx
leaq -0x200(%rbp), %rdi
callq 0x20a0
jmp 0x5faa
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x23b8
movq %rbx, %rdi
callq 0x2370