xref: /aosp_15_r20/external/spdx-tools/tvloader/parser2v1/types.go (revision ba677afa8f67bb56cbc794f4d0e378e0da058e16)
1// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
2
3package parser2v1
4
5import (
6	"github.com/spdx/tools-golang/spdx/common"
7	"github.com/spdx/tools-golang/spdx/v2_1"
8)
9
10type tvParser2_1 struct {
11	// document into which data is being parsed
12	doc *v2_1.Document
13
14	// current parser state
15	st tvParserState2_1
16
17	// current SPDX item being filled in, if any
18	pkg       *v2_1.Package
19	pkgExtRef *v2_1.PackageExternalReference
20	file      *v2_1.File
21	fileAOP   *v2_1.ArtifactOfProject
22	snippet   *v2_1.Snippet
23	otherLic  *v2_1.OtherLicense
24	rln       *v2_1.Relationship
25	ann       *v2_1.Annotation
26	rev       *v2_1.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.1)
32type tvParserState2_1 int
33
34const (
35	// at beginning of document
36	psStart2_1 tvParserState2_1 = iota
37
38	// in document creation info section
39	psCreationInfo2_1
40
41	// in package data section
42	psPackage2_1
43
44	// in file data section (including "unpackaged" files)
45	psFile2_1
46
47	// in snippet data section (including "unpackaged" files)
48	psSnippet2_1
49
50	// in other license section
51	psOtherLicense2_1
52
53	// in review section
54	psReview2_1
55)
56
57const nullSpdxElementId2_1 = common.ElementID("")
58