// File: /workspace/github_cpp_makefile_star2_O1/AndrewAlbert[P]Compiler-Theory/SourceCode/parser.cpp
// Function: Parser::CheckToken(int)
bool Parser::CheckToken(int type){
	//skip all comment tokens
	while (token->type == T_COMMENT){
		*token = scanner->getToken();
	}

	if(token->line != currentLine ){
		currentLine = token->line;
		textLine = "";
	}
	//check that current token matches input type, if so move to next token
	if(token->type == type){
		textLine.append(" " + token->ascii);
		*token = scanner->getToken();
		return true;
	}
	else if(token->type == T_UNKNOWN){
			ReportError("Found unknown token " + token->ascii);
			*token = scanner->getToken();
		return CheckToken(type);
	}
	else if(token->type == T_EOF){
		return false;
	}
	else return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movl %esi, %ebp
movq %rdi, %rbx
movq 0x80(%rdi), %rax
cmpl $0x15c, 0x20(%rax)      # imm = 0x15C
jne 0x5c9b
leaq 0x40(%rsp), %r14
leaq 0x30(%rsp), %r13
leaq 0x20(%rsp), %r15
movq 0x88(%rbx), %rsi
movq %r15, %rdi
callq 0x31f0
movq 0x80(%rbx), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2270
addq $0x20, %r12
movl $0x108, %edx            # imm = 0x108
movq %r12, %rdi
movq %r14, %rsi
callq 0x2190
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x5c8b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x80(%rbx), %rax
cmpl $0x15c, 0x20(%rax)      # imm = 0x15C
je 0x5c3f
movl 0x24(%rax), %eax
cmpl 0x78(%rbx), %eax
je 0x5cbf
movl %eax, 0x78(%rbx)
leaq 0x58(%rbx), %rdi
movq 0x60(%rbx), %rdx
leaq 0x14ca8(%rip), %rcx     # 0x1a95d
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x22e0
movq 0x80(%rbx), %rdx
movl 0x20(%rdx), %eax
cmpl %ebp, %eax
jne 0x5d6f
leaq 0x58(%rbx), %r14
leaq 0x135e0(%rip), %rsi     # 0x192bc
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0xddc7
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x20c0
leaq 0x30(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x5d13
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x88(%rbx), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x31f0
movq 0x80(%rbx), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2270
addq $0x20, %rbx
leaq 0x40(%rsp), %r14
movl $0x108, %edx            # imm = 0x108
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2190
movq -0x20(%r14), %rdi
cmpq %r15, %rdi
je 0x5d68
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movb $0x1, %al
jmp 0x5e1a
cmpl $0x15e, %eax            # imm = 0x15E
jne 0x5e18
leaq 0x13563(%rip), %rsi     # 0x192e4
movq %rsp, %r14
movq %r14, %rdi
callq 0xddc7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5696
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5db2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x88(%rbx), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x31f0
movq 0x80(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2270
addq $0x20, %r15
leaq 0x40(%rsp), %r14
movl $0x108, %edx            # imm = 0x108
movq %r15, %rdi
movq %r14, %rsi
callq 0x2190
movq -0x20(%r14), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x5e0c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5c0a
jmp 0x5e1a
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5e62
movq 0x10(%rsp), %rsi
jmp 0x5e5a
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5e62
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2330