#6:15 pm
Started working on the project. I decided to implement it in JavaScript so that it would be easy to see HTML results.
#6:18 pm
I already have a simple UI, textarea for Java source input, button "To HTML" and output area. Time to get these components working! I thought it will make sense to start with getting Java keywords (public, final, catch, while) highlighted.
I googled "java keywords", got their list from Oracle web site. First idea was to tokenize everything using space character as a separator. Then go through the tokens and if any of them match just surround them with .
#6:31 pm
After few fails, keywords are being successfully processed now.
#6:45 pm
Next step: Strings. As we know that Java code will always be valid, it could be easily implemented with regex.
#6:50
Done! got keywords and strings highlighted. Next: detect annotations, classes, constants (mostly using Java code style convention).
#7:20 Great! Everything seems working! Testing Time!
#7:31
Comments.. are really tricky.. /* foo / int i; / bar */
#7:31 - 8:20 Some RegEx magic and comments are also working!
#8:20 - 8:45 More testing minor fixes
Haha, epic! Vspomnil SAPM perechital daje slaydi :)