// File: /workspace/github_cpp_makefile_star2_O3/lishen2[P]Excel_formula_parser_cpp/FormulaParser.cpp
// Function: ExcelFormula::FormulaParser::parserToToken2()
void FormulaParser::parserToToken2()
	{
		// move tokenList to new set, excluding unnecessary white-space m_tmpAry and converting necessary ones to intersections

		TokenArray tmpAry2;
		m_tmpAry.reset();
		for(Token* pToken = m_tmpAry.getCurrent();
				!m_tmpAry.isEOF(); 
				m_tmpAry.moveNext(),pToken = m_tmpAry.getCurrent())
		{
			if (pToken == NULL) continue;

			if (pToken->getType() != Token::Whitespace) {
				tmpAry2.add(pToken->clone());
				continue;        
			}

			if (m_tmpAry.isBOF() || m_tmpAry.isEOF()) continue;

			Token* previous = m_tmpAry.getPrevious();

			if (previous == NULL) continue;

			if (!(
						((previous->getType() == Token::Function) && (previous->getSubtype() == Token::Stop)) || 
						((previous->getType() == Token::Subexpression) && (previous->getSubtype() == Token::Stop)) || 
						(previous->getType() == Token::Operand)
				 )
			   ) continue;

			Token* next = m_tmpAry.getNext();

			if (next == NULL) continue;

			if (!(
						((next->getType() == Token::Function) && (next->getSubtype() == Token::Start)) || 
						((next->getType() == Token::Subexpression) && (next->getSubtype() == Token::Start)) ||
						(next->getType() == Token::Operand)
				 )
			   ) continue;

			tmpAry2.add(MakeToken("", Token::OperatorInfix, Token::Intersection));
		}

		// move m_tmpAry to final list, switching infix "-" operators to prefix when appropriate, switching infix "+" operators 
		// to noop when appropriate, identifying operand and infix-operator subtypes, and pulling "@" from function names

		m_tmpAry.releaseAll();
		tmpAry2.reset();
		for(Token* pToken = tmpAry2.getCurrent();
				!tmpAry2.isEOF();
				tmpAry2.moveNext(), pToken = tmpAry2.getCurrent())
		{
			if (pToken == NULL) continue;

			Token* previous = tmpAry2.getPrevious();
			Token* next = tmpAry2.getNext();

			if ((pToken->getType() == Token::OperatorInfix) && (pToken->getStrValue().compare("-") == 0)) {
				if (tmpAry2.isBOF())
					pToken->setType(Token::OperatorPrefix);
				else if (
						((previous->getType() == Token::Function) && (previous->getSubtype() == Token::Stop)) || 
						((previous->getType() == Token::Subexpression) && (previous->getSubtype() == Token::Stop)) || 
						(previous->getType() == Token::OperatorPostfix) || 
						(previous->getType() == Token::Operand)
						)
					pToken->setSubtype(Token::Math);
				else
					pToken->setType(Token::OperatorPrefix);

				m_tmpAry.add(pToken);
				continue;          
			}

			if ((pToken->getType() == Token::OperatorInfix) && (pToken->getStrValue().compare("+") == 0)) {
				if (tmpAry2.isBOF())
					continue;
				else if (
						((previous->getType() == Token::Function) && (previous->getSubtype() == Token::Stop)) || 
						((previous->getType() == Token::Subexpression) && (previous->getSubtype() == Token::Stop)) || 
						(previous->getType() == Token::OperatorPostfix) || 
						(previous->getType() == Token::Operand)
						)
					pToken->setSubtype(Token::Math);
				else
					continue;

				m_tmpAry.add(pToken);
				continue;          
			}

			if ((pToken->getType() == Token::OperatorInfix) && (pToken->getSubtype() == Token::Nothing)) {
				static string marks("<>=");
				if (marks.find_first_of(*(pToken->getValue())) != string::npos) 
					pToken->setSubtype(Token::Logical);
				else if (pToken->getStrValue().compare("&") == 0)
					pToken->setSubtype(Token::Concatenation);
				else
					pToken->setSubtype(Token::Math);

				m_tmpAry.add(pToken);
				continue;
			}

			if ((pToken->getType() == Token::Operand) && (pToken->getSubtype() == Token::Nothing)) {
				if (StrUtils::is_number(pToken->getStrValue()))
					pToken->setSubtype(Token::Number);
				else
					if ((pToken->getStrValue().compare("TRUE") == 0) || (pToken->getStrValue().compare("FALSE") == 0))
						pToken->setSubtype(Token::Logical);
					else
						pToken->setSubtype(Token::Range);

				m_tmpAry.add(pToken);
				continue;
			}

			if (pToken->getType() == Token::Function) {
				if (pToken->getStrValue().size() > 0) {
					if (*(pToken->getValue()) == '@') {
						pToken->setValue(pToken->getStrValue().substr(1).c_str());
					}
				}
			}

			m_tmpAry.add(pToken);
		}//while

		m_tmpAry.toVector(m_tokens);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq -0x48(%rbp), %rdi
callq 0x43fc
leaq 0x38(%rbx), %r14
movq $0x0, 0x38(%rbx)
movq %r14, %rdi
callq 0x440c
leaq 0x19c4(%rip), %r15      # 0x51ec
leaq -0x48(%rbp), %r12
movq 0x38(%rbx), %rcx
movq 0x48(%rbx), %rdx
subq 0x40(%rbx), %rdx
sarq $0x3, %rdx
cmpq %rdx, %rcx
jae 0x38e8
testq %rax, %rax
je 0x38d3
cmpl $0x7, 0x20(%rax)
jne 0x38c0
testq %rcx, %rcx
je 0x38d3
movq %r14, %rdi
callq 0x4456
testq %rax, %rax
je 0x38d3
movl 0x20(%rax), %ecx
testl %ecx, %ecx
je 0x387d
cmpl $0x2, %ecx
je 0x3877
cmpl $0x1, %ecx
jne 0x38d3
cmpl $0x2, 0x24(%rax)
jne 0x38d3
movq %r14, %rdi
callq 0x4430
testq %rax, %rax
je 0x38d3
movl 0x20(%rax), %ecx
testl %ecx, %ecx
je 0x38a1
cmpl $0x2, %ecx
je 0x389b
cmpl $0x1, %ecx
jne 0x38d3
cmpl $0x1, 0x24(%rax)
jne 0x38d3
movq %r15, %rdi
movl $0x5, %esi
movl $0xa, %edx
callq 0x4298
movq %r12, %rdi
movq %rax, %rsi
callq 0x4470
jmp 0x38d3
movq %rax, %rdi
callq 0x4282
movq %r12, %rdi
movq %rax, %rsi
callq 0x4470
movq %r14, %rdi
callq 0x44ac
movq %r14, %rdi
callq 0x440c
jmp 0x382c
movq %r14, %rdi
callq 0x44f6
leaq -0x48(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x440c
movq %rax, %r13
leaq -0x48(%rbp), %r15
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
sarq $0x3, %rax
cmpq %rax, -0x48(%rbp)
jae 0x3bb6
testq %r13, %r13
je 0x3b37
movq %r15, %rdi
callq 0x4456
movq %rax, %r12
movq %r15, %rdi
callq 0x4430
movl 0x20(%r13), %eax
cmpl $0x5, %eax
jne 0x39e2
movq %r13, %rdi
leaq 0x17bf(%rip), %rsi      # 0x510f
callq 0x2080
testl %eax, %eax
je 0x3abb
movl 0x20(%r13), %eax
cmpl $0x5, %eax
jne 0x39e2
movq %r13, %rdi
leaq 0x17f3(%rip), %rsi      # 0x5163
callq 0x2080
testl %eax, %eax
je 0x3aef
movl 0x20(%r13), %eax
cmpl $0x5, %eax
jne 0x39e2
cmpl $0x0, 0x24(%r13)
jne 0x3b2c
movb 0x4819(%rip), %al       # 0x81b0
testb %al, %al
je 0x3b4f
movq (%r13), %rax
movsbl (%rax), %esi
leaq 0x47e3(%rip), %rdi      # 0x8190
xorl %edx, %edx
callq 0x21b0
movl $0x5, %ecx
cmpq $-0x1, %rax
jne 0x3b28
movq %r13, %rdi
leaq 0x179c(%rip), %rsi      # 0x5169
callq 0x2080
cmpl $0x1, %eax
movl $0x0, %ecx
adcl $0x8, %ecx
jmp 0x3b28
cmpl $0x1, %eax
je 0x3a48
testl %eax, %eax
jne 0x3b2c
cmpl $0x0, 0x24(%r13)
jne 0x3b2c
movq %r13, %rdi
callq 0x4094
movl $0x4, %ecx
testb %al, %al
jne 0x3b28
movq %r13, %rdi
leaq 0x1752(%rip), %rsi      # 0x516b
callq 0x2080
testl %eax, %eax
je 0x3b23
movq %r13, %rdi
leaq 0x1740(%rip), %rsi      # 0x5170
callq 0x2080
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal 0x5(,%rcx,2), %ecx
jmp 0x3b28
cmpq $0x0, 0x8(%r13)
je 0x3b2c
movq (%r13), %rax
cmpb $0x40, (%rax)
jne 0x3b2c
movl $0x1, %edx
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0x2190
movq -0x70(%rbp), %r12
movq 0x8(%r13), %rax
movq %rax, -0x50(%rbp)
movq %r12, %rdi
callq 0x20c0
movq %r13, %rdi
xorl %esi, %esi
movq -0x50(%rbp), %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x2210
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3b2c
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x3b2c
cmpq $0x0, -0x48(%rbp)
je 0x3ae5
movl 0x20(%r12), %eax
cmpq $0x6, %rax
ja 0x3ae5
leaq 0x1604(%rip), %rcx      # 0x50d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, 0x24(%r12)
je 0x3b19
movl $0x4, 0x20(%r13)
jmp 0x3b2c
cmpq $0x0, -0x48(%rbp)
je 0x3b37
movl 0x20(%r12), %eax
cmpq $0x6, %rax
ja 0x3b37
leaq 0x15b4(%rip), %rcx      # 0x50bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, 0x24(%r12)
jne 0x3b37
movl $0x8, 0x24(%r13)
jmp 0x3b2c
movl $0x5, %ecx
movl %ecx, 0x24(%r13)
movq %r14, %rdi
movq %r13, %rsi
callq 0x4470
movq %r15, %rdi
callq 0x44ac
movq %r15, %rdi
callq 0x440c
movq %rax, %r13
jmp 0x3907
leaq 0x465a(%rip), %rdi      # 0x81b0
callq 0x2270
testl %eax, %eax
je 0x399f
leaq 0x4636(%rip), %rax      # 0x81a0
movq %rax, 0x461f(%rip)      # 0x8190
leaq 0x4618(%rip), %rdi      # 0x8190
leaq 0x15e6(%rip), %rsi      # 0x5165
leaq 0x15e2(%rip), %rdx      # 0x5168
callq 0x3f3e
movq 0x442e(%rip), %rdi      # 0x7fc0
leaq 0x45f7(%rip), %rsi      # 0x8190
leaq 0x45b0(%rip), %rdx      # 0x8150
callq 0x2150
leaq 0x4604(%rip), %rdi      # 0x81b0
callq 0x20f0
jmp 0x399f
addq $0x20, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44d4
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3bda
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x45bd(%rip), %rdi      # 0x81b0
callq 0x20e0
jmp 0x3c2d
jmp 0x3c2a
jmp 0x3c2a
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3c2d
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x3c2d
jmp 0x3c2a
jmp 0x3c2a
jmp 0x3c2a
jmp 0x3c2a
jmp 0x3c2a
jmp 0x3c2a
jmp 0x3c2a
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3c42
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2250