Documentation for symbols.py
titan.common.symbols
Information
Bases: NamedTuple
Tuple to store information about the datatype and what operation is being performed.
Source code in titan/common/symbols.py
82 83 84 85 |
|
LiteralSymbolGroup
Bases: set
, Enum
Enum containing symbols corresponding to operations.
Source code in titan/common/symbols.py
76 77 78 79 80 |
|
Operation
Bases: Enum
Enum containing possible operations, such as declaration or arithmetic.
Source code in titan/common/symbols.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
Operation_Type
Bases: set
, Enum
Enum containing sets of titan.common.symbols.Operation
, bundled into common groups.
Note
These groups are:
ARITHMETIC
GENERIC_CONSTANT_DECLARATION
GENERIC_VARAIBLE_DECLARATION
COMPARISON
BITWISE
Source code in titan/common/symbols.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
SymbolTable
Simple symbol table class.
Attributes:
Name | Type | Description |
---|---|---|
content |
Dictionary to store the symbols. |
Source code in titan/common/symbols.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
delete(expression)
Delete an entry from the symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expression |
Symbol to delete. |
required |
Source code in titan/common/symbols.py
115 116 117 118 119 120 121 |
|
exists(expression)
Check if a symbol exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expression |
Symbol to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if symbol exists, else False. |
Source code in titan/common/symbols.py
136 137 138 139 140 141 142 143 144 145 |
|
get(expression)
Get information about the symbol.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expression |
Symbol to query. |
required |
Returns:
Type | Description |
---|---|
Information
|
Information about the symbol. |
Source code in titan/common/symbols.py
124 125 126 127 128 129 130 131 132 133 |
|
Last update:
2023-12-24