// File: AndrewAlbert[P]Compiler-Theory/SourceCode/parser.cpp
// Function: Parser::Parameter(scopeValue&)
bool Parser::Parameter(scopeValue &procEntry){
	scopeValue paramEntry;
	string id;
	//get parameter declaration
	if( VariableDeclaration(id, paramEntry) ){
		//determine parameter's input / output type
		if(CheckToken(T_IN)) paramEntry.paramType = TYPE_PARAM_IN;
		else if(CheckToken(T_OUT)) paramEntry.paramType = TYPE_PARAM_OUT;
		else if(CheckToken(T_INOUT)) paramEntry.paramType = TYPE_PARAM_INOUT;
		else ReportError("expected 'in', 'out', or 'inout' in parameter declaration");
		
		//add parameter to current scope after updating the parameter type
		Scopes->addSymbol(id, paramEntry, false);
		
		//add to current procedure declaration's parameter list
		procEntry.arguments.push_back(paramEntry);
		
		return true;
	}
	else return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x126b0
leaq -0x80(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x3370
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
callq 0xaef0
movb %al, -0x125(%rbp)
jmp 0xcd10
movb -0x125(%rbp), %al
testb $0x1, %al
jne 0xcd1f
jmp 0xcf40
movq -0x140(%rbp), %rdi
movl $0x107, %esi            # imm = 0x107
callq 0x9300
movb %al, -0x141(%rbp)
jmp 0xcd38
movb -0x141(%rbp), %al
testb $0x1, %al
jne 0xcd44
jmp 0xcd67
movl $0x11f, -0x20(%rbp)     # imm = 0x11F
jmp 0xce6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0xcf6e
movq -0x140(%rbp), %rdi
movl $0x108, %esi            # imm = 0x108
callq 0x9300
movb %al, -0x142(%rbp)
jmp 0xcd80
movb -0x142(%rbp), %al
testb $0x1, %al
jne 0xcd8c
jmp 0xcd98
movl $0x120, -0x20(%rbp)     # imm = 0x120
jmp 0xce6c
movq -0x140(%rbp), %rdi
movl $0x109, %esi            # imm = 0x109
callq 0x9300
movb %al, -0x143(%rbp)
jmp 0xcdb1
movb -0x143(%rbp), %al
testb $0x1, %al
jne 0xcdbd
jmp 0xcdc9
movl $0x121, -0x20(%rbp)     # imm = 0x121
jmp 0xce6a
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x3430
movq -0x150(%rbp), %rdx
leaq 0x18f80(%rip), %rsi     # 0x25d6a
leaq -0xb0(%rbp), %rdi
callq 0x62d0
jmp 0xcdf8
movq -0x140(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x9060
jmp 0xce0d
leaq -0xb0(%rbp), %rdi
callq 0x31a0
leaq -0xb1(%rbp), %rdi
callq 0x32e0
jmp 0xce6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0xce59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x31a0
leaq -0xb1(%rbp), %rdi
callq 0x32e0
jmp 0xcf6e
jmp 0xce6c
jmp 0xce6e
movq -0x140(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x158(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3130
jmp 0xce95
leaq -0x120(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x12770
jmp 0xcea7
movq -0x158(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x120(%rbp), %rdx
xorl %ecx, %ecx
callq 0x183f0
jmp 0xcec5
leaq -0x120(%rbp), %rdi
callq 0x12800
leaq -0xd8(%rbp), %rdi
callq 0x31a0
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
leaq -0x60(%rbp), %rsi
callq 0x12700
jmp 0xcef0
movb $0x1, -0x1(%rbp)
movl $0x1, -0x124(%rbp)
jmp 0xcf4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0xcf32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x12800
leaq -0xd8(%rbp), %rdi
callq 0x31a0
jmp 0xcf6e
movb $0x0, -0x1(%rbp)
movl $0x1, -0x124(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x31a0
leaq -0x60(%rbp), %rdi
callq 0x12800
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
leaq -0x80(%rbp), %rdi
callq 0x31a0
leaq -0x60(%rbp), %rdi
callq 0x12800
movq -0x88(%rbp), %rdi
callq 0x3420
nopl (%rax)