Skip to content

This repository is a project where I built a compiler in Java to compile the Julia language. It includes source code and an EBNF-defined syntax for blocks, statements, expressions, and more.

Notifications You must be signed in to change notification settings

guishas/compilador-logcomp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git status

Como rodar

Compilar usando o javac 15.0.2 (https://www.oracle.com/java/technologies/javase/jdk15-archive-downloads.html)

javac exemplo.java

Rodar usando

java exemplo <args>

EBNF

BLOCK = {STATEMENT};

STATEMENT = (λ | ASSIGNMENT | PRINT), "\n";

ASSIGNMENT = IDENTIFIER, "=", EXPRESSION;

PRINT = "println", "(", EXPRESSION, ")";

EXPRESSION = TERM, {("+" | "-"), TERM};

TERM = FACTOR, {("*" | "/"), FACTOR};

FACTOR = (("+" | "-"), FACTOR) | NUMBER | "(", EXPRESSION, ")" | IDENTIFIER;

IDENTIFIER = LETTER, {LETTER | DIGIT | "_"};

NUMBER = DIGIT, {DIGIT};

LETTER = (a | ... | z | A | ... | Z);

DIGIT = (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0);

DIAGRAMA

About

This repository is a project where I built a compiler in Java to compile the Julia language. It includes source code and an EBNF-defined syntax for blocks, statements, expressions, and more.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages