source-academy / java-slang

Implementation of the Java language in TypeScript
Apache License 2.0
1 stars 0 forks source link

Setup ECE - Evaluate LocalVariableDeclarationStatement #6

Closed xyliew25 closed 10 months ago

xyliew25 commented 11 months ago

Most of the ECE logic is referenced from js-slang.

Due to the limitation of the java-parser library used, expressions such as 1 + 2 * 3 are not parsed with the appropriate precedence of multiplicative operations over additive operations. Hence, some post-processing is done to encode the appropriate precedence. As a result, both types of expression such as 1 + 2 * 3 and 1 + (2 * 3) are evaluated correctly.