https://github.com/marcosspessatto/compiler
Transpiler from CT language to Java
https://github.com/marcosspessatto/compiler
compiler java jflex lexical-analysis parser
Last synced: 12 months ago
JSON representation
Transpiler from CT language to Java
- Host: GitHub
- URL: https://github.com/marcosspessatto/compiler
- Owner: MarcosSpessatto
- Created: 2016-12-06T16:03:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-09T01:12:05.000Z (over 9 years ago)
- Last Synced: 2025-05-28T20:06:09.878Z (about 1 year ago)
- Topics: compiler, java, jflex, lexical-analysis, parser
- Language: Yacc
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Transpiler from CT language to Java
Transpiler written using (Jflex and Byacc/J) , for academic purposes of computer science course.
#**RUN**
jflex LexicalAnalyzer.flex
yacc -J Parser.y
javac *.java
java Parser file
####Syntax of Ct Language
// Programa de teste da Linguagem CT
// Declaracao de Classes
classe Aluno {
inteiro num, num_notas
vetor inteiro notas[30]
// funcoes da classe aluno
real media()
{
inteiro total, i
real media
se (i=2) {
i<-3
}
total<-0
i<-0
enquanto (i (numero2 * (numero1 / 2.0))){
escrever("Entrou no if." + numero1 + "" + numero2)
} senao {
escrever("Entrou no else.")
}
_
}
}