• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Java Parser (Lexical Scanner) Written in C

Arkanian

[H]ard|Gawd
Joined
Feb 8, 2004
Messages
1,898
Hi, I am looking for information about writting a Java Parser in C. All I want the parser to do is get keywords, operators, variables, etc and output this information to a file. It doesn't have to be fancy for anything. I have alot of psuedo code already done for this but it would be nice to have some more help to see how I can implement certain things and if I am doing some things right.
Also, white space and commits are ignored.
 
Arkanian said:
Hi, I am looking for information about writting a Java Parser in C. All I want the parser to do is get keywords, operators, variables, etc and output this information to a file. It doesn't have to be fancy for anything. I have alot of psuedo code already done for this but it would be nice to have some more help to see how I can implement certain things and if I am doing some things right.
Also, white space and commits are ignored.

You can find just about everything you want to know about Java here, which provides grammars and lexical structure. You could probably just store the keywords, operators, etc. as constants and search/compare each token. Variables would be the tokens that do not match one of the constants. Anything beyond lexical analysis would require you to implement the grammar (which is not that difficult since it is found in Sun's documentation).
 
Back
Top