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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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