weidongguo / ECS140_p2

E program translator to C equivalent program (Built in Java)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Guo
Weidong
weidongg

Status:

part1: Works on all tests.
part2: Works on all tests.
part3: Works on all tests.
part4: Works on all tests.
part5: Works on all tests.
part6: Works on all tests.
part7: Works on all tests.


Overall:
The original Makefile works fine. But just in case, 
one of my file is called firstSet.txt, which is the source of all the token kind
names. My firstSet.java uses it.




Answers:

part1: Question 1: The purpose of putback is to take care of the already read in character
                   c when c turns out not being considered as part of the last token.
                   But rather it's for the next token. Furthermore, in case of c = '\n',
                   the program increment linenumbe, and in case of c = EOF, we prompt
                   error.
       Question 2: c = '*' and putback = true
       Question 3: Since /, <, >, and : followed by a '=' will change their original
                   meanings, so ccase1or2 is to figure out whether they are followed
                   by '=' and return a token accordingly. Furthermore, ccase2 checks
                   whether':' is followed by '=' or '[' is followed by ']'; 
                   if not, errors occur.




About

E program translator to C equivalent program (Built in Java)


Languages

Language:Java 68.8%Language:Eiffel 25.2%Language:Shell 3.5%Language:Perl 1.1%Language:Makefile 0.9%Language:C 0.6%