Skip to content

Leonardo-Rocha/Xpp-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

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.

Language Description

Tokens:

  1. Identifiers (ID): A sequence of letters numbers and underscores. The first character must be a letter or underscore. Differentiates uppercase and lowercase;
  2. Integers Numbers (INTEGER_LITERAL): a sequence of decimal digits that denotes a corresponding integer.
  3. Operators (OP): <, >, <=, >=, +, −, ∗, /, %, =, == and !=;
  4. Separators (SEP): (, ), [, ], {, }, ;, . and ,;
  5. String literals are delimited by “ and ”.
  6. 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).

Reserved Keywords

class, extends, int, string, break, print, read, return, super, if, else, for, new, constructor.

Documentation

TODO: Insert correct URL.

JavaDoc API

Releases

No releases published

Packages

No packages published

Languages