Hello all, I hope you can help me on this one. I've been working on this program, that i want to check html tags to see if they are properly nested and that they are correct. if they are not I want to display an error message telling what line number is broke on and what symbol it was expecting. I'm using a stack, and I haven't totally figured out how i'm going to check them and stuff (so any suggestions there would be greatly appreciated), but my main problem is that my stupid getLineNumber is not working!! I'm reading a file full of arbitrary stuff and looping through it to read all the contents. I've looked online and read all about the LineNumberReader, but for some stupid reason it doesn't want to work for me, it doesn't count at all, it's always at zero. Here's a snippet of my code (the while loop) I was hoping someone could tell me why it isn't counting the line numbers!?? Any help would be so GREATLY appreciated....thanks
while((file=thefile.readLine()) != null)
{
count++;
System.out.println(count);
count = objFileReader.getLineNumber();
if (file.indexOf("and">= 0)
{
System.out.println(count +"found and on line number " + objFileReader.getLineNumber());
}
if (file.indexOf("<">=0)
{
stackem.push("<"
System.out.println("you've been pushed"
}
else if (file.indexOf(">">=0)
{
stackem.push(">"
System.out.println("found the second guy " + count);
}
System.out.println(file);
}
while((file=thefile.readLine()) != null)
{
count++;
System.out.println(count);
count = objFileReader.getLineNumber();
if (file.indexOf("and">= 0)
{
System.out.println(count +"found and on line number " + objFileReader.getLineNumber());
}
if (file.indexOf("<">=0)
{
stackem.push("<"
System.out.println("you've been pushed"
}
else if (file.indexOf(">">=0)
{
stackem.push(">"
System.out.println("found the second guy " + count);
}
System.out.println(file);
}