// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: Parser::GetToken(bool)
const Parser::TokenType Parser::GetToken (const bool ignoreSign)
  {
  word_.erase (0, std::string::npos);
  
  // skip spaces
  while (*pWord_ && isspace (*pWord_))
    ++pWord_;

  pWordStart_ = pWord_;   // remember where word_ starts *now*
  
  // look out for unterminated statements and things
  if (*pWord_ == 0 &&  // we have EOF
      type_ == END)  // after already detecting it
    throw std::runtime_error ("Unexpected end of expression.");

  unsigned char cFirstCharacter = *pWord_;        // first character in new word_
  
  if (cFirstCharacter == 0)    // stop at end of file
    {
    word_ = "<end of expression>";
    return type_ = END;
    }
  
  unsigned char cNextCharacter  = *(pWord_ + 1);  // 2nd character in new word_
  
  // look for number
  // can be: + or - followed by a decimal point
  // or: + or - followed by a digit
  // or: starting with a digit
  // or: decimal point followed by a digit
  if ((!ignoreSign &&
	   (cFirstCharacter == '+' || cFirstCharacter == '-') &&
	   (isdigit (cNextCharacter) || cNextCharacter == '.')
	   )
	  || isdigit (cFirstCharacter)
	  // allow decimal numbers without a leading 0. e.g. ".5"
	  // Dennis Jones 01-30-2009
	  || (cFirstCharacter == '.' && isdigit (cNextCharacter)) )
	  {
    // skip sign for now
    if ((cFirstCharacter == '+' || cFirstCharacter == '-'))
      pWord_++;
    while (isdigit (*pWord_) || *pWord_ == '.')
      pWord_++;
    
    // allow for 1.53158e+15
    if (*pWord_ == 'e' || *pWord_ == 'E')
      {
      pWord_++; // skip 'e'
      if ((*pWord_  == '+' || *pWord_  == '-'))
        pWord_++; // skip sign after e
      while (isdigit (*pWord_))  // now digits after e
        pWord_++;      
      }
    
    word_ = std::string (pWordStart_, pWord_ - pWordStart_);
    
    std::istringstream is (word_);
    // parse std::string into double value
    is >> value_;
      
    if (is.fail () || !is.eof ())
      throw std::runtime_error ("Bad numeric literal: " + word_);
    return type_ = NUMBER;
    }   // end of number found

  // special test for 2-character sequences: <= >= == !=
  // also +=, -=, /=, *=
  if (cNextCharacter == '=')
    {
    switch (cFirstCharacter)
      {
      // comparisons
      case '=': type_ = EQ;   break;
      case '<': type_ = LE;   break;
      case '>': type_ = GE;   break;
      case '!': type_ = NE;   break;
      // assignments
      case '+': type_ = ASSIGN_ADD;   break;
      case '-': type_ = ASSIGN_SUB;   break;
      case '*': type_ = ASSIGN_MUL;   break;
      case '/': type_ = ASSIGN_DIV;   break;
      // none of the above
      default:  type_ = NONE; break;
      } // end of switch on cFirstCharacter
    
    if (type_ != NONE)
      {
      word_ = std::string (pWordStart_, 2);
      pWord_ += 2;   // skip both characters
      return type_;
      } // end of found one    
    } // end of *=
  
  switch (cFirstCharacter)
    {
    case '&': if (cNextCharacter == '&')    // &&
                {
                word_ = std::string (pWordStart_, 2);
                pWord_ += 2;   // skip both characters
                return type_ = AND;
                }
              break;
   case '|': if (cNextCharacter == '|')   // ||
                {
                word_ = std::string (pWordStart_, 2);
                pWord_ += 2;   // skip both characters
                return type_ = OR;
                }
              break;
    // single-character symboles
    case '=':
    case '<':
    case '>':
    case '+':
    case '-':
    case '/':
    case '*':
    case '(':
    case ')':
    case ',':
    case '!':
      word_ = std::string (pWordStart_, 1);
      ++pWord_;   // skip it
      return type_ = TokenType (cFirstCharacter);
    } // end of switch on cFirstCharacter
  
  if (!isalpha (cFirstCharacter))
    {
    if (cFirstCharacter < ' ')
      {
      std::ostringstream s;
      s << "Unexpected character (decimal " << int (cFirstCharacter) << ")";
      throw std::runtime_error (s.str ());    
      }
    else
      throw std::runtime_error ("Unexpected character: " + std::string (1, cFirstCharacter));
    }
  
  // we have a word (starting with A-Z) - pull it out
  while (isalnum (*pWord_) || *pWord_ == '_')
    ++pWord_;
  
  word_ = std::string (pWordStart_, pWord_ - pWordStart_);
  return type_ = NAME;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %esi, %ebp
movq %rdi, %rbx
movq $0x0, 0x40(%rdi)
movq 0x38(%rdi), %rax
movb $0x0, (%rax)
movq 0x20(%rdi), %r15
movb (%r15), %al
testb %al, %al
je 0x88ee
incq %r15
movsbl %al, %edi
callq 0x7090
testl %eax, %eax
je 0x88eb
movq %r15, 0x20(%rbx)
movb (%r15), %al
incq %r15
testb %al, %al
jne 0x88d1
decq %r15
movq %r15, 0x28(%rbx)
movzbl (%r15), %r12d
testl %r12d, %r12d
jne 0x8905
cmpl $0x3, 0x30(%rbx)
je 0x8d9c
leaq 0x38(%rbx), %r14
testl %r12d, %r12d
je 0x8aa0
movzbl 0x1(%r15), %eax
testb %bpl, %bpl
jne 0x8934
cmpl $0x2d, %r12d
je 0x8928
cmpl $0x2b, %r12d
jne 0x8934
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jb 0x8954
cmpb $0x2e, %al
je 0x8954
leal -0x30(%r12), %ecx
cmpl $0xa, %ecx
jb 0x8954
cmpl $0x2e, %r12d
jne 0x8add
leal -0x30(%rax), %ecx
cmpl $0x9, %ecx
ja 0x8add
cmpl $0x2d, %r12d
je 0x8960
cmpl $0x2b, %r12d
jne 0x8968
leaq 0x1(%r15), %rax
movq %rax, 0x20(%rbx)
movq 0x20(%rbx), %rax
movsbl (%rax), %ecx
cmpl $0x2e, %ecx
setne %dl
movl %ecx, %esi
addl $-0x30, %esi
cmpl $0xa, %esi
setae %sil
testb %sil, %dl
jne 0x89ae
incq %rax
movq %rax, 0x20(%rbx)
movsbl (%rax), %ecx
cmpl $0x2e, %ecx
sete %dl
leal -0x30(%rcx), %esi
cmpl $0xa, %esi
setb %sil
orb %dl, %sil
incq %rax
testb %sil, %sil
jne 0x8989
decq %rax
movzbl %cl, %ecx
orl $0x20, %ecx
cmpl $0x65, %ecx
jne 0x89fb
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movzbl 0x1(%rax), %ecx
cmpl $0x2d, %ecx
je 0x89cf
cmpl $0x2b, %ecx
jne 0x89d7
addq $0x2, %rax
movq %rax, 0x20(%rbx)
movq 0x20(%rbx), %rax
movsbl (%rax), %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0x89fb
incq %rax
movq %rax, 0x20(%rbx)
movsbl (%rax), %ecx
addl $-0x30, %ecx
incq %rax
cmpl $0xa, %ecx
jb 0x89e9
movq 0x20(%rbx), %rdx
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xa886
movq %r14, %rdi
movq %r12, %rsi
callq 0x7460
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x8a39
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x7630
leaq 0x58(%rbx), %rsi
movq %r15, %rdi
callq 0x7220
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x48(%rsp,%rax), %eax
andl $0x7, %eax
cmpl $0x2, %eax
jne 0x8dce
movl $0x2, 0x30(%rbx)
movq 0x404ef(%rip), %rsi     # 0x48f70
leaq 0x28(%rsp), %rdi
callq 0x74f0
leaq 0xa0(%rsp), %rdi
callq 0x7120
movl $0x2, %r12d
jmp 0x8ac8
movq 0x40(%rbx), %rdx
leaq 0x2c629(%rip), %rcx     # 0x350d4
movl $0x13, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0x7570
movl $0x3, 0x30(%rbx)
movl $0x3, %r12d
movl %r12d, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3d, %eax
jne 0x8b47
cmpl $0x3b, %r12d
jg 0x8b0c
leal -0x2a(%r12), %ecx
cmpl $0x5, %ecx
ja 0x8b30
leaq 0x2c52f(%rip), %rdx     # 0x35028
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x47, %eax
jmp 0x8d44
cmpl $0x3e, %r12d
je 0x8d38
cmpl $0x3d, %r12d
je 0x8d3f
cmpl $0x3c, %r12d
jne 0x8b40
movl $0x3f, %eax
jmp 0x8d44
cmpl $0x21, %r12d
jne 0x8b40
movl $0x42, %eax
jmp 0x8d44
movl $0x0, 0x30(%rbx)
cmpl $0x3e, %r12d
ja 0x8c20
movl %r12d, %ecx
movabsq $0x7000bf0200000000, %rdx # imm = 0x7000BF0200000000
btq %rcx, %rdx
jae 0x8bb3
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movb (%r15), %al
movb %al, (%r13)
movq $0x1, -0x8(%r13)
movb $0x0, 0x1(%r13)
leaq 0x28(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7460
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x8ba6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
incq 0x20(%rbx)
movl %r12d, 0x30(%rbx)
jmp 0x8ac8
cmpq $0x26, %rcx
jne 0x8c20
cmpl $0x26, %eax
jne 0x8c89
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movzwl (%r15), %eax
movw %ax, (%r12)
movq $0x2, -0x8(%r12)
movb $0x0, 0x2(%r12)
leaq 0x28(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7460
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x8c09
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
addq $0x2, 0x20(%rbx)
movl $0x43, 0x30(%rbx)
movl $0x43, %r12d
jmp 0x8ac8
cmpl $0x7c, %r12d
jne 0x8c89
cmpl $0x7c, %eax
jne 0x8c89
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movzwl (%r15), %eax
movw %ax, (%r12)
movq $0x2, -0x8(%r12)
movb $0x0, 0x2(%r12)
leaq 0x28(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7460
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x8c72
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
addq $0x2, 0x20(%rbx)
movl $0x44, 0x30(%rbx)
movl $0x44, %r12d
jmp 0x8ac8
movl %r12d, %edi
callq 0x75b0
testl %eax, %eax
je 0x8e1c
movq 0x20(%rbx), %r12
movsbl (%r12), %ebp
movl %ebp, %edi
callq 0x73a0
cmpl $0x5f, %ebp
je 0x8cb2
testl %eax, %eax
je 0x8cd4
incq %r12
movq %r12, 0x20(%rbx)
movsbl (%r12), %ebp
movl %ebp, %edi
callq 0x73a0
incq %r12
cmpl $0x5f, %ebp
je 0x8cb5
testl %eax, %eax
jne 0x8cb5
decq %r12
leaq 0x38(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xa886
movq %r14, %rdi
movq %r13, %rsi
callq 0x7460
movq (%r13), %rdi
cmpq %rbp, %rdi
je 0x8d11
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
movl $0x1, 0x30(%rbx)
movl $0x1, %r12d
jmp 0x8ac8
movl $0x48, %eax
jmp 0x8d44
movl $0x45, %eax
jmp 0x8d44
movl $0x46, %eax
jmp 0x8d44
movl $0x40, %eax
jmp 0x8d44
movl $0x41, %eax
movl %eax, 0x30(%rbx)
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movzwl (%r15), %eax
movw %ax, (%r12)
movq $0x2, -0x8(%r12)
movb $0x0, 0x2(%r12)
leaq 0x28(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7460
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x8d8e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
addq $0x2, 0x20(%rbx)
movl 0x30(%rbx), %r12d
jmp 0x8ac8
movl $0x10, %edi
callq 0x7180
movq %rax, %r14
leaq 0x2c306(%rip), %rsi     # 0x350b6
movq %rax, %rdi
callq 0x7140
movq 0x40231(%rip), %rsi     # 0x48ff0
movq 0x401ba(%rip), %rdx     # 0x48f80
movq %r14, %rdi
callq 0x7660
movl $0x10, %edi
callq 0x7180
movq %rax, %r15
leaq 0x2c306(%rip), %rsi     # 0x350e8
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x9981
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x75d0
xorl %ebp, %ebp
movq 0x401e8(%rip), %rsi     # 0x48ff0
movq 0x40171(%rip), %rdx     # 0x48f80
movq %r15, %rdi
callq 0x7660
jmp 0x8f15
cmpb $0x1f, %r12b
ja 0x8eae
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x74c0
leaq 0x2c2c4(%rip), %rsi     # 0x350fe
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x7400
leaq 0x28(%rsp), %rdi
movl %r12d, %esi
callq 0x7670
leaq 0x2dbdb(%rip), %rsi     # 0x36a36
movl $0x1, %edx
movq %rax, %rdi
callq 0x7400
movl $0x10, %edi
callq 0x7180
movq %rax, %r14
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x75a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x75d0
xorl %ebp, %ebp
movq 0x40153(%rip), %rsi     # 0x48ff0
movq 0x400dc(%rip), %rdx     # 0x48f80
movq %r14, %rdi
callq 0x7660
jmp 0x8f15
movl $0x10, %edi
callq 0x7180
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movsbl %r12b, %edx
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x7430
leaq 0x2c23f(%rip), %rsi     # 0x3511d
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x9a09
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x75d0
xorl %ebp, %ebp
movq 0x400ea(%rip), %rsi     # 0x48ff0
movq 0x40073(%rip), %rdx     # 0x48f80
movq %r14, %rdi
callq 0x7660
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8f3b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x8f3b
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x8f9c
movq %r14, %rdi
callq 0x72a0
jmp 0x8f9c
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8f70
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x8f70
movq %rax, %rbx
movb $0x1, %bpl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x8f8f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x8f8f
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
jne 0x9012
jmp 0x901a
movq %rax, %rbx
movq 0x3ffe5(%rip), %rsi     # 0x48f88
leaq 0x28(%rsp), %rdi
callq 0x71c0
leaq 0x98(%rsp), %rdi
jmp 0x9008
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8fdd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x8fdd
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x8fef
movq %r15, %rdi
callq 0x72a0
jmp 0x8fef
movq %rax, %rbx
movq 0x3ff7a(%rip), %rsi     # 0x48f70
leaq 0x28(%rsp), %rdi
callq 0x74f0
leaq 0xa0(%rsp), %rdi
callq 0x7120
jmp 0x901a
movq %rax, %rbx
movq %r14, %rdi
callq 0x72a0
movq %rbx, %rdi
callq 0x76a0