diff --git a/src/generator/context.jl b/src/generator/context.jl index 17c58e5b..06cb232f 100644 --- a/src/generator/context.jl +++ b/src/generator/context.jl @@ -90,6 +90,11 @@ function create_context(headers::Vector, args::Vector=String[], options::Dict=Di @info "Parsing headers..." parse_headers!(ctx, headers, args) + add_default_passes!(ctx, options, system_dirs, dependent_headers) +end + +function add_default_passes!(ctx::AbstractContext, options::Dict, system_dirs::Vector, dependent_headers::Vector) + push!(ctx.passes, CollectTopLevelNode(ctx.trans_units, dependent_headers, system_dirs)) push!(ctx.passes, LinkTypedefToAnonymousTagType()) push!(ctx.passes, LinkTypedefToAnonymousTagType(is_system=true)) diff --git a/src/generator/top_level.jl b/src/generator/top_level.jl index 9a16bcb5..3109c309 100644 --- a/src/generator/top_level.jl +++ b/src/generator/top_level.jl @@ -159,6 +159,23 @@ function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLEnumDecl, o return nodes end +# TODO: Implement full ObjectiveC codegen +function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLObjCClassRef, options) + return nodes +end +function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLObjCProtocolDecl, options) + return nodes +end +function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLObjCProtocolRef, options) + return nodes +end +function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLObjCInterfaceDecl, options) + return nodes +end +function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLObjCCategoryDecl, options) + return nodes +end + # skip macro expansion since the expanded info is already embedded in the AST collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLMacroInstantiation, options) = nodes collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLMacroExpansion, options) = nodes diff --git a/src/generator/types.jl b/src/generator/types.jl index 6d2a6011..afd33b2e 100644 --- a/src/generator/types.jl +++ b/src/generator/types.jl @@ -147,7 +147,7 @@ struct EnumDuplicated <: AbstractEnumNodeType end struct EnumDefault <: AbstractEnumNodeType end """ - EnumLayout{Attribute} <: AbstractStructNodeType + EnumLayout{Attribute} <: AbstractEnumNodeType Enum nodes that have special layout. """ struct EnumLayout{Attribute} <: AbstractEnumNodeType end