parse

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SOLID_ARROW_STEM  ArrowStemType = iota
	DASHED_ARROW_STEM               = iota
	THICK_ARROW_STEM                = iota
)
View Source
const (
	SOLID_ARROW_HEAD        ArrowHeadType = iota
	OPEN_ARROW_HEAD                       = iota
	BARBED_ARROW_HEAD                     = iota
	LOWER_BARBED_ARROW_HEAD               = iota
)
View Source
const (
	ALT_SEGMENT               SegmentType = iota
	ALT_ELSE_SEGMENT                      = iota
	PAR_SEGMENT                           = iota
	PAR_ELSE_SEGMENT                      = iota
	OPT_SEGMENT                           = iota
	LOOP_SEGMENT                          = iota
	CONCURRENT_SEGMENT                    = iota
	CONCURRENT_WHILST_SEGMENT             = iota
	NONE_SEGMENT
)
View Source
const (
	LEFT_NOTE_ALIGNMENT  NoteAlignment = iota
	RIGHT_NOTE_ALIGNMENT               = iota
	OVER_NOTE_ALIGNMENT                = iota
)
View Source
const (
	SPACER_GAP GapType = iota
	EMPTY_GAP          = iota
	LINE_GAP           = iota
	FRAME_GAP          = iota
)
View Source
const ANGR = 57375
View Source
const BACKSLASHANGR = 57377
View Source
const COMMA = 57374
View Source
const DASH = 57370
View Source
const DOT = 57372
View Source
const DOUBLEANGR = 57376
View Source
const DOUBLEDASH = 57371
View Source
const EQUAL = 57373
View Source
const IDENT = 57383
View Source
const K_ALT = 57360
View Source
const K_BLOCK = 57359
View Source
const K_CONCURRENT = 57368
View Source
const K_ELSE = 57362
View Source
const K_ELSEALT = 57361
View Source
const K_ELSEPAR = 57367
View Source
const K_END = 57363
View Source
const K_FRAME = 57358
View Source
const K_GAP = 57356
View Source
const K_HORIZONTAL = 57354
View Source
const K_LEFT = 57350
View Source
const K_LINE = 57357
View Source
const K_LOOP = 57364
View Source
const K_NOTE = 57348
View Source
const K_OF = 57353
View Source
const K_OPT = 57365
View Source
const K_OVER = 57352
View Source
const K_PAR = 57366
View Source
const K_PARTICIPANT = 57347
View Source
const K_RIGHT = 57351
View Source
const K_SPACER = 57355
View Source
const K_STYLE = 57349
View Source
const K_TITLE = 57346
View Source
const K_WHILST = 57369
View Source
const MESSAGE = 57382
View Source
const PARL = 57379
View Source
const PARR = 57380
View Source
const SLASHANGR = 57378
View Source
const STRING = 57381

Variables

View Source
var DualRunes = map[string]int{
	".": DOT,
	",": COMMA,

	"--": DOUBLEDASH,
	"-":  DASH,
	"=":  EQUAL,

	">>":  DOUBLEANGR,
	">":   ANGR,
	"/>":  SLASHANGR,
	"\\>": BACKSLASHANGR,
}

Functions

This section is empty.

Types

type ActionNode

type ActionNode struct {
	From  ActorRef
	To    ActorRef
	Arrow ArrowType
	Descr string
}

An action node

type ActorNode

type ActorNode struct {
	// Identifier
	Ident string

	// Returns true if the actor has a separate description
	HasDescr bool

	// Description
	Descr string

	// Attributes
	Attributes *AttributeList
}

An actor declaration node

func (*ActorNode) ActorName

func (an *ActorNode) ActorName() string

Returns a suitable actor name. This can either be the description if HasDescr is true or the ident value if HasDescr is false.

type ActorRef

type ActorRef interface {
}

A reference to an actor

type ArrowHeadType

type ArrowHeadType int

type ArrowStemType

type ArrowStemType int

type ArrowType

type ArrowType struct {
	Stem ArrowStemType
	Head ArrowHeadType
}

type Attribute

type Attribute struct {
	Name  string
	Value string
}

Attributes

type AttributeList

type AttributeList struct {
	Head *Attribute
	Tail *AttributeList
}

type BlockNode

type BlockNode struct {
	Segments *BlockSegmentList
}

A block node. Each block can have one or more segments

type BlockSegment

type BlockSegment struct {
	Type          SegmentType
	Prefix        string
	Message       string
	AttributeList *AttributeList
	SubNodes      *NodeList
}

type BlockSegmentList

type BlockSegmentList struct {
	Head *BlockSegment
	Tail *BlockSegmentList
}

type GapNode

type GapNode struct {
	Type  GapType
	Descr string
}

type GapType

type GapType int

Gap node

type Node

type Node interface {
}

A type of declaration node

type NodeList

type NodeList struct {
	Head Node
	Tail *NodeList
}

A list of declaration node

func Parse

func Parse(reader io.Reader, filename string) (*NodeList, error)

type NormalActorRef

type NormalActorRef string

A reference to a normal actor

type NoteAlignment

type NoteAlignment int

Note node

type NoteNode

type NoteNode struct {
	Actor1 ActorRef
	Actor2 ActorRef // Can be nil

	Position NoteAlignment
	Descr    string
}

type ProcessInstructionNode

type ProcessInstructionNode struct {
	Prefix string
	Value  string
}

A processing instruction node

type PseudoActorRef

type PseudoActorRef string

A reference to a pseudo actor

type SegmentType

type SegmentType int

type StyleNode

type StyleNode struct {
	Name       string
	Attributes *AttributeList
}

A style declaration node

type TitleNode

type TitleNode struct {
	Title string
}

A title declaration node

Jump to

Keyboard shortcuts

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