// File: /workspace/github_cpp_makefile_star2_O1/matteorr[P]EarleyParser/EarleyParser.cpp
// Function: EarleyParser::createInputStringVector(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void EarleyParser::createInputStringVector( string filePath )
{
	string line;
	ifstream inputFile;
	string inputStringToParse;

	inputFile.open( filePath.c_str(), fstream::in );

	if( inputFile.is_open() )
	{
		/*
		 * reads a line (production) from the context free input grammar
		 */
		getline( inputFile, line );

		/*
		 * extracts words of the input string
		 * separated by " "
		 */
		this->splitToVector( line, & this->inputVector, " ", false );

		for( unsigned int i = 0; i < this->inputVector.size(); i++ ){
			cout << "[DEBUG]: " << "line token: [" << this->inputVector.at(i) << "]" << endl;

			EarleyParser::dictionaryHashTable::iterator got = this->earleyDictionary.find( this->inputVector.at(i) );
			if( got != this->earleyDictionary.end() )
			{
				/*
				 * element found in hash table (key tokenVector->at(i) contained)
				 */
				if( i == 0 )
					inputStringToParse += got->second;
				else
					inputStringToParse = inputStringToParse + " " + got->second;

			}else{
				/*
				 * element not found in hash table (key tokenVector->at(i) not contained)
				 * error in input string, word not contained in dictionary
				 */
				cout << "[DEBUG]: BAD INPUT STRING!word " << this->inputVector.at(i) << " not contained in dictionary" << endl << endl;
				exit(1);
			}
		}

		cout << "[DEBUG]: input string of parser [" << inputStringToParse << "]" << endl << endl;

		inputFile.close();

		/*
		 * extracts words of the input string to parse
		 * separated by " "
		 */
		this->splitToVector( inputStringToParse, & this->inputVector, " ", false );

		for( unsigned int i = 0; i < this->inputVector.size(); i++ ){
			cout << "[DEBUG]: " << "input vector element: [" << this->inputVector.at(i) << "]" << endl;
		}


	}else{
		cout << "Error: not able to open input file [" << filePath << "]" << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x2c0(%rbp), %rdi
callq 0x2210
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r14), %rsi
leaq -0x2c0(%rbp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x2130
leaq -0x248(%rbp), %rdi
callq 0x2070
testb %al, %al
je 0x3e63
movq -0x2c0(%rbp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %edx
leaq -0x2c0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x2310
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x6b47(%rip), %rsi      # 0xa5a1
leaq 0x6b41(%rip), %rdx      # 0xa5a2
leaq -0x48(%rbp), %rdi
callq 0x676a
leaq 0x98(%rbx), %rdx
leaq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rcx
movq %rdx, -0x90(%rbp)
xorl %r8d, %r8d
callq 0x327a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3a9d
callq 0x21a0
movq 0xa0(%rbx), %rax
cmpq 0x98(%rbx), %rax
je 0x3c99
leaq 0x48(%rbx), %rax
movq %rax, -0x98(%rbp)
movl $0x1, %r15d
xorl %r12d, %r12d
movl $0x9, %edx
movq 0xa507(%rip), %rdi      # 0xdfd8
leaq 0x6548(%rip), %rsi      # 0xa020
callq 0x2220
movl $0xd, %edx
movq 0xa4ef(%rip), %rdi      # 0xdfd8
leaq 0x653f(%rip), %rsi      # 0xa02f
callq 0x2220
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x3f9a
movq %r12, %r14
shlq $0x5, %r14
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
movq 0xa4ae(%rip), %rdi      # 0xdfd8
callq 0x2220
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x64fc(%rip), %rsi      # 0xa03d
callq 0x2220
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x98(%rbx), %rsi
movq 0xa0(%rbx), %rdx
subq %rsi, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x3f89
addq %r14, %rsi
movq -0x98(%rbp), %rdi
callq 0x6dec
movq %rax, %r13
testq %rax, %rax
je 0x3f11
cmpl $0x1, %r15d
jne 0x3bc3
movq 0x28(%r13), %rsi
movq 0x30(%r13), %rdx
leaq -0x68(%rbp), %rdi
callq 0x20b0
jmp 0x3c78
leaq -0xa8(%rbp), %r12
movq %r12, -0xb8(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r14
movq %r14, %rdi
callq 0x66d0
movq %r14, %rdi
leaq 0x69ac(%rip), %rsi      # 0xa5a1
callq 0x2320
movq 0x28(%r13), %rsi
movq 0x30(%r13), %rdx
movq %r14, %rdi
callq 0x20b0
leaq -0x38(%rbp), %r14
movq %r14, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3c2e
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x3c35
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2240
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x3c67
callq 0x21a0
movq -0xb8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3c78
callq 0x21a0
movq 0xa0(%rbx), %rax
subq 0x98(%rbx), %rax
movl %r15d, %r12d
sarq $0x5, %rax
incl %r15d
cmpq %r12, %rax
ja 0x3ac5
movq 0xa338(%rip), %rdi      # 0xdfd8
leaq 0x6558(%rip), %rsi      # 0xa1ff
movl $0x21, %edx
callq 0x2220
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq 0xa318(%rip), %rdi      # 0xdfd8
callq 0x2220
movq %rax, %r14
leaq 0x636e(%rip), %rsi      # 0xa03d
movl $0x1, %edx
movq %rax, %rdi
callq 0x2220
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq -0x2c0(%rbp), %rdi
callq 0x2060
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
movq %rax, (%rdi)
leaq 0x6856(%rip), %rsi      # 0xa5a1
leaq 0x6850(%rip), %rdx      # 0xa5a2
callq 0x676a
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %rcx
movq -0x90(%rbp), %rdx
xorl %r8d, %r8d
callq 0x327a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3d80
callq 0x21a0
movq 0xa0(%rbx), %rax
cmpq 0x98(%rbx), %rax
je 0x3ecc
movl $0x1, %r12d
xorl %r15d, %r15d
movq 0xa234(%rip), %r14      # 0xdfd8
leaq 0x6292(%rip), %r13      # 0xa03d
movl $0x9, %edx
movq %r14, %rdi
leaq 0x6266(%rip), %rsi      # 0xa020
callq 0x2220
movl $0x17, %edx
movq %r14, %rdi
leaq 0x6453(%rip), %rsi      # 0xa221
callq 0x2220
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r15, %rdx
jbe 0x3fab
shlq $0x5, %r15
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
movq %r14, %rdi
callq 0x2220
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2220
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0xa0(%rbx), %rax
subq 0x98(%rbx), %rax
movl %r12d, %r15d
sarq $0x5, %rax
incl %r12d
cmpq %r15, %rax
ja 0x3dab
jmp 0x3ecc
movq 0xa16e(%rip), %rdi      # 0xdfd8
leaq 0x62c4(%rip), %rsi      # 0xa135
movl $0x24, %edx
callq 0x2220
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xa14f(%rip), %rdi      # 0xdfd8
callq 0x2220
movq %rax, %rbx
leaq 0x61a5(%rip), %rsi      # 0xa03d
movl $0x1, %edx
movq %rax, %rdi
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3ede
callq 0x21a0
leaq -0x2c0(%rbp), %rdi
callq 0x2080
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x3eff
callq 0x21a0
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa0c0(%rip), %rdi      # 0xdfd8
leaq 0x62a3(%rip), %rsi      # 0xa1c2
movl $0x1f, %edx
callq 0x2220
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x3f89
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
movq 0xa085(%rip), %rdi      # 0xdfd8
callq 0x2220
movq %rax, %rbx
leaq 0x6280(%rip), %rsi      # 0xa1e2
movl $0x1c, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2230
leaq 0x6685(%rip), %rdi      # 0xa615
movq %r12, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x6674(%rip), %rdi      # 0xa615
movq %r12, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x6663(%rip), %rdi      # 0xa615
movq %r15, %rsi
xorl %eax, %eax
callq 0x2280
jmp 0x3fc0
jmp 0x4003
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
jne 0x3ff0
jmp 0x4006
jmp 0x4003
movq %rax, %rbx
leaq -0x78(%rbp), %r14
jmp 0x4028
jmp 0x4003
jmp 0x3fe1
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r12, %rdi
je 0x4006
callq 0x21a0
jmp 0x4006
jmp 0x4003
jmp 0x4003
jmp 0x4003
jmp 0x4003
jmp 0x4003
jmp 0x4003
movq %rax, %rbx
leaq -0x78(%rbp), %r14
leaq -0x58(%rbp), %rax
movq -0x68(%rbp), %rdi
cmpq %rax, %rdi
je 0x401c
callq 0x21a0
leaq -0x2c0(%rbp), %rdi
callq 0x2080
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4039
callq 0x21a0
movq %rbx, %rdi
callq 0x22f0
nop