Skip to content
Snippets Groups Projects
Commit b525847b authored by lucien.noel's avatar lucien.noel
Browse files

test 11 OK

parent 58c95f37
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,13 @@ public class ByteCodeGenerator implements ASTVisitor {
public Object visit(DeclarationConstant node) {
node.getIdentifier().accept(this);
node.getConstantExpression().accept(this);
int memoryAddr = varAddrMemory.size();
bytecode+=".var "+memoryAddr+" is "+node.getIdentifier().getNom()+" "+((TDS.getInstance().identifier(new Entree(node.getIdentifier().getNom())).getType() instanceof Booleen)?"Z":"I")+"\n";
bytecode+="ldc "+getIntInExpression(node.getConstantExpression())+"\n";
bytecode+="istore "+memoryAddr+"\n";
varAddrMemory.put(node.getIdentifier().getNom(), memoryAddr);
return null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment