
-----------------------------------
pyrnight
Sun Mar 02, 2008 10:09 am

Java Token Parser
-----------------------------------
Well its like 3 weeks or so, maybe 4, into class, and I've written this for computer science class. I'm in grade 11. Enjoy :D

PS: Its probably not perfect but its all I need for my PIC compiler project this semester ;)




// The "TokenParse" class.
import java.io.*;

public class TokenParse
{

    public static final String filename = "YOURJAVAFILE.java";

    public static boolean isAlpha (char check)
    {
        // Ascii values... I should have cheated an used >= 'A'...
        // but I realized that after I coded this
        if (((int) check >= 65 && (int) check = 97 && (int) check = 'A'...
// but I realized that after I coded this
if
(
(
(
int
)
check
>=
65
&&
(
int
)
check
=
97
&&
(
int
) 
check
