Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cimplec/sim-c
/ functions
Functions
66 in github.com/cimplec/sim-c
⨍
Functions
66
◇
Types & classes
5
↓ 88 callers
Function
error
Shows error message in red color and exits the current process Params ====== msg (string) = The message to be shown as error me
simc/global_helpers.py:26
↓ 42 callers
Method
get_by_id
Returns symbol table entry by integer unique id Params ====== id (id) = Integer unique id of a symbol in the table
simc/symbol_table.py:96
↓ 33 callers
Function
check_if
Check if type matches what it should be otherwise throw an error and exit Params ====== given_type (string) = Type of toke
simc/global_helpers.py:5
↓ 32 callers
Method
__update_source_index
Update current source index by an integer
simc/lexical_analyzer.py:117
↓ 20 callers
Method
get_by_symbol
Returns unique id of a given value Params ====== value (string) = Value to be searched in the symbol table
simc/symbol_table.py:111
↓ 18 callers
Function
expression
Parse and expression from tokens Params ====== tokens (list) = List of tokens i (st
simc/parser/simc_parser.py:19
↓ 10 callers
Method
__check_next_token
Generates token based on value of next token Params ====== next_chars (list) = Characters to be checked in the
simc/lexical_analyzer.py:124
↓ 8 callers
Function
skip_all_nextlines
(tokens, i)
simc/parser/simc_parser.py:518
↓ 5 callers
Method
entry
Returns id in symbol table after making an entry Params ====== value (string) = Value to be stored in symbol ta
simc/symbol_table.py:75
↓ 4 callers
Method
__push_to_scope_stack
(self, val)
simc/scope_resolve.py:10
↓ 3 callers
Method
resolve_dependency
Resolves the dependency relation between variables This is a recursive function, it is used when the parser discovers the type of a
simc/symbol_table.py:186
↓ 2 callers
Method
__pop_from_scope_stack
(self)
simc/scope_resolve.py:13
↓ 2 callers
Method
__string_val
Processes string values in the source code
simc/lexical_analyzer.py:242
↓ 2 callers
Function
array_initializer
Parse array initializer list Params ====== tokens (list) = List of tokens i (string/list) = Curren
simc/parser/array_parser.py:6
↓ 2 callers
Function
compile
Compiles opcodes produced by parser into C code Params ====== opcodes (list) = List of opcodes c_filename (string)
simc/compiler.py:73
↓ 2 callers
Function
compile_func_main_code
Check which code should go in main and which outside of main Params ====== outside_code (string) = Code to be put outside mai
simc/compiler.py:45
↓ 2 callers
Function
function_call_statement
Parse function calling statement Params ====== tokens (list) = List of tokens i (int) = Curren
simc/parser/function_parser.py:6
↓ 2 callers
Function
function_parameter
Parse function parameter Params ====== tokens (list) = List of tokens i (int) = Current index i
simc/parser/function_parser.py:391
↓ 2 callers
Function
if_statement
Parse if statement Params ====== tokens (list) = List of tokens i (int) = Current index in tok
simc/parser/conditional_parser.py:6
↓ 2 callers
Function
initializate_struct
Initialization of a struction when the variable instantiate is type of a declared struct Params ====== tokens (list) = List of t
simc/parser/struct_parser.py:6
↓ 2 callers
Function
is_alnum
Checks if character is alphabet or digit or none, checks if character is in a-z, 0-9, _, and . for alphanumeric character Params ======
simc/global_helpers.py:74
↓ 2 callers
Function
is_digit
Checks if character is digit or not, includes 0-9 and . Params ====== char (string) = Single character mostly part of a longer strin
simc/global_helpers.py:42
↓ 2 callers
Method
lexical_analyze
Generate tokens from source code Returns ======== list: A list of tokens of the source code, if the code is lexicall
simc/lexical_analyzer.py:422
↓ 2 callers
Function
parse
Parse tokens and generate opcodes Params ====== tokens (list) = List of tokens Returns ======= list: The list of opcodes
simc/parser/simc_parser.py:526
↓ 2 callers
Function
print_statement
Parse print statement Params ====== tokens (list) = List of tokens i (int) = Current index in t
simc/parser/simc_parser.py:328
↓ 2 callers
Method
resolve_scope
(self, module_name)
simc/scope_resolve.py:16
↓ 2 callers
Function
unary_statement
Parse unary statement Params ====== tokens (list) = List of tokens i (int) = Current index in token table
simc/parser/simc_parser.py:400
↓ 1 callers
Method
__get_raw_tokens
Makes RAW_C tokens for each line of C code written between BEGIN_C and END_C
simc/lexical_analyzer.py:395
↓ 1 callers
Method
__initialize_flags_counters
Initialize flags and counter variables used for lexical analysis
simc/lexical_analyzer.py:148
↓ 1 callers
Method
__is_keyword
Checks if string is keyword or not Params ====== value (string) = The string to be checked for keyword Retu
simc/lexical_analyzer.py:188
↓ 1 callers
Method
__keyword_identifier
Process keywords and identifiers in source code
simc/lexical_analyzer.py:316
↓ 1 callers
Method
__numeric_val
Processes numeric values in the source code
simc/lexical_analyzer.py:203
↓ 1 callers
Method
__read_source_code
Read source code from source file path and return it in a string Returns ======= str: sim-C source code
simc/lexical_analyzer.py:89
↓ 1 callers
Method
add_dependency
Adds a relation of dependecy beetween two variables It is used when the variable is assigned to other varible before it is type had
simc/symbol_table.py:170
↓ 1 callers
Function
assign_statement
Parse assignment statement Params ====== tokens (list) = List of tokens i (int) = Current index in token tabl
simc/parser/variable_parser.py:291
↓ 1 callers
Function
case_statement
Parse case statement Params ====== tokens (list) = List of tokens i (int) = Current index in t
simc/parser/conditional_parser.py:134
↓ 1 callers
Function
check_include
Checks if any opcode requires standard libraries to be included Params ====== opcodes (list) = List of opcodes Returns ====
simc/compiler.py:5
↓ 1 callers
Function
check_ptr
(tokens, i)
simc/parser/variable_parser.py:6
↓ 1 callers
Function
exit_statement
Parse exit statement Params ====== tokens (list) = List of tokens i (int) = Current index in token table
simc/parser/simc_parser.py:464
↓ 1 callers
Function
extract_func_typedata
Extract typedata of function Params ====== typedata (string) = Typedata of function in format "function---param1---param2-
simc/parser/function_parser.py:155
↓ 1 callers
Function
fill_missing_args_with_defaults
( op_value_list, default_values, num_actual_params, num_formal_params )
simc/parser/function_parser.py:185
↓ 1 callers
Function
for_statement
Parse for for_loop Params ====== tokens (list) = List of tokens i (int) = Current index in token table
simc/parser/loop_parser.py:6
↓ 1 callers
Function
function_definition_statement
Parse function definition statement Params ====== tokens (list) = List of tokens i (int) = Current index in token
simc/parser/function_parser.py:208
↓ 1 callers
Function
function_parameters
Parse function parameters Params ====== tokens (list) = List of tokens i (int) = Current index in list
simc/parser/function_parser.py:327
↓ 1 callers
Function
get_version
(rel_path)
setup.py:19
↓ 1 callers
Function
read
(rel_path)
setup.py:13
↓ 1 callers
Method
resolve_scope_for_id
(self, token, module_name)
simc/symbol_table.py:139
↓ 1 callers
Function
struct_declaration_statement
Parse structure declaration statement Params ====== tokens (list) = List of tokens i (int) = Current index in tok
simc/parser/struct_parser.py:38
↓ 1 callers
Method
swap_tokens_and_table
(self, tokens_list, table)
simc/scope_resolve.py:74
↓ 1 callers
Function
switch_statement
Parse switch statement Params ====== tokens (list) = List of tokens i (int) = Current index in
simc/parser/conditional_parser.py:75
↓ 1 callers
Method
update_filename
Update sim-C source file path Used during lexical analysis of module sources
simc/lexical_analyzer.py:108
↓ 1 callers
Function
var_statement
Parse variable and array declaration [/initialization] statement Params ====== tokens (list) = List of tokens i (i
simc/parser/variable_parser.py:29
↓ 1 callers
Function
while_statement
Parse while statement Params ====== tokens (list) = List of tokens i (int) = Current index in token
simc/parser/loop_parser.py:107
Method
__eq__
Check for equality of tokens Returns ======= bool: Whether a token object is equal to another or not
simc/token_class.py:33
Method
__eq__
Check for equality of opcodes Returns ======= bool: Whether a token object is equal to another or not
simc/op_code.py:32
Method
__init__
Class initializer Params ====== type (string) = Type of token as string val (string) = Value stored
simc/token_class.py:6
Method
__init__
Initializer of OpCode class Params ====== opcode (string) = Type of opcode as string val (string) = Value
simc/op_code.py:6
Method
__init__
Initializer of SymbolTable class
simc/symbol_table.py:6
Method
__init__
(self, tokens_list, symbol_table)
simc/scope_resolve.py:5
Method
__init__
Class initializer Params ====== source_filename (string) = Name of file containing sim-C sour
simc/lexical_analyzer.py:18
Method
__str__
String representation of a Token Returns ======= string: The string representation of Token object, which can be use
simc/token_class.py:22
Method
__str__
Returns string representation of OpCode Returns ======= string: The string representation of OpCode object, which ca
simc/op_code.py:21
Method
__str__
String representation of SymbolTable Returns ======= string: The string representation of SymbolTable object - used
simc/symbol_table.py:14
Function
get_package
()
simc/simpack.py:12
Function
is_alpha
Checks if character is alphabet or not, includes a-z and _ Params ====== char (string) = Single character mostly part of a longer st
simc/global_helpers.py:58
Function
run
()
simc/simc.py:24