Peano
Loading...
Searching...
No Matches
Utils.py
Go to the documentation of this file.
1
# This file is part of the DaStGen2 project. For conditions of distribution and
2
# use, please see the copyright notice at www.peano-framework.org
3
4
5
LLVMSymbol =
"__PACKED_ATTRIBUTES_LANGUAGE_EXTENSION__"
6
7
8
def
get_include_guard(full_qualified_name):
9
return
"_INCLUDE_"
+ full_qualified_name.replace(
"::"
,
"_"
).upper() +
"_"
10
11
12
def
get_unqualified_class_name(full_qualified_name):
13
return
full_qualified_name.split(
"::"
)[-1]
14
15
16
def
get_namespaces(full_qualified_name):
17
result = [x
for
x
in
full_qualified_name.split(
"::"
)]
18
result.pop()
19
return
result
20
21
22
def
construct_ifdef_string(symbol_list):
23
"""!
24
25
Return empty string if symbol_list is empty. Otherwise construct
26
the whole ifdef thing.
27
28
"""
29
result =
""
30
if
symbol_list != []:
31
result +=
"#if "
32
added_one_ifdef =
False
33
for
i
in
symbol_list:
34
if
added_one_ifdef:
35
result +=
" and "
36
added_one_ifdef =
True
37
result += i
38
result +=
"\n"
39
return
result
src
dastgen2
Utils.py
Generated on Wed Nov 4 2026 08:20:47 for Peano by
1.9.8