decompiler  1.0.0
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ghidra::WithBlock Class Reference

Subtable, pattern, and context information applied across a with block. More...

#include <slgh_compile.hh>

Public Member Functions

 WithBlock (void)
 Constructor.
 
void set (SubtableSymbol *s, PatternEquation *pq, vector< ContextChange *> *cvec)
 Set components of the header. More...
 
 ~WithBlock (void)
 Destructor.
 

Static Public Member Functions

static PatternEquation * collectAndPrependPattern (const list< WithBlock > &stack, PatternEquation *pateq)
 Build a complete pattern equation from any surrounding with blocks. More...
 
static vector< ContextChange * > * collectAndPrependContext (const list< WithBlock > &stack, vector< ContextChange *> *contvec)
 Build a complete array of context changes from any surrounding with blocks. More...
 
static SubtableSymbol * getCurrentSubtable (const list< WithBlock > &stack)
 Get the active subtable from the stack of currently active with blocks. More...
 

Private Attributes

SubtableSymbol * ss
 Subtable containing each Constructor (or null for root table)
 
PatternEquation * pateq
 Pattern to prepend to each Constructor (or null)
 
vector< ContextChange * > contvec
 Context change to associate with each constructor (or null)
 

Detailed Description

Subtable, pattern, and context information applied across a with block.

The header of a with block is applied to all constructors in the block. It attaches each constructor to a specific subtable. A pattern expression and/or a a series of context changes is attached to each constructor as well.

Member Function Documentation

◆ collectAndPrependContext()

vector< ContextChange * > * ghidra::WithBlock::collectAndPrependContext ( const list< WithBlock > &  stack,
vector< ContextChange *> *  contvec 
)
static

Build a complete array of context changes from any surrounding with blocks.

Given a list of ContextChanges parsed locally from a Constructor and the stack of surrounding with blocks, make a new list of ContextChanges, prepending everything from the stack to the local vector. Return the new list and delete the old.

Parameters
stackis the current with block stack
contvecis the local list of ContextChanges (or null)
Returns
the new list of ContextChanges

Referenced by ghidra::SleighCompile::buildConstructor().

◆ collectAndPrependPattern()

PatternEquation * ghidra::WithBlock::collectAndPrependPattern ( const list< WithBlock > &  stack,
PatternEquation *  pateq 
)
static

Build a complete pattern equation from any surrounding with blocks.

Given the pattern equation parsed locally from a Constructor and the stack of surrounding with blocks, create the final pattern equation for the Constructor. Each with block pattern is preprended to the local pattern.

Parameters
stackis the stack of with blocks currently active at the Constructor
pateqis the pattern equation parsed from the local Constructor statement
Returns
the final pattern equation

Referenced by ghidra::SleighCompile::buildConstructor().

◆ getCurrentSubtable()

SubtableSymbol * ghidra::WithBlock::getCurrentSubtable ( const list< WithBlock > &  stack)
static

Get the active subtable from the stack of currently active with blocks.

Find the subtable associated with the innermost with block and return it.

Parameters
stackis the stack of currently active with blocks
Returns
the innermost subtable (or null)

Referenced by ghidra::SleighCompile::createConstructor().

◆ set()

void ghidra::WithBlock::set ( SubtableSymbol *  s,
PatternEquation *  pq,
vector< ContextChange *> *  cvec 
)

Set components of the header.

Establish each component of the with block header

Parameters
sis the subtable (or null)
pqis the pattern to prepend (or null)
cvecis the set of context changes (or null)

The documentation for this class was generated from the following files: