no it's still wrong, during the first pass it should find all the delimiters in the code that i'm looking for then compare them with the delimiters in the stack. It is only finding one of them...
Type: Posts; User: Loraeron
no it's still wrong, during the first pass it should find all the delimiters in the code that i'm looking for then compare them with the delimiters in the stack. It is only finding one of them...
ok, so i added it into the catch block, and found the error. it was just an error where i had placed code to display what was being stored in strLine for debugging, don't need that anymore as i...
the pass number is just a variable i called x that i incremented after each time through the while and printed so i knew how many times it is reading the text file and what is being seen with each...
ok, here is it broken down a little better, i added another println stating the pass it was in during each loop of the while along with the pass number:
run:
Enter a file to be read: (EX:...
Ok, i did the println() portion and it looks like it is reading in the entire text file.
haha, i read it and did some text, using it with a variable that i tried to increment after each readLine call.
int x = 0;
after the readLine did x++;
and then it went into:
...
so what would you attach charAt() too? Would you simple say if(strLine.charAt() = "{") then do this.....?
how would you implement charAt()? because i don't know exactly where the braces, brackets, etc will be?
ok, so would i need to convert each line during the while loop into an array of characters before passing them into the if statements checking for proper types?
I thought using the readLine() method would automatically read the entire line until it found no more words/characters then move to the next line?
That would be the issue I am having, I can't make it find brackets, braces, etc on a line that has characters already on it.
I'll look into it, either way i'm still at a loss for why it's not finding all the parameters i'm looking for in the first pass. I don't think the second pass is effecting this at all.
I wrote it for two haha, didn't know a way to make it read twice without opening the file and closing then reopening and closing.
New code after adding print statements after every push or pop with the stack
/*
* A Java program can have the following type of delimiters: {, }, (, ), [,
* and ]. In a correct Java...
how do you actually do the tag trick, i've never done that before. I will go through and add println()
Updated code is below, it seems it is holding a value in the stack which is good, we are getting a error null for some reason, but the code still runs, only other problem is it is only holding one of...
After adding a print statement right below the code
while((strLine = br.readLine()) != null)
{
during the first read file cycle it prints out:
run:
I will go ahead and apologize for the massive code slice, but I am stuck on a problem. The code compiles and runs, but is not acting properly. I have tried to comment as best I can throughout the...