In my code I am having problems with it recognizing the stack, and also passing it down parameters as well as recognizing everything in my 2nd method.
Errors I get alot of cannot find symbols, I confused.import java.util.Scanner; import java.io.*; import java.util.Stack.*; import java.util.StringTokenizer; class Proj31610{ public static void main(String args[]){ String data=args[0]; File filereader=new File(data); Scanner in=new Scanner(filereader); String collect; Stack<Integer> holditdown=new Stack<Integer>(); //Float for the div? while(in.hasNext()){ collect=in.nextLine(); givmehabreak(collect, holditdown); }//end of the while loop }//end of main method public void givmehabreak(string collects, Stack carrys){ String tolken1, tolken2; int tolkentaker; StringTokenizer st= new StringTokenizer(collects); while(st.hasMoreTokens()){ // ? tolken1=st.nexttoken; tolken2=st.nexttoken; } try{ tolkentaker=Integer.parseInt(tolken2); //? } catch(ParseException e){ System.out.println("There was no Integer here"); } if(tolken1.equalsIgnoreCase("CLR")) clrStack(carrys); else if(tolken1.equalsIgnoreCase("HlT")){ System.out.println("Machine Halted sir. "); System.out(0); } else if(tolken1.equalsIgnoreCase("nEG")) negstack(carrys); else if(tolken1.equalsIgnoreCase("AdD")) addStack(carrys); else if(tolken1.equalsIgnoreCase("Sub")) subStack(carrys); else if(tolken1.equalsIgnoreCase("MuL")) mulStack(carrys); else if(tolken1.equalsIgnoreCase("dIv")) try{ divStack(carrys); } catch (DivideByZeroException e){ System.out.println(" You cannot divide... anything by zero. "); } else if(tolken1.equalsIgnoreCase("LDC")) ldcStack(tolkentaker, carrys); else if(tolken1.equalsIgnoreCase("INp")) inpStack(carrys); else if(tolken1.equalsIgnoreCase("OuT")) outStack(carrys); else if(tolken1.equalsIgnoreCase("NlN")) System.out.println(""); else if(tolken1.equalsIgnoreCase("dBg")) dgbStack(carrys); else System.out.println("Warning - illegal command '" + collects + "' ignored, good day sir. "); }//end of givemehabreak public void clrStack(stack hey){ while(hey.size() > 0) hey.pop(); }//end of clear stack method public void negStack(stack reception){ int reeves; if(reception.size() >0){ reeves=reception.pop(); reeves=reeves*-1; reception.push(reeves); } else System.out(0); }//end of negate stack method public void addStack(stack reception){ int manny, harris, td; if(reception.size() > 2){ manny=reception.pop(); harris=reception.pop(); td=manny+harris; reception.push(td); } else System.out(0); }//end of add stack method public void subStack(stack reception){ int rose, sat, nostats; if(reception.size() > 2){ sat=reception.pop(); rose=reception.pop(); nostats=sat-rose; reception.push(nostats); } else System.out(0); }//end subtract stack method public void mulStack(stack reception){ int twentwo, fourfive, lega; if(reception.size() > 2){ twentwo=reception.pop(); fourfive=reception.pop(); lega=fourfive*twentwo; reception.push(lega); } else System.out(0); }//end of multiply stack method public void divStack(stack reception){ int ss, vc, dw; if(reception.size() > 2){ ss=reception.pop(); vc=reception.pop(); dw=vc/ss; reception.push(dw); } else System.out(0); }//end of divide stack method public void ldcStack(int locken, stack reception){ reception.push(locken); }//end of LDC stack public void inpStack(stack reception){ int masta; Scanner toldya= new Scanner(System.in); System.out.println("Enter that. "); masta=toldya.nextInt(); reception.push(masta); }//end of input method public void outStack(stack reception){ int tells; if(reception.size() > 1){ tells=reception.pop(); System.out.println(tells); } else System.out(0); }//end of output, new line method public void dbgStack(stack reception){ //Will it just leave the stack empty? System.out.println(reception); }//end of Debug stack }//end of class Proj31610