Documentation ¶
Overview ¶
Read Prolog terms. Typical usage is like
terms, err := read.TermAll(`some(prolog,term). another(one).`)
Functions with a trailing underscore panic on error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NoMoreTerms = fmt.Errorf("No more terms available")
NoMoreTerms is returned by Next() when it can read no more terms from its source.
Functions ¶
func Term ¶
Term reads a single term from a term source. A term source can be any of the following:
- type that implements io.Reader
- string
Reading a term may consume more content from the source than is strictly necessary.
Types ¶
type TermReader ¶
type TermReader struct {
// contains filtered or unexported fields
}
func NewTermReader ¶
func NewTermReader(src interface{}) (*TermReader, error)
func (*TermReader) Next ¶
func (r *TermReader) Next() (term.Term, error)
Next returns the next term available from this reader. Returns error NoMoreTerms if the reader can't find any more terms.
func (*TermReader) Op ¶
func (r *TermReader) Op(p priority, s specifier, os ...string)
Op creates or changes the parsing behavior of a Prolog operator. It's equivalent to op/3
func (*TermReader) ResetOperatorTable ¶
func (r *TermReader) ResetOperatorTable()
ResetOperatorTable replaces the reader's current operator table with the default table specified in ISO Prolog §6.3.4.4, table 7