ccgo

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

README

ccgo

Package ccgo translates cc ASTs to Go. (Work In Progress)

Installation

$ go get modernc.org/ccgo

Documentation: godoc.org/modernc.org/ccgo

Changelog

2018-07-01 This package is no longer maintained. Please see the v2 version at

https://modernc.org/ccgo/tree/master/v2

Documentation

Overview

Package ccgo translates cc ASTs to Go source code. (Work In Progress)

Changelog

2018-07-01 This package is no longer maintained. Please see the v2 version at

https://modernc.org/ccgo/v2

2018-04-10: This code no longer passes tests and soon it will not even build due to the upcoming changes in cznic/crt. For that reason the current crt master branch package is now included in this repository for the improbable case someone wants to make the code work again.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Testing amends things for tests.
	Testing bool
)

Functions

func New

func New(ast []*cc.TranslationUnit, out io.Writer, opts ...Option) (err error)

New writes Go code generated from ast to out. No package or import clause is generated.

func TODO

func TODO(msg string, more ...interface{}) string

TODO remove me.

Types

type Option

type Option func(*options) error

Option is a configuration/setup function that can be passed to the New function.

func LibcTypes

func LibcTypes() Option

LibcTypes makes code refering to libc types import them from the CRT package.

func Library

func Library() Option

Library selects the library linking mode, ie. the linkew will include all objects having external linkage.

func Packages

func Packages(qualifiers []string) Option

Packages annotate the translation units with a package qualifier. Items annotated with a package qualifier are not rendered and references to external definitions in such translation units are prefixed with the respective qualifier.

Directories

Path Synopsis
Package crt provides C-runtime services.
Package crt provides C-runtime services.
v2
Package ccgo translates C99 ASTs to Go source code.
Package ccgo translates C99 ASTs to Go source code.
ccgo
Command ccgo is a C compiler targeting Go.
Command ccgo is a C compiler targeting Go.
internal/object
Package object reads and writes object files.
Package object reads and writes object files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL