idlc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSkel

func GenerateSkel(mod *ModuleNode, pkgName string) string

GenerateSkel generates server skeleton code for all interfaces.

func GenerateStub

func GenerateStub(mod *ModuleNode, pkgName string) string

GenerateStub generates client stub code for all interfaces.

func GenerateTypes

func GenerateTypes(mod *ModuleNode, pkgName string) string

GenerateTypes generates type definitions, enums, structs, unions, exceptions, and interface definitions (without stub/skeleton implementations).

Types

type ASTNode

type ASTNode interface{}

type EnumNode

type EnumNode struct {
	Name   string
	Values []string
}

type ExceptionNode

type ExceptionNode struct {
	Name   string
	Fields []*FieldNode
}

type FieldNode

type FieldNode struct {
	Type string
	Name string
}

type GenContext

type GenContext struct {
	ModName    string
	Structs    map[string]*StructNode
	Typedefs   map[string]*TypedefNode
	Enums      map[string]*EnumNode
	Unions     map[string]*UnionNode
	Exceptions map[string]*ExceptionNode
}

type InterfaceNode

type InterfaceNode struct {
	Name       string
	Operations []*OperationNode
}

type Lexer

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

func NewLexer

func NewLexer(input string) *Lexer

func (*Lexer) NextToken

func (l *Lexer) NextToken() Token

type ModuleNode

type ModuleNode struct {
	Name       string
	Typedefs   []*TypedefNode
	Enums      []*EnumNode
	Unions     []*UnionNode
	Exceptions []*ExceptionNode
	Structs    []*StructNode
	Interfaces []*InterfaceNode
}

type OperationNode

type OperationNode struct {
	Name       string
	ReturnType string
	Parameters []*ParameterNode
}

type ParameterNode

type ParameterNode struct {
	Direction string // "in", "out", "inout"
	Type      string
	Name      string
}

type Parser

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

func NewParser

func NewParser(lexer *Lexer) *Parser

func (*Parser) Parse

func (p *Parser) Parse() (*ModuleNode, error)

type StructNode

type StructNode struct {
	Name   string
	Fields []*FieldNode
}

type Token

type Token struct {
	Type  TokenType
	Value string
}

type TokenType

type TokenType int
const (
	TokenEOF TokenType = iota
	TokenIdent
	TokenModule
	TokenStruct
	TokenTypedef
	TokenEnum
	TokenUnion
	TokenSwitch
	TokenCase
	TokenDefault
	TokenException
	TokenRaises
	TokenObject
	TokenVoid
	TokenInterface
	TokenIn
	TokenOut
	TokenInout
	TokenSequence
	TokenAny
	TokenOctet
	TokenLBrace // {
	TokenRBrace // }
	TokenLParen // (
	TokenRParen // )
	TokenLAngle // <
	TokenRAngle // >
	TokenSemi   // ;
	TokenComma  // ,
	TokenColon  // :
)

type TypedefNode

type TypedefNode struct {
	Type string
	Name string
}

type UnionCaseNode

type UnionCaseNode struct {
	IsDefault bool
	Labels    []string // e.g. "1", "2", "TRUE"
	Type      string
	Name      string
}

type UnionNode

type UnionNode struct {
	Name       string
	SwitchType string
	Cases      []*UnionCaseNode
}

Jump to

Keyboard shortcuts

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