/** * Returns a deep clone of this {@link AIntPatternIR} node. * @return a deep clone of this {@link AIntPatternIR} node */ public AIntPatternIR clone() { return new AIntPatternIR( _sourceNode, _tag, _metaData, _value ); }
/** * Creates a new tree field only constructor {@code AIntPatternIR TAG=int} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param value_ the {@link Long} node for the {@code value} child of this {@link AIntPatternIR} node */ public AIntPatternIR(Long value_) { super(null,null,null); this.setValue(value_); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AIntPatternIR) { return toString().equals(o.toString()); } return false; }
@Override public SPatternIR caseAIntegerPattern(AIntegerPattern node, IRInfo question) throws AnalysisException { long value = node.getValue().getValue(); AIntPatternIR intPatternCg = new AIntPatternIR(); intPatternCg.setValue(value); return intPatternCg; }
@Override public void caseAIntPatternIR(AIntPatternIR node, STypeIR question) throws AnalysisException { long value = node.getValue(); if (value > 0) { storeType(node, new ANat1NumericBasicTypeIR()); } else if (value >= 0) { storeType(node, new ANatNumericBasicTypeIR()); } else { storeType(node, new AIntNumericBasicTypeIR()); } }
Long value = intPattern.getValue(); AIntLiteralExpIR intLit = transAssistant.getInfo().getExpAssistant().consIntLiteral(value);
/** * Creates a new complete constructor {@code AIntPatternIR} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param value_ the {@link Long} node for the {@code value} child of this {@link AIntPatternIR} node */ public AIntPatternIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, Long value_) { super(sourceNode_,tag_,metaData_); this.setValue(value_); }
/** * Creates a deep clone of this {@link AIntPatternIR} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link AIntPatternIR} node */ public AIntPatternIR clone(Map<INode,INode> oldToNewMap) { AIntPatternIR node = new AIntPatternIR( _sourceNode, _tag, _metaData, _value ); oldToNewMap.put(this, node); return node; }