// File: /workspace/github_cpp_makefile_star2_O3/ssubrandon[P]460Project2/SyntacticalAnalyzer.cpp
// Function: SyntacticalAnalyzer::any_other_token()
int SyntacticalAnalyzer::any_other_token(){
   //This function deals with the stmt_pair_body rules (22-23) and will check for syntactical correctness,
  //this function will then, depending on the token seen, send the program tomre, tokens, any_other_tokens, or return. 
  int errors = 0;
	string error_type;
	ruleFile << "Entering any_other_token function; Current token is: " << lex ->GetTokenName(token) << ", lexeme: " << lex->GetLexeme() << endl;

	switch(token){
		case LPAREN_T:
			ruleFile << "Using Rule 50:\n";
			token = lex->GetToken();
			errors += more_tokens();
			if(token != RPAREN_T){
				errors++;
				ReportError(string("Expected RPARENT_T in any_other_token, but found " + lex->GetTokenName(token)));
			}
			else token = lex->GetToken();
      break;
		case IDENT_T:
			ruleFile << "Using Rule 51\n";
			token = lex->GetToken();
			break;
		case NUMLIT_T:
			ruleFile << "Using Rule 52\n";
			token = lex->GetToken();
			break;
		case STRLIT_T:
			ruleFile << "Using Rule 53\n";
			token = lex->GetToken();
			break;
		case CONS_T:
			ruleFile << "Using Rule 54\n";
			token = lex->GetToken();
			break;
		case IF_T:
			ruleFile << "Using Rule 55\n";
			token = lex->GetToken();
			break;
		case DISPLAY_T:
			ruleFile << "Using Rule 56\n";
			token = lex->GetToken();
			break;
		case NEWLINE_T:
			ruleFile << "Using Rule 57\n";
			token = lex->GetToken();
			break;
		case LISTOP_T:
			ruleFile << "Using Rule 58\n";
			token = lex->GetToken();
			break;
		case AND_T:
			ruleFile << "Using Rule 59\n";
			token = lex->GetToken();
			break;
		case OR_T:
			ruleFile << "Using Rule 60\n";
			token = lex->GetToken();
			break;
		case NOT_T:
			ruleFile << "Using Rule 61\n";
			token = lex->GetToken();
			break;
		case DEFINE_T:
			ruleFile << "Using Rule 62\n";
			token = lex->GetToken();
			break;
		case NUMBERP_T:
			ruleFile << "Using Rule 63\n";
			token = lex->GetToken();
			break;
		case LISTP_T:
			ruleFile << "Using Rule 64\n";
			token = lex->GetToken();
			break;
		case ZEROP_T:
			ruleFile << "Using Rule 65\n";
			token = lex->GetToken();
			break;
		case NULLP_T:
			ruleFile << "Using Rule 66\n";
			token = lex->GetToken();
			break;
		case STRINGP_T:
			ruleFile << "Using Rule 67\n";
			token = lex->GetToken();
			break;
		case PLUS_T:
			ruleFile << "Using Rule 68\n";
			token = lex->GetToken();
			break;
		case MINUS_T:
			ruleFile << "Using Rule 69\n";
			token = lex->GetToken();
			break;
		case DIV_T:
			ruleFile << "Using Rule 70\n";
			token = lex->GetToken();
			break;
		case MULT_T:
			ruleFile << "Using Rule 71\n";
			token = lex->GetToken();
			break;
		case MODULO_T:
			ruleFile << "Using Rule 72\n";
			token = lex->GetToken();
			break;
		case ROUND_T:
			ruleFile << "Using Rule 73\n";
			token = lex->GetToken();
			break;
		case EQUALTO_T:
			ruleFile << "Using Rule 74\n";
			token = lex->GetToken();
			break;
		case GT_T:
			ruleFile << "Using Rule 75\n";
			token = lex->GetToken();
			break;
		case LT_T:
			ruleFile << "Using Rule 76\n";
			token = lex->GetToken();
			break;
		case GTE_T:
			ruleFile << "Using Rule 77\n";
			token = lex->GetToken();
			break;
		case LTE_T:
			ruleFile << "Using Rule 78\n";
			token = lex->GetToken();
			break;
		case SQUOTE_T:
			ruleFile << "Using Rule 79\n";
			token = lex->GetToken();
			errors += any_other_token();
			break;
		case COND_T:
			ruleFile << "Using Rule 80\n";
			token = lex->GetToken();
			break;
		case ELSE_T:
			ruleFile << "Using Rule 81\n";
			token = lex->GetToken();
			break;
		default:
			//no rule found
			errors++;
			ReportError(string("No rule found in any_other_token function, current token is: " + lex->GetTokenName(token)));
			token = lex->GetToken();
	}

	//if the current token at this point is not apart of the follows then that is an error?
	ruleFile << "Exiting any_other_token function; current token is: " << lex->GetTokenName(token) << endl;
	return errors;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x420(%rdi), %rbx
leaq 0x31ac(%rip), %rsi      # 0xc42d
movl $0x35, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %rdi
callq 0x499a
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2260
movq %rax, %r15
leaq 0x25df(%rip), %rsi      # 0xb898
movl $0xa, %edx
movq %rax, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %rdi
callq 0x49d4
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r15, %rdi
callq 0x2260
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
leaq -0x58(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x9327
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x38(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x9340
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl 0x10(%r14), %edx
leal -0x1(%rdx), %eax
cmpl $0x20, %eax
ja 0x95b1
leaq 0x2461(%rip), %rcx      # 0xb7b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x313e(%rip), %rsi      # 0xc4a5
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x3257(%rip), %rsi      # 0xc5e0
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x31f9(%rip), %rsi      # 0xc5a4
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x318c(%rip), %rsi      # 0xc559
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x320f(%rip), %rsi      # 0xc5fe
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x31b1(%rip), %rsi      # 0xc5c2
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x30f9(%rip), %rsi      # 0xc52c
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x31d6(%rip), %rsi      # 0xc62b
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x313c(%rip), %rsi      # 0xc5b3
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x30b1(%rip), %rsi      # 0xc54a
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x3134(%rip), %rsi      # 0xc5ef
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2fe6(%rip), %rsi      # 0xc4c3
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x313b(%rip), %rsi      # 0xc63a
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x3128(%rip), %rsi      # 0xc649
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
movq %r14, %rdi
callq 0x924c
movl %eax, %r15d
jmp 0x981c
leaq 0x3106(%rip), %rsi      # 0xc658
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2fc7(%rip), %rsi      # 0xc53b
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x303b(%rip), %rsi      # 0xc5d1
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %rdi
callq 0x499a
leaq 0x30b1(%rip), %rcx      # 0xc676
leaq -0x68(%rbp), %rdi
movl $0x3d, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
movq %r13, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x991d
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x9925
leaq 0x2eae(%rip), %rsi      # 0xc4b4
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2ec8(%rip), %rsi      # 0xc4f0
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2eb5(%rip), %rsi      # 0xc4ff
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2efc(%rip), %rsi      # 0xc568
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2ee9(%rip), %rsi      # 0xc577
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2db3(%rip), %rsi      # 0xc463
movl $0xf, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
movq %r14, %rdi
callq 0x8ee0
movl %eax, %r15d
movl 0x10(%r14), %edx
cmpl $0x20, %edx
jne 0x98be
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
jmp 0x981c
leaq 0x2dd7(%rip), %rsi      # 0xc4d2
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2dc4(%rip), %rsi      # 0xc4e1
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2dde(%rip), %rsi      # 0xc51d
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2dad(%rip), %rsi      # 0xc50e
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2e12(%rip), %rsi      # 0xc595
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2de4(%rip), %rsi      # 0xc586
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2ea6(%rip), %rsi      # 0xc667
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2e3c(%rip), %rsi      # 0xc61c
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
jmp 0x9815
leaq 0x2e0e(%rip), %rsi      # 0xc60d
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
xorl %r15d, %r15d
leaq 0x2e91(%rip), %rsi      # 0xc6b4
movl $0x34, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %rdi
callq 0x499a
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x9890
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x98ac
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2210
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %rdi
callq 0x499a
leaq 0x2ba1(%rip), %rsi      # 0xc473
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0xa659
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x56f4
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x9900
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x9915
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
incl %r15d
jmp 0x981c
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x48(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x56f4
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x995d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x9972
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
movl $0x1, %r15d
jmp 0x981c
jmp 0x9990
jmp 0x99aa
jmp 0x9a0e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x99ad
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x99ad
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x9a11
movq -0x58(%rbp), %rsi
jmp 0x9a04
jmp 0x9a0e
jmp 0x9a0e
jmp 0x99c4
jmp 0x9a0e
movq %rax, %rbx
jmp 0x99f3
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x9a00
jmp 0x9a11
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x99f3
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9a11
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x9a11
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x9a2d
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2340
nop