github.com/jingcheng-WU/gonum@v0.9.1-0.20210323123734-f1a2a11a8f7b/graph/formats/rdf/extract.rl (about)

     1  // Go code generated by go generate github.com/jingcheng-WU/gonum/graph/formats/rdf; DO NOT EDIT.
     2  
     3  // Copyright ©2020 The Gonum Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package rdf
     8  
     9  import (
    10  	"fmt"
    11  	"unicode"
    12  )
    13  
    14  %%{
    15  	machine extract;
    16  
    17  	include extract "extract_actions.rl";
    18  
    19  	include nquads "nquads.rl";
    20  
    21  	value := (
    22  	           IRIREF
    23  	         | '_:' BLANK_NODE_LABEL >StartBlank %EndBlank
    24  	         | '"' STRING_LITERAL >StartLiteral %EndLiteral '"' ( '^^' IRIREF | LANGTAG >StartLang %EndLang )?
    25  	         ) %Return @!Error ;
    26  
    27  	write data;
    28  }%%
    29  
    30  func extract(data []rune) (text, qual string, kind Kind, err error) {
    31  	var (
    32  		cs, p int
    33  		pe    = len(data)
    34  		eof   = pe
    35  
    36  		iri     = -1
    37  		blank   = -1
    38  		literal = -1
    39  		lang    = -1
    40  
    41  		iriText     string
    42  		blankText   string
    43  		literalText string
    44  		langText    string
    45  	)
    46  
    47  	%%write init;
    48  
    49  	%%write exec;
    50  
    51  	return "", "", 0, ErrInvalidTerm
    52  }