/** * Called by the {@link AIntLiteralExp} node from {@link AIntLiteralExp#apply(IAnalysis)}. * @param node the calling {@link AIntLiteralExp} node */ public void caseAIntLiteralExp(AIntLiteralExp node) throws AnalysisException { _visitedNodes.add(node); inAIntLiteralExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getValue() != null ) { node.getValue().apply(this); } outAIntLiteralExp(node); }
/** * Called by the {@link AIntLiteralExp} node from {@link AIntLiteralExp#apply(IPOFAnalysis)}. * @param node the calling {@link AIntLiteralExp} node */ public void caseAIntLiteralExp(AIntLiteralExp node) throws AnalysisException { _visitedNodes.add(node); inAIntLiteralExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getValue() != null ) { node.getValue().apply(this); } outAIntLiteralExp(node); }
/** * Called by the {@link AIntLiteralExp} node from {@link AIntLiteralExp#apply(IAnalysis)}. * @param node the calling {@link AIntLiteralExp} node */ public void caseAIntLiteralExp(AIntLiteralExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAIntLiteralExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getValue() != null ) { node.getValue().apply(this, question); } outAIntLiteralExp(node, question); }
/** * Called by the {@link AIntLiteralExp} node from {@link AIntLiteralExp#apply(IAnalysis)}. * @param node the calling {@link AIntLiteralExp} node */ public A caseAIntLiteralExp(AIntLiteralExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAIntLiteralExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getValue() != null ) { mergeReturns(retVal,node.getValue().apply(this)); } mergeReturns(retVal,outAIntLiteralExp(node)); return retVal; }
/** * Called by the {@link AIntLiteralExp} node from {@link AIntLiteralExp#apply(IAnalysis)}. * @param node the calling {@link AIntLiteralExp} node */ public A caseAIntLiteralExp(AIntLiteralExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAIntLiteralExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getValue() != null ) { mergeReturns(retVal,node.getValue().apply(this, question)); } mergeReturns(retVal,outAIntLiteralExp(node, question)); return retVal; }
@Override public SExpIR caseAIntLiteralExp(AIntLiteralExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); long value = node.getValue().getValue(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); AIntLiteralExpIR intLitCg = new AIntLiteralExpIR(); intLitCg.setType(typeCg); intLitCg.setValue(value); return intLitCg; }
@Override public PType caseAIntLiteralExp(AIntLiteralExp node, TypeCheckInfo question) { if (node.getValue().getValue() < 0) { node.setType(AstFactory.newAIntNumericBasicType(node.getLocation())); } else if (node.getValue().getValue() == 0) { node.setType(AstFactory.newANatNumericBasicType(node.getLocation())); } else { node.setType(AstFactory.newANatOneNumericBasicType(node.getLocation())); } return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }