Handbook
Glossary
def>out-form ( obj -- string )
Vocabulary
libclang
Inputs
obj
an
object
Outputs
string
an
object
Definition
IN:
libclang
GENERIC:
def>out-form
( obj -- string )
Methods
USING:
accessors
assocs
combinators
combinators.smart
kernel
libclang
sequences
;
M:
c-enum
def>out-form
[
{
[
drop
"ENUM: "
]
[
name>>
"\n"
]
[
order>>
dup
clang-state>
child-forms>>
?at
[
drop
{
}
]
unless
[
print-defers
]
[
nip
[
def>out-form
]
map
"\n"
join
" ;\n"
append
]
2bi
]
}
cleave
]
""
append-outputs-as
;
USING:
accessors
combinators
combinators.smart
kernel
libclang
;
M:
c-field
def>out-form
[
{
[
drop
" { "
]
[
name>>
" "
]
[
type>>
" }"
]
}
cleave
]
""
append-outputs-as
;
USING:
accessors
combinators
combinators.smart
kernel
libclang
sequences
;
M:
c-function
def>out-form
[
{
[
drop
"FUNCTION: "
]
[
return-type>>
" "
]
[
name>>
" ( "
]
[
args>>
dup
empty?
")\n"
" )\n"
?
]
}
cleave
]
""
append-outputs-as
;
USING:
accessors
assocs
combinators
combinators.smart
kernel
libclang
sequences
;
M:
c-struct
def>out-form
dup
empty-struct?
[
name>>
"C-TYPE: "
prepend
]
[
[
{
[
drop
"STRUCT: "
]
[
name>>
"\n"
]
[
order>>
dup
clang-state>
child-forms>>
?at
[
drop
~array~
]
unless
[
print-defers
]
[
nip
~quotation~
map
"\n"
join
" ;\n"
append
]
2bi
]
}
cleave
]
""
append-outputs-as
]
if
;
USING:
accessors
combinators
combinators.smart
kernel
libclang
;
M:
c-typedef
def>out-form
dup
ignore-typedef?
[
drop
""
]
[
[
{
[
drop
"TYPEDEF: "
]
[
type>>
" "
]
[
name>>
]
}
cleave
]
""
append-outputs-as
]
if
;
USING:
accessors
assocs
combinators
combinators.smart
kernel
libclang
sequences
;
M:
c-union
def>out-form
[
{
[
drop
"UNION-STRUCT: "
]
[
name>>
"\n"
]
[
order>>
dup
clang-state>
child-forms>>
?at
[
drop
{
}
]
unless
[
print-defers
]
[
nip
[
def>out-form
]
map
"\n"
join
" ;\n"
append
]
2bi
]
}
cleave
]
""
append-outputs-as
;
USING:
accessors
classes
kernel
libclang
sequences
;
M:
object
def>out-form
class-of
name>>
"unknown object: "
prepend
;