Our inspiration for the project stems from the members of our hacking and programming club. A lot of the members are only proficient in one programming language, so by showing them the same code in different languages we would be able to better illustrate broad programming syntax.
What it does
Our programming takes source code that's written in python, and converts it to java source code.
How we built it
Our code breaks down the Python source code line by line; then, it parses through each line for things like variable declarations, if-else statements, and print statements by using regular expressions. Then, these patterns are extracted from the Python source code and reinterpreted to Java code.
Challenges we ran into
Java is a much stricter language than Python -- we had to be able to decipher what data type a Python variable was and be able to recode that variable in Java code, for example. Additionally, we had to come up with an algorithm to automatically handle indentation and braces, which took a fair amount of thinking and effort.
Accomplishments that we're proud of
We're proud that we were actually able to convert one language into another since python disregards a lot of the aspects that java does not. We are also proud of how organized we became towards the end of the hackathon.
What we learned
As we worked together on each part, we learned how much better it is to speak with your teammates before implementing parts of the program. We found out how easy it is to forget little things like comments, parentheses, and such.
What's next for Pyjava
We would like to be able to interpret functions, add more arrays that can be supported rather than just integer arrays, and complete the number of control structures that are available in both Python and Java, such as for-loops. We would also like to be able to have Pyjava perform the reverse operation (Javthon, if you will), translating Java source code into Python.