Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

lexeme & tokens

843810Jul 17 2008 — edited Jul 18 2008
Hi there,

I just want to verify my answers for the given fragment of code:
 a = + + b ; c = d - / * - e * / - f ;
No. of tokens? - 19
lexically correct? - my guess Yes ( can anyone tell me what "lexically" correct means with reference to the above code fragment )
syntactically correct? - NO (can anyone tell me reason why?)

----After squeezing out the white space----
 a=++b;c=d-/*-e*/-f;
No. of tokens? - 12 (comment is omitted)
lexically correct? - my guess again is Yes
syntactically correct? NO (because of minus sign and comment in between)

Thanks for any help! :)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2008
Added on Jul 17 2008
1 comment
197 views