topazc
SemanticAnalyzer Class Reference

#include <semantic.hpp>

Classes

struct  Value
 Structure of value. More...
struct  FunctionInfo
 Structure of information about function. More...
struct  ModuleInfo
 Structure of information about module. More...
struct  PathPart
 Structure of part of path to object. More...

Public Member Functions

 SemanticAnalyzer (std::vector< AST::StmtPtr > &s, std::string lp, std::string fn, bool id)
void analyze ()
 Method for analyze all statements.
std::map< std::string, ModuleInfo * > get_modules () const
 Method for getting modules from semantic.
std::map< std::string, std::vector< std::shared_ptr< FunctionInfo > > > get_functions () const
 Method for getting functions from semantic.

Private Types

enum  Space { SPACE_GLOBAL , SPACE_MODULE , SPACE_FUNCTION }
 Current space (in global, in module or in function). More...

Private Member Functions

void analyze_stmt (AST::Stmt &stmt)
 Method for analyze one statement.
void analyze_var_decl_stmt (AST::VarDeclStmt &vds, bool is_func_arg=false)
 Method for analyze variable declaration.
void analyze_var_asgn_stmt (AST::VarAsgnStmt &vas)
 Method for analyze variable assignment.
void analyze_func_decl_stmt (AST::FuncDeclStmt &fds)
 Method for analyze function declaration.
void analyze_func_call_stmt (AST::FuncCallStmt &fcs)
 Method for analyze function calling.
void analyze_return_stmt (AST::ReturnStmt &rs)
 Method for analyze 'return' statement.
void analyze_if_else_stmt (AST::IfElseStmt &ies)
 Method for analyze control flow operators.
void analyze_while_cycle_stmt (AST::WhileCycleStmt &wcs)
 Method for analyze while cycle.
void analyze_do_while_cycle_stmt (AST::DoWhileCycleStmt &dwcs)
 Method for analyze do-while cycle.
void analyze_for_cycle_stmt (AST::ForCycleStmt &fcs)
 Method for analyze for cycle.
void analyze_break_stmt (AST::BreakStmt &bs)
 Method for analyze break statement.
void analyze_continue_stmt (AST::ContinueStmt &cs)
 Method for analyze continue statement.
void analyze_module_stmt (AST::ModuleStmt &ms)
 Method for analyze module definition.
void analyze_use_module_stmt (AST::UseModuleStmt &ums)
 Method for analyze import the module.
void analyze_extern_stmt (AST::ExternStmt &es)
 Method for analyze extern calls.
Value analyze_expr (AST::Expr &expr)
 Method for analyze expression.
Value analyze_literal_expr (AST::Literal &lit)
 Method for analyze literal.
Value analyze_binary_expr (AST::BinaryExpr &be)
 Method for analyze binary expression.
Value analyze_unary_expr (AST::UnaryExpr &ue)
 Method for analyze unary expression.
Value analyze_var_expr (AST::VarExpr &ve)
 Method for analyze variable expression.
Value analyze_func_call_expr (AST::FuncCallExpr &fce)
 Method for analyze function calling expression.
Value analyze_obj_chain_expr (AST::ChainObjects &co)
 Method for analyze chain of objects expression.
Value analyze_obj_from_chain (Value target, AST::Expr &obj)
 Method for analyze object from chain of objects expression.
Value get_function_return_value (std::shared_ptr< FunctionInfo > func, AST::FuncCallExpr &fce)
 Method for evaluating and returning function returned value.
Valueget_function_return_value_from_if_else (AST::IfElseStmt &ies)
 Method for evaluating and returning function returned value from control flow operators.
Valueget_function_return_value_from_while_cycle (AST::WhileCycleStmt &wcs)
 Method for evaluating and returning function returned value from while cycle.
Valueget_function_return_value_from_do_while_cycle (AST::DoWhileCycleStmt &dwcs)
 Method for evaluating and returning function returned value from do-while cycle.
Valueget_function_return_value_from_for_cycle (AST::ForCycleStmt &fcs)
 Method for evaluating and returning function returned value from for cycle.
AST::Value get_default_val_by_type (AST::Type type, uint32_t line)
 Method for getting default value by type.
std::unique_ptr< Valueget_variable_value (std::string name)
 Method for getting value of variable from view scope of variables table.
std::vector< std::shared_ptr< FunctionInfo > > get_function_candidates (std::string name)
 Method for getting function candidates from functions table.
bool has_common_type (AST::Type left, AST::Type right)
 Method for determining whether two types have a common type.
AST::Type get_common_type (AST::Type left, AST::Type right, uint32_t line)
 Method for getting common type between two types.
Value implicitly_cast (Value val, AST::Type type, uint32_t line)
 Method for getting implicitly casted value between two values.
double binary_two_variants (Value left, Value right, TokenType op, uint32_t line)
 Method for evaluating binary operations on two values from std::variant.
double unary_two_variants (Value value, TokenType op, uint32_t line)
 Method for evaluating unary operations on two values from std::variant.
std::string get_mangled_name (std::string base_name)
 Method for getting mangled name.
std::vector< PathPartget_resolved_name (std::string mangled_name)
 Method for getting resolved name by mangled name.

Private Attributes

std::string libs_path
std::string file_name
std::string path_to_current_dir
std::vector< AST::StmtPtr > & stmts
bool is_debug
enum SemanticAnalyzer::Space current_space
std::map< AST::TypeValue, std::vector< AST::TypeValue > > implicitly_cast_allowed_types
std::stack< std::map< std::string, Value > > variables
std::map< std::string, std::vector< std::shared_ptr< FunctionInfo > > > functions
std::stack< AST::Typefunctions_ret_types
unsigned depth_of_loops
std::vector< std::string > allowed_langs_for_extern
std::map< std::string, ModuleInfo * > modules
std::vector< std::string > names_of_imported_modules
std::stack< PathPartcurrent_path

Detailed Description

Definition at line 14 of file semantic.hpp.

Member Enumeration Documentation

◆ Space

Current space (in global, in module or in function).

Enumerator
SPACE_GLOBAL 
SPACE_MODULE 
SPACE_FUNCTION 

Definition at line 25 of file semantic.hpp.

Constructor & Destructor Documentation

◆ SemanticAnalyzer()

SemanticAnalyzer::SemanticAnalyzer ( std::vector< AST::StmtPtr > & s,
std::string lp,
std::string fn,
bool id )
inline

Definition at line 102 of file semantic.hpp.

Here is the caller graph for this function:

Member Function Documentation

◆ analyze()

void SemanticAnalyzer::analyze ( )

Method for analyze all statements.

This method analyze all statements to semantic errors. If have error, then throwing exception

Definition at line 15 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_binary_expr()

SemanticAnalyzer::Value SemanticAnalyzer::analyze_binary_expr ( AST::BinaryExpr & be)
private

Method for analyze binary expression.

This method analyze passed binary expression and returns value of it

Parameters
beBinary expression for analyzing
Returns
Value of passed binary expression

Definition at line 709 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_break_stmt()

void SemanticAnalyzer::analyze_break_stmt ( AST::BreakStmt & bs)
private

Method for analyze break statement.

This method analyze break statement. If break statement isn't in cycle, then throwing exception

Parameters
bsBreak statement

Definition at line 505 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_continue_stmt()

void SemanticAnalyzer::analyze_continue_stmt ( AST::ContinueStmt & cs)
private

Method for analyze continue statement.

This method analyze continue statement. If continue statement isn't in cycle, then throwing exception

Parameters
csContinue statement

Definition at line 511 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_do_while_cycle_stmt()

void SemanticAnalyzer::analyze_do_while_cycle_stmt ( AST::DoWhileCycleStmt & dwcs)
private

Method for analyze do-while cycle.

This method analyze do-while cycle. If condition for do-while cycle is not a bool type, then throwing exception

Parameters
dwcsDo-while cycle

Definition at line 467 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_expr()

SemanticAnalyzer::Value SemanticAnalyzer::analyze_expr ( AST::Expr & expr)
private

Method for analyze expression.

This method analyze passed expression and returns value of it

Parameters
exprExpression for analyzing
Returns
Value of passed expression

Definition at line 681 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_extern_stmt()

void SemanticAnalyzer::analyze_extern_stmt ( AST::ExternStmt & es)
private

Method for analyze extern calls.

This method analyze extern calls (only in unsafe context)

Parameters
esExtern functions block

Definition at line 670 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_for_cycle_stmt()

void SemanticAnalyzer::analyze_for_cycle_stmt ( AST::ForCycleStmt & fcs)
private

Method for analyze for cycle.

This method analyze for cycle. If condition for for cycle is not a bool type, then throwing exception. If indexator statement is not a variable declaration/assignment, then throwing exception.

Parameters
fcsFor cycle

Definition at line 483 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_func_call_expr()

SemanticAnalyzer::Value SemanticAnalyzer::analyze_func_call_expr ( AST::FuncCallExpr & fce)
private

Method for analyze function calling expression.

This method searching passed function in functions table and returns value of call this function

Parameters
fceFunction calling expression for analyzing
Returns
Value of passed function calling (if have)

Definition at line 866 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_func_call_stmt()

void SemanticAnalyzer::analyze_func_call_stmt ( AST::FuncCallStmt & fcs)
private

Method for analyze function calling.

This method analyze function calling

Parameters
fdsFunction calling statement for analyzing

Definition at line 353 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_func_decl_stmt()

void SemanticAnalyzer::analyze_func_decl_stmt ( AST::FuncDeclStmt & fds)
private

Method for analyze function declaration.

This method analyze function declaration

Parameters
fdsFunction declaration statement for analyzing

Definition at line 241 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_if_else_stmt()

void SemanticAnalyzer::analyze_if_else_stmt ( AST::IfElseStmt & ies)
private

Method for analyze control flow operators.

This method analyze control flow operators. If condition for control flow operator 'if' is not a bool type, then throwing exception

Parameters
iesControl flow operator

Definition at line 430 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_literal_expr()

SemanticAnalyzer::Value SemanticAnalyzer::analyze_literal_expr ( AST::Literal & lit)
private

Method for analyze literal.

This method analyze passed literal and returns value of it

Parameters
litLiteral for analyzing
Returns
Value of passed literal

Definition at line 705 of file semantic.cpp.

Here is the caller graph for this function:

◆ analyze_module_stmt()

void SemanticAnalyzer::analyze_module_stmt ( AST::ModuleStmt & ms)
private

Method for analyze module definition.

This method analyze module definition

Parameters
msModule definition statement

Definition at line 517 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_obj_chain_expr()

SemanticAnalyzer::Value SemanticAnalyzer::analyze_obj_chain_expr ( AST::ChainObjects & co)
private

Method for analyze chain of objects expression.

This method checking all expressions in path from chain

Parameters
coChain of objects expression for evaluating
Returns
Value of passed chain of objects

Definition at line 970 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_obj_from_chain()

SemanticAnalyzer::Value SemanticAnalyzer::analyze_obj_from_chain ( Value target,
AST::Expr & obj )
private

Method for analyze object from chain of objects expression.

This method analyzing passed object expression by passed target value

Parameters
targetValue of target object
objExpression of object for analyzing
Returns
Value of passed object expression

Definition at line 981 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_return_stmt()

void SemanticAnalyzer::analyze_return_stmt ( AST::ReturnStmt & rs)
private

Method for analyze 'return' statement.

This method analyze 'return' statement

Parameters
rs'return' statement for analyzing

Definition at line 411 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_stmt()

void SemanticAnalyzer::analyze_stmt ( AST::Stmt & stmt)
private

Method for analyze one statement.

This method analyze one statement to semantic errors. If have error, then throwing exception

Parameters
stmtStatement for analyzing

Definition at line 21 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_unary_expr()

SemanticAnalyzer::Value SemanticAnalyzer::analyze_unary_expr ( AST::UnaryExpr & ue)
private

Method for analyze unary expression.

This method analyze passed unary expression and returns value of it

Parameters
ueUnary expression for analyzing
Returns
Value of passed unary expression

Definition at line 793 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_use_module_stmt()

void SemanticAnalyzer::analyze_use_module_stmt ( AST::UseModuleStmt & ums)
private

Method for analyze import the module.

This method analyze import the module. If module already imported, then throwing exception

Parameters
umsImporting module

Definition at line 555 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_var_asgn_stmt()

void SemanticAnalyzer::analyze_var_asgn_stmt ( AST::VarAsgnStmt & vas)
private

Method for analyze variable assignment.

This method analyze variable assignment

Parameters
vasVariable assignment statement for analyzing

Definition at line 170 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_var_decl_stmt()

void SemanticAnalyzer::analyze_var_decl_stmt ( AST::VarDeclStmt & vds,
bool is_func_arg = false )
private

Method for analyze variable declaration.

This method analyze variable declaration

Parameters
vdsVariable declaration statement for analyzing
is_func_argFlag that indicates that a variable is an argument to a function

Definition at line 87 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_var_expr()

SemanticAnalyzer::Value SemanticAnalyzer::analyze_var_expr ( AST::VarExpr & ve)
private

Method for analyze variable expression.

This method searching passed variable in view scope of variables table and returns value of it

Parameters
veVariable expression for analyzing
Returns
Value of passed variable (if have)

Definition at line 853 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_while_cycle_stmt()

void SemanticAnalyzer::analyze_while_cycle_stmt ( AST::WhileCycleStmt & wcs)
private

Method for analyze while cycle.

This method analyze while cycle. If condition for while cycle is not a bool type, then throwing exception

Parameters
wcsWhile cycle

Definition at line 451 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binary_two_variants()

double SemanticAnalyzer::binary_two_variants ( Value left,
Value right,
TokenType op,
uint32_t line )
private

Method for evaluating binary operations on two values from std::variant.

This method evaluating binary operations on two values from std::variant and returns result

Parameters
leftValue of left operand
rightValue of right operand
opType of binary operator
lineLine coordinate in Topaz source code (for exception)
Returns
Evaluating value

Definition at line 1400 of file semantic.cpp.

Here is the call graph for this function:

◆ get_common_type()

AST::Type SemanticAnalyzer::get_common_type ( AST::Type left,
AST::Type right,
uint32_t line )
private

Method for getting common type between two types.

This method getting common type between two passed types and returns it. If common type does not exist, then throwing exception

Parameters
leftType to be implicitly cast
rightType to be implicitly cast to
lineLine coordinate in Topaz source code (for exception)
Returns
Common type between two passed types

Definition at line 1322 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_default_val_by_type()

AST::Value SemanticAnalyzer::get_default_val_by_type ( AST::Type type,
uint32_t line )
private

Method for getting default value by type.

This method getting default value by passed type and returns it. If cannot generating value, then throwing exception

Parameters
typeType by which the default value is generated
lineLine coordinate in Topaz source code (for exception)
Returns
Default value by passed type

Definition at line 1263 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_function_candidates()

std::vector< std::shared_ptr< SemanticAnalyzer::FunctionInfo > > SemanticAnalyzer::get_function_candidates ( std::string name)
private

Method for getting function candidates from functions table.

This method getting function candidates from functions table and returns it. If function not found, then returning empty vector

Parameters
nameName of function
Returns
Candidates

Definition at line 1298 of file semantic.cpp.

Here is the caller graph for this function:

◆ get_function_return_value()

SemanticAnalyzer::Value SemanticAnalyzer::get_function_return_value ( std::shared_ptr< FunctionInfo > func,
AST::FuncCallExpr & fce )
private

Method for evaluating and returning function returned value.

This method evaluating function returned value and returns it. If function dont have return statement, then throwing exception

Parameters
funcPointer to information about function
fceFunction calling expression
Returns
Evaluating function returned value

Definition at line 1047 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_function_return_value_from_do_while_cycle()

SemanticAnalyzer::Value * SemanticAnalyzer::get_function_return_value_from_do_while_cycle ( AST::DoWhileCycleStmt & dwcs)
private

Method for evaluating and returning function returned value from do-while cycle.

This method evaluating function returned value from do-while cycle and returns it. If in block of statements of do-while cycle does not have a 'return' statement, then returns nullptr

Parameters
dwcsDo-while cycle
Returns
Evaluating function returned value or nullptr if does not have 'return'

Definition at line 1190 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_function_return_value_from_for_cycle()

SemanticAnalyzer::Value * SemanticAnalyzer::get_function_return_value_from_for_cycle ( AST::ForCycleStmt & fcs)
private

Method for evaluating and returning function returned value from for cycle.

This method evaluating function returned value from for cycle and returns it. If in block of statements of for cycle does not have a 'return' statement, then returns nullptr

Parameters
fcsFor cycle
Returns
Evaluating function returned value or nullptr if does not have 'return'

Definition at line 1221 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_function_return_value_from_if_else()

SemanticAnalyzer::Value * SemanticAnalyzer::get_function_return_value_from_if_else ( AST::IfElseStmt & ies)
private

Method for evaluating and returning function returned value from control flow operators.

This method evaluating function returned value from control flow operators and returns it. If in block of statements of control flow operators does not have a 'return' statement, then returns nullptr

Parameters
iesControl flow operators
Returns
Evaluating function returned value or nullptr if does not have 'return'

Definition at line 1107 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_function_return_value_from_while_cycle()

SemanticAnalyzer::Value * SemanticAnalyzer::get_function_return_value_from_while_cycle ( AST::WhileCycleStmt & wcs)
private

Method for evaluating and returning function returned value from while cycle.

This method evaluating function returned value from while cycle and returns it. If in block of statements of while cycle does not have a 'return' statement, then returns nullptr

Parameters
wcsWhile cycle
Returns
Evaluating function returned value or nullptr if does not have 'return'

Definition at line 1156 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_functions()

std::map< std::string, std::vector< std::shared_ptr< FunctionInfo > > > SemanticAnalyzer::get_functions ( ) const
inline

Method for getting functions from semantic.

Returns
Table of functions

Definition at line 129 of file semantic.hpp.

Here is the caller graph for this function:

◆ get_mangled_name()

std::string SemanticAnalyzer::get_mangled_name ( std::string base_name)
private

Method for getting mangled name.

This method returns mangled name based passed object name and SemanticAnalyzer::current_path. Names of parts of path separated '-' (if current part of path is module) or '#' (if current part of path is class)

Parameters
base_nameBased name for mangling
Returns
Mangled name

Definition at line 1537 of file semantic.cpp.

Here is the caller graph for this function:

◆ get_modules()

std::map< std::string, ModuleInfo * > SemanticAnalyzer::get_modules ( ) const
inline

Method for getting modules from semantic.

Returns
Table of modules

Definition at line 120 of file semantic.hpp.

Here is the caller graph for this function:

◆ get_resolved_name()

std::vector< SemanticAnalyzer::PathPart > SemanticAnalyzer::get_resolved_name ( std::string mangled_name)
private

Method for getting resolved name by mangled name.

This method returns resolved name by passed mangled name

Parameters
mangled_nameMangled name for resolving
Returns
Vector to PathPart

Definition at line 1553 of file semantic.cpp.

Here is the caller graph for this function:

◆ get_variable_value()

std::unique_ptr< SemanticAnalyzer::Value > SemanticAnalyzer::get_variable_value ( std::string name)
private

Method for getting value of variable from view scope of variables table.

This method getting value of variable from view scope of variables table and returns it. If variable not found, then returning null

Parameters
nameName of variable
Returns
Value of variable

Definition at line 1286 of file semantic.cpp.

Here is the caller graph for this function:

◆ has_common_type()

bool SemanticAnalyzer::has_common_type ( AST::Type left,
AST::Type right )
private

Method for determining whether two types have a common type.

This method searches the table of types that can be implicitly cast to the type that needs to be converted to the type that is required. If a match is found, then true is returned, otherwise false.

Parameters
leftType to be implicitly cast
rightType to be implicitly cast to
Returns
true if there is a common type for the two passed types, otherwise false

Definition at line 1306 of file semantic.cpp.

Here is the caller graph for this function:

◆ implicitly_cast()

SemanticAnalyzer::Value SemanticAnalyzer::implicitly_cast ( Value val,
AST::Type type,
uint32_t line )
private

Method for getting implicitly casted value between two values.

This method getting implicitly casted value between two passed values and returns it. If common type does not exist, then throwing exception

Parameters
valValue to be implicitly cast
typeType to be implicitly cast to
lineLine coordinate in Topaz source code (for exception)
Returns
Implicitly casted value

Definition at line 1343 of file semantic.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unary_two_variants()

double SemanticAnalyzer::unary_two_variants ( Value value,
TokenType op,
uint32_t line )
private

Method for evaluating unary operations on two values from std::variant.

This method evaluating unary operations on two values from std::variant and returns result

Parameters
leftValue of left operand
rightValue of right operand
opType of unary operator
lineLine coordinate in Topaz source code (for exception)
Returns
Evaluating value

Definition at line 1490 of file semantic.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ allowed_langs_for_extern

std::vector<std::string> SemanticAnalyzer::allowed_langs_for_extern
private
Initial value:
{
"C",
"C++",
"Rust"
}

Allowed names of languages for extern calling

Definition at line 67 of file semantic.hpp.

◆ current_path

std::stack<PathPart> SemanticAnalyzer::current_path
private

Stack to current path to some object

Definition at line 99 of file semantic.hpp.

◆ current_space

enum SemanticAnalyzer::Space SemanticAnalyzer::current_space
private

◆ depth_of_loops

unsigned SemanticAnalyzer::depth_of_loops
private

Depth of loops

Definition at line 66 of file semantic.hpp.

◆ file_name

std::string SemanticAnalyzer::file_name
private

Absolute path to the Topaz source code

Definition at line 17 of file semantic.hpp.

◆ functions

std::map<std::string, std::vector<std::shared_ptr<FunctionInfo> > > SemanticAnalyzer::functions
private

Functions table (name, candidates)

Definition at line 64 of file semantic.hpp.

◆ functions_ret_types

std::stack<AST::Type> SemanticAnalyzer::functions_ret_types
private

Stack of functions return types

Definition at line 65 of file semantic.hpp.

◆ implicitly_cast_allowed_types

std::map<AST::TypeValue, std::vector<AST::TypeValue> > SemanticAnalyzer::implicitly_cast_allowed_types
private

◆ is_debug

bool SemanticAnalyzer::is_debug
private

Flag for debug exception

Definition at line 20 of file semantic.hpp.

◆ libs_path

std::string SemanticAnalyzer::libs_path
private

Absolute path to the Topaz libraries

Definition at line 16 of file semantic.hpp.

◆ modules

std::map<std::string, ModuleInfo*> SemanticAnalyzer::modules
private

Modules table

Definition at line 82 of file semantic.hpp.

◆ names_of_imported_modules

std::vector<std::string> SemanticAnalyzer::names_of_imported_modules
private

Names of already imported modules

Definition at line 83 of file semantic.hpp.

◆ path_to_current_dir

std::string SemanticAnalyzer::path_to_current_dir
private

Absolute path to the directory which contains current Topaz source code file

Definition at line 18 of file semantic.hpp.

◆ stmts

std::vector<AST::StmtPtr>& SemanticAnalyzer::stmts
private

AST Tree (statements from Parser)

Definition at line 19 of file semantic.hpp.

◆ variables

std::stack<std::map<std::string, Value> > SemanticAnalyzer::variables
private

View scope of the variables table

Definition at line 52 of file semantic.hpp.


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