todo toLLVM
This commit is contained in:
@@ -47,16 +47,16 @@ public class Main {
|
|||||||
// Pretty-print the program (to debug parsing)
|
// Pretty-print the program (to debug parsing)
|
||||||
System.err.println("todo " + ast);
|
System.err.println("todo " + ast);
|
||||||
|
|
||||||
//System.out.println("\n\n PRETTYPRINTER : \n--------------\n" + ast.prettyprinter() + "\n--------------\nFIN PRETTYPRINTER");
|
System.out.println("\n\n PRETTYPRINTER : \n--------------\n" + ast.prettyprinter() + "\n--------------\nFIN PRETTYPRINTER");
|
||||||
|
|
||||||
// Verify the program semantic
|
// Verify the program semantic
|
||||||
|
|
||||||
// Generate the intermediate representation
|
// Generate the intermediate representation
|
||||||
System.out.println("todo");
|
System.out.println("todo");
|
||||||
|
|
||||||
ProgramLLVMImpl astLLVM = ast.toLLVM();
|
//ProgramLLVMImpl astLLVM = ast.toLLVM();
|
||||||
|
|
||||||
System.out.println("\n\n PRETTYPRINTER : \n--------------\n" + astLLVM.prettyprinter() + "\n--------------\nFIN PRETTYPRINTER");
|
//System.out.println("\n\n PRETTYPRINTER : \n--------------\n" + astLLVM.prettyprinter() + "\n--------------\nFIN PRETTYPRINTER");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public interface Interface{
|
|||||||
public interface Expression {
|
public interface Expression {
|
||||||
public <H,S> S accept(ExprVisitor<H,S> v, H h);
|
public <H,S> S accept(ExprVisitor<H,S> v, H h);
|
||||||
public String prettyprinter();
|
public String prettyprinter();
|
||||||
|
public DefineLLVM toLLVM();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ExprVisitor<H,S> {
|
public interface ExprVisitor<H,S> {
|
||||||
|
|||||||
@@ -73,6 +73,12 @@ public class Program{
|
|||||||
public String prettyprinter(){
|
public String prettyprinter(){
|
||||||
return c+"";
|
return c+"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DefineLLVM toLLVM() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'toLLVM'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static record BinopExpressionImp(Op op,Expression e1, Expression e2) implements Expression{
|
public static record BinopExpressionImp(Op op,Expression e1, Expression e2) implements Expression{
|
||||||
@@ -93,6 +99,12 @@ public class Program{
|
|||||||
return "(" + e1.prettyprinter() +" "+ opStr +" " + e2.prettyprinter() + ")";
|
return "(" + e1.prettyprinter() +" "+ opStr +" " + e2.prettyprinter() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DefineLLVM toLLVM() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'toLLVM'");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static record Return_instrImp(Expression e) implements Instruction{
|
public static record Return_instrImp(Expression e) implements Instruction{
|
||||||
|
|||||||
Reference in New Issue
Block a user