// File: menhits[P]phplus/src/Lexer.cpp
// Function: CharClassifier::getTokenType(CharClassifier::Type, TokenData::Type)
inline TokenData::Type CharClassifier::getTokenType(CharClassifier::Type type, TokenData::Type previousType)
{
	if (previousType==TokenData::LINE_COMMENT)
	{
		if (type==NEWLINE)
			return TokenData::WHITESPACE;
		else
			return TokenData::LINE_COMMENT;
	}
	else if (previousType==TokenData::BLOCK_COMMENT)
	{
		if (type==MULTI_LINE_COMMENT_END)
			return TokenData::WHITESPACE;
		else
			return TokenData::BLOCK_COMMENT;
	}
	else if (previousType==TokenData::STRING_LITERAL)
	{
		if (type==STRING_QUOTE)
			return TokenData::WHITESPACE;
		else
			return TokenData::STRING_LITERAL;
		
	}
	
	switch (type)
	{
	
	case SINGLE_LINE_COMMENT:
		return TokenData::LINE_COMMENT;
	
	case MULTI_LINE_COMMENT_START:
		return TokenData::BLOCK_COMMENT;
	
	case MULTI_LINE_COMMENT_END:
		error.log("block comment end without start", SOURCE_ERROR);
		return TokenData::UNKNOWN;
		
	case WHITESPACE:
		return TokenData::WHITESPACE;
		
	case LINE_BREAK:
	case NEWLINE:
		return TokenData::LINE_END;
		
	case OPERATOR:
		return TokenData::OPERATOR;
		
	case LETTER:
	case DIGIT:
		if (previousType==TokenData::IDENTIFIER || previousType==TokenData::LITERAL)
			return previousType;
		else if (type==DIGIT)
			return TokenData::LITERAL;
		else
			return TokenData::IDENTIFIER;
		
	case STRING_QUOTE:
		return TokenData::STRING_LITERAL;
		
	default:
		return TokenData::UNKNOWN;
		
	}
}

// Assembly:
subq $0x78, %rsp
movl %edi, 0x70(%rsp)
movl %esi, 0x6c(%rsp)
cmpl $0x6, 0x6c(%rsp)
jne 0x36c64
cmpl $0x2, 0x70(%rsp)
jne 0x36c57
movl $0x0, 0x74(%rsp)
jmp 0x36e20
movl $0x6, 0x74(%rsp)
jmp 0x36e20
cmpl $0x7, 0x6c(%rsp)
jne 0x36c8c
cmpl $0x9, 0x70(%rsp)
jne 0x36c7f
movl $0x0, 0x74(%rsp)
jmp 0x36e20
movl $0x7, 0x74(%rsp)
jmp 0x36e20
cmpl $0x4, 0x6c(%rsp)
jne 0x36cb4
cmpl $0x6, 0x70(%rsp)
jne 0x36ca7
movl $0x0, 0x74(%rsp)
jmp 0x36e20
movl $0x4, 0x74(%rsp)
jmp 0x36e20
jmp 0x36cb6
jmp 0x36cb8
movl 0x70(%rsp), %eax
movq %rax, 0x18(%rsp)
subq $0x9, %rax
ja 0x36e18
movq 0x18(%rsp), %rax
leaq 0x9b4d1(%rip), %rcx     # 0xd21a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x6, 0x74(%rsp)
jmp 0x36e20
movl $0x7, 0x74(%rsp)
jmp 0x36e20
leaq 0x47(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xb690
movq 0x10(%rsp), %rdx
leaq 0x9b4d7(%rip), %rsi     # 0xd21ec
leaq 0x48(%rsp), %rdi
callq 0xb4c0
jmp 0x36d21
xorl %eax, %eax
movl %eax, 0x4(%rsp)
movl %eax, %esi
leaq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xfbe0
movl 0x4(%rsp), %edx
movq 0x8(%rsp), %rcx
leaq 0xe167b(%rip), %rdi     # 0x1183c3
leaq 0x48(%rsp), %rsi
callq 0x34c70
jmp 0x36d54
leaq 0x20(%rsp), %rdi
callq 0xfc00
leaq 0x48(%rsp), %rdi
callq 0xb6e8
leaq 0x47(%rsp), %rdi
callq 0xb3f0
movl $0xb, 0x74(%rsp)
jmp 0x36e20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x36db1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x20(%rsp), %rdi
callq 0xfc00
leaq 0x48(%rsp), %rdi
callq 0xb6e8
leaq 0x47(%rsp), %rdi
callq 0xb3f0
jmp 0x36e29
movl $0x0, 0x74(%rsp)
jmp 0x36e20
movl $0x1, 0x74(%rsp)
jmp 0x36e20
movl $0x5, 0x74(%rsp)
jmp 0x36e20
cmpl $0x2, 0x6c(%rsp)
je 0x36de9
cmpl $0x3, 0x6c(%rsp)
jne 0x36df3
movl 0x6c(%rsp), %eax
movl %eax, 0x74(%rsp)
jmp 0x36e20
cmpl $0x4, 0x70(%rsp)
jne 0x36e04
movl $0x3, 0x74(%rsp)
jmp 0x36e20
movl $0x2, 0x74(%rsp)
jmp 0x36e20
movl $0x4, 0x74(%rsp)
jmp 0x36e20
movl $0xb, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0xb680
nopw %cs:(%rax,%rax)
nopl (%rax)