# Interface: com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement

Top\-level interface for all elements of a C Abstract Syntax Tree. 

 Each AST element implements this interface or one of the sub\-interfaces.

## Method: addPhysicalOffset
- parameter: `offset`, type: `java.lang.Long`

Description: 
parameter: offset: 

## Method: addPhysicalOffsets
- parameter: `offsets`, type: `java.util.Collection<java.lang.Long>`

Description: 
parameter: offsets: 

## Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement`

Description: Deep duplication of the element. Sub\-elements are duplicated. 

 Note: [ICClass](ICClass), [ICMethod](ICMethod), [ICField](ICField), [ICIdentifier](ICIdentifier), [ICConstant](ICConstant), [ICType](ICType) and [ICLabel](ICLabel) are not duplicated.

## Method: evaluate
- parameter: `state`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CMethodState`
- parameter: `environment`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CEnvironment`
- return type: `java.lang.Long`

Description: 
parameter: state: input state, can be updated
parameter: environment: 
return: evaluation result if any, can be null

## Method: format
- return type: `java.lang.String`

Description: Generate a full\-form text version of this element.
return: 

## Method: generate
- parameter: `out`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.COutputSink`

Description: Generate the visual representation of the AST element. The output is directed into a sink, that represents the current output state for the whole AST. Every AST statement must implement this method.
parameter: out: where the AST element should be generated; the sink also contains attributes            indicating how the element should be generated.

## Method: getData
- parameter: `key`, type: `java.lang.Object`
- return type: `java.lang.Object`

Description: Retrieve a piece of data attached to this AST element.
parameter: key: 
return: 

## Method: getElementType
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.CElementType`

Description: This convenience method returns the type of C AST element held by this object.
return: 

## Method: getPhysicalOffset
- return type: `java.lang.Long`

Description: Get the closest physical offset or address that matches this high\-level pseudo\-code element.
return: an offset/address, null if none

## Method: getPhysicalOffsets
- return type: `java.util.Collection<java.lang.Long>`

Description: Get the physical offsets of instructions matching this AST element.
return: 

## Method: getSubElements
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement>`

Description: Get the list of AST elements that constitute this AST element. Typically, for simple statements, it may be expression. For complex expressions, it may be simpler expressions. For compound statements, it may more statements and expressions. Etc. 

 Be careful to manage properly possible infinite loops \(in particular on recursive calls, when sub element **may be** the current method\). Use [CUtil#isClassMethodField(ICElement)](CUtil#isClassMethodField(ICElement)) to avoid infinite recursing or [#visitDepthPost(ICVisitor)](#visitDepthPost(ICVisitor)) methods.
return: the list of constituting elements, may be empty but never null

## Method: replaceSubElement
- parameter: `oldElement`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement`
- parameter: `newElement`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement`
- return type: `boolean`

Description: Replace one element by another one. Only the references are compared, no equals/deep compare. At most one element is replaced.
parameter: oldElement: the element to be replaced
parameter: newElement: the new element
return: 

## Method: setData
- parameter: `key`, type: `java.lang.String`
- parameter: `value`, type: `java.lang.Object`

Description: Attach a piece of data to this AST element.
parameter: key: 
parameter: value: 

## Method: setPhysicalOffsets
- parameter: `offsets`, type: `java.util.Collection<java.lang.Long>`

Description: 
parameter: offsets: 

## Method: toString
- return type: `java.lang.String`

Description: Generate a short\-form text version of this element.
return: 

## Method: visitDepthPost
- parameter: `visitor`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICVisitor`
- return type: `boolean`

Description: Depth\-first search, post\-order visit of an expression tree or sub\-tree. The node being visited may be replaced without notifying the visitor. 

 This method disregards the [IVisitResults#FLAG_SKIP_ASSIGN_DST](IVisitResults#FLAG_SKIP_ASSIGN_DST) flag.
parameter: visitor: the visitor object
return: true if the visit was successful

## Method: visitDepthPost
- parameter: `visitor`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICVisitor`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement`
- return type: `boolean`

Description: Depth\-first search, post\-order visit of an expression tree or sub\-tree. The node being visited may be replaced without notifying the visitor. 

 This method disregards the [IVisitResults#FLAG_SKIP_ASSIGN_DST](IVisitResults#FLAG_SKIP_ASSIGN_DST) flag.
parameter: visitor: the visitor object
parameter: parent: 
return: true if the visit was successful

## Method: visitDepthPost
- parameter: `visitor`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICVisitor`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement`
- parameter: `results`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.CVisitResults`
- return type: `boolean`

Description: Depth\-first search, post\-order visit of an expression tree or sub\-tree. The node being visited may be replaced without notifying the visitor. 

 This method disregards the [IVisitResults#FLAG_SKIP_ASSIGN_DST](IVisitResults#FLAG_SKIP_ASSIGN_DST) flag.
parameter: visitor: the visitor object
parameter: parent: 
parameter: results: 
return: true if the visit was successful

## Method: visitDepthPre
- parameter: `visitor`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICVisitor`
- return type: `boolean`

Description: Depth\-first search, pre\-order visit of an expression tree or sub\-tree. The node being visited may be replaced, but the client code is responsible for notifying the visitor. 

 This method disregards the [IVisitResults#FLAG_SKIP_ASSIGN_DST](IVisitResults#FLAG_SKIP_ASSIGN_DST) flag.
parameter: visitor: the visitor object
return: true if the visit was successful

## Method: visitDepthPre
- parameter: `visitor`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICVisitor`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement`
- return type: `boolean`

Description: Depth\-first search, pre\-order visit of an expression tree or sub\-tree. The node being visited may be replaced, but the client code is responsible for notifying the visitor. 

 This method disregards the [IVisitResults#FLAG_SKIP_ASSIGN_DST](IVisitResults#FLAG_SKIP_ASSIGN_DST) flag.
parameter: visitor: the visitor object
parameter: parent: 
return: true if the visit was successful

## Method: visitDepthPre
- parameter: `visitor`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICVisitor`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement`
- parameter: `results`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.CVisitResults`
- return type: `boolean`

Description: Depth\-first search, pre\-order visit of an expression tree or sub\-tree. The node being visited may be replaced, but the client code is responsible for notifying the visitor. 

 This method disregards the [IVisitResults#FLAG_SKIP_ASSIGN_DST](IVisitResults#FLAG_SKIP_ASSIGN_DST) flag.
parameter: visitor: the visitor object
parameter: parent: 
parameter: results: 
return: true if the visit was successful

