• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
2
3package parser2v3
4
5import (
6	"github.com/spdx/tools-golang/spdx/common"
7	"github.com/spdx/tools-golang/spdx/v2_3"
8)
9
10type tvParser2_3 struct {
11	// document into which data is being parsed
12	doc *v2_3.Document
13
14	// current parser state
15	st tvParserState2_3
16
17	// current SPDX item being filled in, if any
18	pkg       *v2_3.Package
19	pkgExtRef *v2_3.PackageExternalReference
20	file      *v2_3.File
21	fileAOP   *v2_3.ArtifactOfProject
22	snippet   *v2_3.Snippet
23	otherLic  *v2_3.OtherLicense
24	rln       *v2_3.Relationship
25	ann       *v2_3.Annotation
26	rev       *v2_3.Review
27	// don't need creation info pointer b/c only one,
28	// and we can get to it via doc.CreationInfo
29}
30
31// parser state (SPDX document version 2.3)
32type tvParserState2_3 int
33
34const (
35	// at beginning of document
36	psStart2_3 tvParserState2_3 = iota
37
38	// in document creation info section
39	psCreationInfo2_3
40
41	// in package data section
42	psPackage2_3
43
44	// in file data section (including "unpackaged" files)
45	psFile2_3
46
47	// in snippet data section (including "unpackaged" files)
48	psSnippet2_3
49
50	// in other license section
51	psOtherLicense2_3
52
53	// in review section
54	psReview2_3
55)
56
57const nullSpdxElementId2_3 = common.ElementID("")
58