Sorry. I try and update things so people don't try and help me with something I've already solved.
Since my threads normally don't get a lot of replies, I can often sometimes solve it before I...
Type: Posts; User: javapenguin
Sorry. I try and update things so people don't try and help me with something I've already solved.
Since my threads normally don't get a lot of replies, I can often sometimes solve it before I...
I had to hand it in and was nearly done with it anyway.
Well, considering what it IS doing at the moment, right now I'd like it NOT to loop infinitely.
Here's how it should go:
E():
switch(token)
{
case n: T(); E'();
Ok, I've tried fixing some things and now it will always say true and will go into an infinite loop and I don't know why!
import java.util.StringTokenizer;
import java.io.*;
import...
I did find an error where I had been setting validity to true, regardless or whether or not it was true, at the beginning of every read method call and, I think, have fixed that, but the problem is...
Ok, I've updated it and it's now always returning false.
It appears to be going into the read twice but never EValidator. Why would that be?
import java.util.StringTokenizer;
import...
It shows that the while loop inside of getNextToken() is infinite if it's a number that's read in as the next char. I'm thinking it's how I'm phrasing it but cannot figure out what to do about it. ...
Ok I've rewrote part of it now so I don't need the tokenizer at all. I made my own. Does it have any code flaws? It compiles but might have bad logic or cause null pointers. Or could be...
I believe it now is, or should be anyway, updating the token string to shrink.
However, it seems to always be either always evaluating to invalid or false. I've updated it to change all the...
There is something I'm wondering. When I call nextToken(), does it simply return but not remove the next token or is it also removing it from the token string at the same time?
I cannot figure...
Please reply. ^:)^^:)^:-w:-w^:)^^:)^
import java.util.StringTokenizer;
import java.io.*;
import java.util.*;
public class LL1Parser
{
Ok, I've updated it a bit.
import java.util.StringTokenizer;
import java.io.*;
import java.util.*;
public class LL1Parser
{
I'm supposed to be making a parser for grammars, or basically parsing a simple language definition.
Basically I could be parsing either number or a symbol (+, *, (, ), or lambda, maybe lambda...