E
Eric
Dear all:
I want to build a lex analyzer,
and streamtokenizer is seems a powerful API
but I have 2 question about it
1).how to use method slashSlashComments(boolean flag)
I try to set its flag as true,but it doesn't work when the comment
char be encountered. I also get a token that contains comments.
slashStarComments() has the same condition
2).I want to parse the java source code, and get the token
for example:
str1 = str2;
str1.compareTo("abc");
====================>use whitespace(' ','\t') and semicolon(';') to delimte
str1
=
str2
str1.compareTo("abc")
====================>but I want semicolon is also a token, like this
str1
=
str2
;
str1.compareTo("abc")
;
can only use streamtokenizer to implement this function?
thanks
Eric
I want to build a lex analyzer,
and streamtokenizer is seems a powerful API
but I have 2 question about it
1).how to use method slashSlashComments(boolean flag)
I try to set its flag as true,but it doesn't work when the comment
char be encountered. I also get a token that contains comments.
slashStarComments() has the same condition
2).I want to parse the java source code, and get the token
for example:
str1 = str2;
str1.compareTo("abc");
====================>use whitespace(' ','\t') and semicolon(';') to delimte
str1
=
str2
str1.compareTo("abc")
====================>but I want semicolon is also a token, like this
str1
=
str2
;
str1.compareTo("abc")
;
can only use streamtokenizer to implement this function?
thanks
Eric