Logo Search packages:      
Sourcecode: fauhdlc version File versions

ast::GenCode Class Reference

#include <GenCode.hpp>

Inheritance diagram for ast::GenCode:

ast::TopDownVisitor ast::Visitor

List of all members.


Detailed Description

generate intermediate code from the AST

This visitor will generate intermediate code from the abstract syntax tree. Steps, that must have been done prior to running this visitor are:

Definition at line 46 of file GenCode.hpp.


Public Member Functions

 GenCode (intermediate::CodeContainer *cc)
 alternate c'tor for expression handling
 GenCode ()
 c'tor
virtual void visit (AttributeDeclaration &node)
virtual void visit (TemporaryName &node)
virtual void visit (TypeConversion &node)
virtual void visit (LibraryList &node)
virtual void visit (Library &node)
virtual void visit (EnumerationElement &node)
virtual void visit (RecordTypeElement &node)
virtual void visit (RecordType &node)
virtual void visit (UnconstrainedArrayType &node)
virtual void visit (RangeConstraintType &node)
virtual void visit (PhysicalTypeUnit &node)
virtual void visit (PhysicalType &node)
virtual void visit (EnumerationType &node)
virtual void visit (CondalSigAssign &node)
virtual void visit (SubprogBody &node)
virtual void visit (PackageBody &node)
virtual void visit (ProcedureDeclaration &node)
virtual void visit (FunctionDeclaration &node)
virtual void visit (AssociationElement &node)
virtual void visit (Others &node)
virtual void visit (CaseAlternative &node)
virtual void visit (WaveFormElem &node)
virtual void visit (NullStat &node)
virtual void visit (ElementAssociation &node)

Public Attributes

intermediate::CodeContainercontainer
 the code container containing the generated code
RegisterSet sourceRegs
 source register set

Protected Member Functions

template<typename T>
void listTraverse (T &l, bool &deleteFlag)
 traverse a list of AST nodes, eventually deleting a node.
template<typename T>
void listTraverse (T l)
 traverse a list of AST nodes.
virtual void process (AttributableDeclaration &node)
 Process a AttributableDeclaration.
virtual void process (Name &node)
 Process a generic Name.
virtual void process (PrefixedName &node)
 Process a generic PrefixedName.
virtual void process (LibUnit &node)
 Process a generic LibUnit.
virtual void process (ConditionedStat &node)
 Process a generic ConditionedStat.
virtual void process (LoopStat &node)
 Process a generic LoopStat.
virtual void process (SeqStat &node)
 Process a generic SeqStat.
virtual void process (Expression &node)
 Process a generic Expression.
virtual void process (SymbolDeclaration &node)
 Process a generic SymbolDeclaration.
virtual void process (ValDeclaration &node)
 Process a generic ValDeclaration.
virtual void process (AstNode &node)
 Process a generic AstNode.

Static Protected Attributes

static int visits = 0

Private Types

enum  assignOperationE { ASSIGN_OPERATION_COPY, ASSIGN_OPERATION_LOG, ASSIGN_OPERATION_CONNECT }
typedef std::list< copyBackT > copyBackListT
typedef std::pair< const
ValDeclaration
*, intermediate::Operand * > 
copyBackT

Private Member Functions

void addUnconstraintParams (const ValDeclaration &node)
template<typename T>
void callSubprog (T &node, const char *foreign)
void createInitFunction (const Process &node)
void createInitFunction (const Architecture &node)
void doAssignment (TypeDeclaration &type)
void getConstraints (const ValDeclaration &vd)
intermediate::OperandgetSubscriptIndex (Expression *index)
void handleCompositeReturn (FunctionCall &node)
void instantiateComponent (CompInstStat &node)
void instantiateComponents (const Architecture &node)
virtual void process (TypeDeclaration &node)
 Process a generic TypeDeclaration.
virtual void process (Callable &node)
 Process a generic Callable.
void processAlternative (CaseAlternative &node, intermediate::Operand *cmpVal, intermediate::Label *caseNext, intermediate::Label *caseOut)
void processArrayAggregate (Aggregate &node)
void processArrayAssoc (ElementAssociation &node, TypeDeclaration *aType)
void processArrayCopy (ConstArray &node)
void processArrayUpdate (ConstArray &node)
void processCFLoopStat (Expression *optCond, intermediate::Label *target)
 process a next/exit statement.
template<typename T>
void processConst (T &node)
 process a ConstReal or ConstInteger node.
void processDRByBounds (DiscreteRange &node)
void processExpression (Expression &node)
void processRangeAttr (AttributeName &node)
template<typename T>
void processRCT (RangeConstraintType &node)
void processRecordAggregate (Aggregate &node)
void processSubscription (Subscript &node, std::list< Expression * > &indices)
 process a Subscript node with one index.
intermediate::DataprocessValDecl (ValDeclaration &node, enum intermediate::StorageType st)
void registerDriver (Driver &drv)
void registerDrivers (const Process &node)
intermediate::OpCodesetArg (Callable &c, ValDeclaration &vd, AssociationElement &element, const char *foreign)
 push an argument of a function call on the stack.
void setArgByBasePointer (intermediate::Reference *callee, ValDeclaration *vd, AssociationElement &element, const char *foreign)
void setArgByBasePointerToTemporary (intermediate::Reference *callee, ValDeclaration &vd, AssociationElement &element, const char *foreign)
void setArgByDriver (intermediate::Reference *callee, const std::list< Driver * > &drivers, ValDeclaration &vd, AssociationElement &element, const char *foreign, bool usePointer)
void setArgByPointer (intermediate::Reference *callee, ValDeclaration *vd, AssociationElement &element, const char *foreign)
intermediate::OpCodesetArgByValue (intermediate::Reference *callee, ValDeclaration *vd, AssociationElement &element, const char *foreign, bool copyBack)
template<typename T>
std::list< intermediate::OpCode * > setArgList (T &node, const char *foreign)
 push the argument list of FunctionCall/ProcedureCall node.
void setConstraintsByRS (intermediate::Reference *cRef, const std::string &icPrefix, const char *foreign)
void setConstraintsByType (intermediate::Reference *cRef, const std::string &icPrefix, const TypeDeclaration *t, const char *foreign)
void setGenericMap (intermediate::Reference *cont, std::list< AssociationElement * > &genericMap, bool isForeign)
void setPortList (intermediate::Reference *cont, std::list< AssociationElement * > &portList, bool isForeign)
virtual void visit (CaseStat &node)
virtual void visit (AttributeSpecification &node)
virtual void visit (SubtypeIndication &node)
virtual void visit (ConstArray &node)
virtual void visit (ProcCallStat &node)
virtual void visit (AssertStat &node)
virtual void visit (WaitStat &node)
virtual void visit (ExitStat &node)
virtual void visit (NextStat &node)
virtual void visit (WhileLoopStat &node)
virtual void visit (ForLoopStat &node)
virtual void visit (Process &node)
virtual void visit (ConstantDeclaration &node)
virtual void visit (VarDeclaration &node)
virtual void visit (SignalDeclaration &node)
virtual void visit (ReturnStat &node)
virtual void visit (Aggregate &node)
virtual void visit (FunctionCall &node)
virtual void visit (SelectedName &node)
virtual void visit (DiscreteRange &node)
virtual void visit (Slice &node)
virtual void visit (Subscript &node)
virtual void visit (IfStat &node)
virtual void visit (AttributeName &node)
virtual void visit (SimpleName &node)
virtual void visit (ConstReal &node)
virtual void visit (ConstInteger &node)
virtual void visit (SigAssignStat &node)
virtual void visit (VarAssignStat &node)
virtual void visit (CompInstStat &node)
virtual void visit (Architecture &node)
virtual void visit (Entity &node)
virtual void visit (Package &node)

Static Private Member Functions

static void annotateDataSize (intermediate::Data &data, const SubtypeIndication *type)

Private Attributes

std::list< CompInstStat * > archComponents
bool assignExpression
 assign the expression to the destination register set if true.
enum assignOperationE assignOperation
ProcesscurrentProcess
CallablecurrentSubprog
intermediate::OperanddataOp
 data operand passed to AssignVisitor.
RegisterSet destRegs
 destination register set
bool isTarget
 is the currently evaluated expression a target?
LoopRegistry loopRegistry

Classes

class  AssignVisitor
 generate code to assign src to dst More...
class  ProcessStackedExpression
 process a generic expression, and perform assignments. More...

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

Generated by  Doxygen 1.6.0   Back to index