c2gofmt

command module
v0.0.0-...-dd77f86 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

C2gofmt translates C syntax source files into Go syntax.

Usage:

c2gofmt [-v] [-w] [-r file] [file.c file.h ...]

C2gofmt translates the named C source files to Go syntax. It only operates syntactically: it does not type-check the C code nor the generated Go code. As a result, the generated Go code will almost certainly not compile. But it can serve well as the starting point for a manual translation, with c2gofmt having done much of the most tedious work.

The -v flag causes c2gofmt to print verbose output.

By default, c2gofmt writes the Go translation on standard output. The -w flag causes c2gofmt to write a Go file for each C input file, named by removing the .c suffix (if any) and adding .go.

The -r flag causes c2gofmt to read rewrite rules from the named file. In the file, blank lines or lines beginning with # are ignored. Other lines take the form “old -> new” and are interpreted the same as the patterns passed to “gofmt -r”.

Directories

Path Synopsis
internal
cc
Package cc implements parsing, type checking, and printing of C programs.
Package cc implements parsing, type checking, and printing of C programs.

Jump to

Keyboard shortcuts

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