XPP Compiler is a study project and complete Java implementation of the X++ compiler. X++ is a hypothetical language described in the book "How to Make a Compiler Using Java Tools" by Márcio Delamaro.
It is intended to be of use to people writing compilers for simple/study languages in Java.
- Identifiers (ID): A sequence of letters numbers and underscores. The first character must be a letter or underscore. Differentiates uppercase and lowercase;
- Integers Numbers (INTEGER_LITERAL): a sequence of decimal digits that denotes a corresponding integer.
- Operators (OP): <, >, <=, >=, +, −, ∗, /, %, =, == and !=;
- Separators (SEP): (, ), [, ], {, }, ;, . and ,;
- String literals are delimited by “ and ”.
- Comments: the comments must be ignored. There are two types: single-line(started with // and going until the end of the line) and multi-line(started with /* and ended with */ without nesting).
class, extends, int, string, break, print, read, return, super, if, else, for, new, constructor.