hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
IRStructDefinition Class Reference

#include <IR.h>

Classes

struct  Builder
 
struct  nameInfo
 

Public Member Functions

 IRStructDefinition (const yoi::wstr &name, const std::map< yoi::wstr, nameInfo > &nameIndexMap, const vec< std::shared_ptr< IRValueType > > &fieldTypes, const yoi::vec< yoi::wstr > &templateParamNames={}, const yoi::vec< std::shared_ptr< IRValueType > > &storedTemplateArgs={}, const std::map< yoi::wstr, yoi::structDefInnerPair * > &templateMethodDecls={}, const std::map< yoi::wstr, yoi::implInnerPair * > &templateMethodDefs={})
 
const nameInfolookupName (const yoi::wstr &name)
 Lookup a name in the struct definition, returning the index of the field or method and its type.
 
yoi::wstr to_string (yoi::indexT indent=0)
 

Public Attributes

yoi::wstr name
 
yoi::vec< std::shared_ptr< IRValueType > > fieldTypes
 
std::map< yoi::wstr, nameInfonameIndexMap
 
yoi::vec< yoi::wstrtemplateParamNames
 
yoi::vec< std::shared_ptr< IRValueType > > storedTemplateArgs
 
std::map< yoi::wstr, yoi::structDefInnerPair * > templateMethodDecls
 
std::map< yoi::wstr, yoi::implInnerPair * > templateMethodDefs
 
yoi::indexT linkedModuleId
 

Detailed Description

Definition at line 600 of file IR.h.

Constructor & Destructor Documentation

◆ IRStructDefinition()

IRStructDefinition ( const yoi::wstr name,
const std::map< yoi::wstr, nameInfo > &  nameIndexMap,
const vec< std::shared_ptr< IRValueType > > &  fieldTypes,
const yoi::vec< yoi::wstr > &  templateParamNames = {},
const yoi::vec< std::shared_ptr< IRValueType > > &  storedTemplateArgs = {},
const std::map< yoi::wstr, yoi::structDefInnerPair * > &  templateMethodDecls = {},
const std::map< yoi::wstr, yoi::implInnerPair * > &  templateMethodDefs = {} 
)

Definition at line 758 of file IR.cpp.

Member Function Documentation

◆ lookupName()

const IRStructDefinition::nameInfo & lookupName ( const yoi::wstr name)

Lookup a name in the struct definition, returning the index of the field or method and its type.

Parameters
nameThe name to lookup.
Returns
const nameInfo& The index of the field or method and its type.
Exceptions
std::out_of_rangeThrows if the name is not found in the struct definition.

Definition at line 780 of file IR.cpp.

References IRStructDefinition::name, IRStructDefinition::nameIndexMap, and yoi::wstring2string().

Here is the call graph for this function:

◆ to_string()

Member Data Documentation

◆ fieldTypes

◆ linkedModuleId

yoi::indexT linkedModuleId

Definition at line 616 of file IR.h.

◆ name

◆ nameIndexMap

◆ storedTemplateArgs

yoi::vec<std::shared_ptr<IRValueType> > storedTemplateArgs

◆ templateMethodDecls

std::map<yoi::wstr, yoi::structDefInnerPair *> templateMethodDecls

◆ templateMethodDefs

std::map<yoi::wstr, yoi::implInnerPair *> templateMethodDefs

◆ templateParamNames

yoi::vec<yoi::wstr> templateParamNames

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