Documentation
¶
Index ¶
Constants ¶
const ( UNA_SEGMENT_NAME = "UNA" UNA_COMPONENT_DELIMITER = ':' UNA_DATA_DELIMITER = '+' UNA_DECIMAL = '.' UNA_RELEASE_INDICATOR = '?' UNA_REPETITION_DELIMITER = ' ' // This is really "reserved" in the spec. UNA_SEGMENT_TERMINATOR = '\'' )
default values for the UNA segment. if no una segment is specified, then these are used
const ( COMPONENT_DELIMITER_POS = iota DATA_DELIMITER_POS DECIMAL_POS RELEASE_INDICATOR_POS REPETITION_DELIMITER_POS SEGMENT_TERMINATOR_POS )
Variables ¶
var ( // our reduce table REDUCETABLE = map[NodeType]map[token.TokenType]reduceFunc{ NodeText: map[token.TokenType]reduceFunc{ token.COMPONENT_DELIMITER: reduceTextComponent, token.REPETITION_DELIMITER: reduceTextRepetition, token.DATA_DELIMITER: reduceTextData, }, NodeComponent: map[token.TokenType]reduceFunc{ token.TEXT: reduceComponentText, token.DATA_DELIMITER: reduceComponentData, token.REPETITION_DELIMITER: reduceComponentRepetition, }, NodeRepetition: map[token.TokenType]reduceFunc{ token.TEXT: reduceRepetitionText, token.DATA_DELIMITER: reduceRepetitionData, token.COMPONENT_DELIMITER: reduceRepetitionComponent, token.REPETITION_DELIMITER: reduceRepetitionRepetition, }, } )
Functions ¶
This section is empty.
Types ¶
type ComponentNode ¶
ComponentNode holds a list of nodes that are components of one another. Like a person's first and last name can be components.
func (*ComponentNode) String ¶
func (c *ComponentNode) String() string
type HeaderNode ¶
A header node holds the UNA header and the configuration text.
func (*HeaderNode) String ¶
func (h *HeaderNode) String() string
type ListNode ¶
ListNode holds a sequence of nodes.
func (*ListNode) StringDelim ¶
Prints out the nodes with a delimiter.
type Node ¶
A Node is an element in the parse tree. The interface is trivial. The interface contains an unexported method so that only types local to this package can satisfy it.
type RepetitionNode ¶
RepetitionNode holds a list of nodes that are repetitions. For example, a start and end date could be repetitions.
func (*RepetitionNode) String ¶
func (r *RepetitionNode) String() string
type SegmentNode ¶
SegmentNode holds a list of nodes (only DataNodes) that signify an entire segment. The segment name is specified in the first DataNode of the list.
func (*SegmentNode) String ¶
func (s *SegmentNode) String() string