Esempio n. 1
0
inline void _ctp_end_brackets(POSTFIX &postfix, StringStack &oper_stack)
{
	while(oper_stack.getSize())
	{
		if(oper_stack.get_last()=="("){
			oper_stack.remove();
			break;
		}
		
		String s;
		
		s=oper_stack.get_last();
		oper_stack.remove();
		
		if(isalpha(s[0])) {
			//don't worry: this seems allright!!!
			String name;
			name="'";
			name+=s;
			postfix.add(name);
		}else{
			postfix.add(s);
		}
		
			
			
				
	}
}
Esempio n. 2
0
void reverse_stack(StringStack &from, StringStack &to){
	while(from.get_top_position()){
		
		to.add(from.get_last());
		from.remove();
		
	}
}