oncrpcgen

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

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

Go to latest
Published: Dec 8, 2019 License: ISC Imports: 16 Imported by: 0

README

ONC RPC/XDR Schema Compiler

oncrpcgen compiles XDR schemas, as defined in RFC 4506 and extended in RFC 5531, into a collection of formats:

  • A binary format (itself defined in XDR) which can be used to implement new compiler backends with relative eas
  • A JSON format derived from the above schema (this can also be used for the same purpose, but primarily exists to help inspect the output of the compiler)
  • Go code

This should not yet be considered well tested: this is an early stage project. That said, it is useful with many XDR schemas.

This implementation stick fairly close to the specifications, though does make some minor non-standard additions:

  • Attributes can be added to definitions by prefixing them with an attribute set. Attribute sets are wrapped in square brackets and formatted as [a, b, c("string param"), d(1 /* int param)]. They take the form of a key-value map
  • Attributes can be added to the specification itself by ensuring that the first non-comment entry in the file is an attribute set preceded by a hash, i.e. #[foo("bar")]

Some common attributes are defined:

  • doc: A documentation comment for the associated item
  • mode: Specifies a non-standard generation mode for a declaration. Currently the only defined mode is "map", which when used on a flexible array declaration where the type has two members, will cause a map to be generated in the resulting code
  • go_package: Defines what package name to use when generating Go code

Documentation

Overview

Casefolding stolen from protoc-gen-go and subtly modified to add '.' support

Copyright 2010 The Go Authors. All rights reserved. https://github.com/golang/protobuf

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright

notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above

copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of Google Inc. nor the names of its

contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Directories

Path Synopsis
XDR Abstract Syntax Tree definition - a binary interchange format for XDR specifications
XDR Abstract Syntax Tree definition - a binary interchange format for XDR specifications

Jump to

Keyboard shortcuts

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