read
This commit is contained in:
@@ -93,6 +93,17 @@ instruction returns [Instruction out]:
|
|||||||
}
|
}
|
||||||
)*
|
)*
|
||||||
{$out = new PrintImp(printer);}
|
{$out = new PrintImp(printer);}
|
||||||
|
| //READ
|
||||||
|
READ i1=ident
|
||||||
|
{
|
||||||
|
ArrayList<String> read= new ArrayList<String>();
|
||||||
|
read.add($i1.out);
|
||||||
|
}(VIRGULE i2=ident
|
||||||
|
{
|
||||||
|
read.add($i2.out);
|
||||||
|
})*
|
||||||
|
{$out = new ReadImp(read);}
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
//Priorité lit(val, const ou paranthese) -> td_exp (*/%) -> exp (+-)
|
//Priorité lit(val, const ou paranthese) -> td_exp (*/%) -> exp (+-)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public interface Interface{
|
|||||||
public S visitAssign(AssignImp instr, H h);
|
public S visitAssign(AssignImp instr, H h);
|
||||||
public S visitDeclaration(DeclarationImp instr,H h);
|
public S visitDeclaration(DeclarationImp instr,H h);
|
||||||
public S visitPrint(PrintImp instr, H h);
|
public S visitPrint(PrintImp instr, H h);
|
||||||
|
public S visitRead(ReadImp instr,H h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,11 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String visitRead(ReadImp instr, String h) {
|
||||||
|
return "Tibo, tu peux implenter le truc stp";
|
||||||
|
}
|
||||||
|
|
||||||
//EXPRESSION
|
//EXPRESSION
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -97,6 +97,14 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImpl>
|
|||||||
throw new UnsupportedOperationException("Unimplemented method 'visitPrint'");
|
throw new UnsupportedOperationException("Unimplemented method 'visitPrint'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrayList<InstructionLLVM> visitRead(ReadImp instr, SymTable h) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'visitRead'");
|
||||||
|
}
|
||||||
|
|
||||||
|
//EXPRESSION
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InstrOrVal visitConst(ConstImp e, SymTable h) {
|
public InstrOrVal visitConst(ConstImp e, SymTable h) {
|
||||||
ValLLVM val = new ValLLVMImpl(new IntLLVMImpl(),e.c());
|
ValLLVM val = new ValLLVMImpl(new IntLLVMImpl(),e.c());
|
||||||
|
|||||||
Reference in New Issue
Block a user