cpp

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package cpp contains the C++ code generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallbackName

func CallbackName(cha string) string

CallbackName gets the name of the callback for the channel with name cha.

func ChannelMsgType

func ChannelMsgType(cha string) string

ChannelMsgType gets the name of the defined message type for the channel with name cha. This is usually a pointer to the value type.

func ChannelValueType

func ChannelValueType(cha string) string

ChannelValueType gets the name of the defined message type for the channel with name cha. This is usually a pointer to the value type.

func ConvertFrom

func ConvertFrom(cha string) string

ConvertFrom gets the from-conversion function name for channel with name cha.

func ConvertTo

func ConvertTo(cha string) string

ConvertTo gets the to-conversion function name for the channel with name cha.

func EnumField

func EnumField(variant any) string

EnumField massages variant to become suitable as an enum field name.

func Funcs

func Funcs() template.FuncMap

Funcs gets the C++ function map.

func OutcomeEnum

func OutcomeEnum(outcome testlang.Outcome) string

OutcomeEnum gets a reference to the enum member for outcome.

func StateEntry

func StateEntry(id testlang.NodeID) string

StateEntry gets the name of the entry method for the state with the given id.

func StateEnum

func StateEnum(id testlang.NodeID) string

StateEnum gets a reference to the enum member for the state with the given id.

func StdType

func StdType(rsType rstype.RsType) string

StdType gets the standard C++ type for the given RoboStar type.

func TestEnum

func TestEnum(name string) string

TestEnum gets a reference to the enum member for the test called name.

func Value

func Value(val value.Value) string

Value gets a C++ encoding of a value.

Types

type Context

type Context struct {
	gencommon.Context

	Cpp
}

Context is the context passed into the C++ code generator.

func NewContext

func NewContext(name string, machine *stm.Stm, cctx cfg.Context) *Context

NewContext creates a new template context from a named state machine.

type Cpp added in v0.1.1

type Cpp cfg.Context

Cpp renames cfg.Context to avoid duplication.

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator is a C++ code generator.

func New

func New(config *cfg.Config, dirs gencommon.DirSet) (*Generator, error)

New constructs a new C++ code generator from config, rooted at the given directories.

func (*Generator) Name

func (g *Generator) Name() string

func (*Generator) OnSuite added in v0.1.1

func (g *Generator) OnSuite(suite *stm.Suite) subgen.OnSuite

type OnSuite added in v0.1.1

type OnSuite struct {
	// contains filtered or unexported fields
}

func (*OnSuite) Dirs added in v0.1.1

func (o *OnSuite) Dirs() []string

func (*OnSuite) Generate added in v0.1.1

func (o *OnSuite) Generate() error

func (*OnSuite) Parent added in v0.1.1

func (o *OnSuite) Parent() subgen.Subgenerator

Jump to

Keyboard shortcuts

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