grammar

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Document = op.Capture{
		Name: "Document",
		Value: op.ZeroOrMore{Value: op.And{
			nt.OWhitespace,
			op.Or{
				ttl.Directive,
				Block,
				op.And{op.Optional{Value: nt.Comment}, op.EndOfLine{}},
			},
		}},
	}
	Block = op.Capture{
		Name: "Block",
		Value: op.Or{
			TriplesOrGraph,
			WrappedGraph,
			Triples,
			op.Capture{
				Name:  "Graph",
				Value: op.And{"GRAPH", nt.Whitespace, LabelOrSubject, ttl.WSPLNC, WrappedGraph},
			},
		},
	}
	TriplesOrGraph = op.Capture{
		Name: "TriplesOrGraph",
		Value: op.And{
			LabelOrSubject, ttl.WSPLNC,
			op.Or{
				WrappedGraph,
				op.And{ttl.PredicateObjectList, ttl.WSPLNC, '.'},
			},
		},
	}
	Triples = op.Capture{
		Name: "Triples2",
		Value: op.Or{
			op.Capture{
				Name: "Triples2BlankNodePropertyList",
				Value: op.And{
					ttl.BlankNodePropertyList,
					op.Optional{Value: op.And{ttl.WSPLNC, ttl.PredicateObjectList}},
					ttl.WSPLNC, '.',
				},
			},
			op.Capture{
				Name: "Triples2Collection",
				Value: op.And{
					ttl.Collection,
					ttl.WSPLNC,
					ttl.PredicateObjectList,
					ttl.WSPLNC, '.',
				},
			},
		},
	}
	WrappedGraph = op.Capture{
		Name: "WrappedGraph",
		Value: op.And{
			'{', ttl.WSPLNC, op.Optional{Value: op.And{TriplesBlock, ttl.WSPLNC}}, '}',
		},
	}
	TriplesBlock = op.Capture{
		Name: "TriplesBlock",
		Value: op.And{
			ttl.Triples,
			op.Optional{Value: op.And{
				ttl.WSPLNC, '.',
				op.Optional{Value: op.And{ttl.WSPLNC, op.Reference{Name: "TriplesBlock"}}},
			}},
		},
	}
	LabelOrSubject = op.Capture{
		Name: "LabelOrSubject",
		Value: op.Or{
			ttl.IRI, ttl.BlankNode,
		},
	}
)

Functions

func NewParser

func NewParser(input []rune) (*parser.Parser, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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