langspec

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package langspec provides PSL 3.0 language specification and EBNF grammar.

Index

Constants

View Source
const EBNF = `` /* 2430-byte string literal not displayed */

EBNF is the formal grammar of PSL 3.0 in EBNF notation.

View Source
const Version = "3.0"

Version is the PSL language specification version.

Variables

View Source
var SemanticRules = []string{
	"Protocol names must be unique within a library",
	"Field names must be unique within a protocol",
	"Bitfield groups must sum to a multiple of 8 bits",
	"Checksum covers fields must reference existing fields",
	"Length references must point to integer fields",
	"Condition fields must reference previously defined fields",
	"Enum values must be unique within a field",
	"Type aliases must reference valid base types",
	"Import paths must resolve to valid PSL files",
	"Extends must reference a registered protocol",
}

SemanticRules documents the semantic rules of PSL 3.0.

View Source
var TypeSystem = map[string]string{
	"uint<N>":   "Unsigned integer of N bits (1-64)",
	"int<N>":    "Signed integer of N bits (1-64)",
	"bytes":     "Variable-length byte sequence",
	"bytes[N]":  "Fixed-length byte sequence of N bytes",
	"string":    "UTF-8 encoded string",
	"string[N]": "Fixed-length string of N bytes",
	"bool":      "Boolean value (1 bit)",
}

TypeSystem documents the PSL 3.0 type system.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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