This is a repository of my course "Principles of Compilers". It is a compiler of Mx* language.
Mx* language is a Java-like programming language. But the class in Mx* language is similar to the struct in C.
print str to stdout.
print str and a newline('\n'
) to stdout
get a line of characters from stdin and return a string object contained the characters.
get a line of characters from stdin and return a first decimal integer.
convert a integer to a string object.
return a integer which is the length of a string.
return a new string object which contain the characters subscripting from
return the ASCII value of the character with subscripting
return the first integer in the beginning of the string. The prefix of the string should be a integer.
return the size of the array.
A source file of Mx* language. The source file should be redirect to stdin.
SPIM assemble code in stdout.
Abstract Syntax Tree for Mx* language.
The main class of the whole project.
Intermedia Representation for Mx* language.
A cn.edu.sjtu.songyuke.mental.translator from cn.edu.sjtu.songyuke.mental.ir to SPIM assemble code.