Rohit Bajaj
asked on
Writing a parser for java language
Hi,
I want to write a parser that detects if the language is Java.
I am not looking to build a 100% perfect parsing of java language which compilers do and can be very complicated.
I want to make a simple parser but yet strong that could detect if the language is java or not 90% of the time.
Any tips on how to go about writing such a parser without making it tough or in a simple and easy to code way ?
Thanks
I want to write a parser that detects if the language is Java.
I am not looking to build a 100% perfect parsing of java language which compilers do and can be very complicated.
I want to make a simple parser but yet strong that could detect if the language is java or not 90% of the time.
Any tips on how to go about writing such a parser without making it tough or in a simple and easy to code way ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I understood you solution and will most likely using it.
But consider the case where user posts a code like :
Open in new window
This is an example where there is no declarative part. what to do in this case .