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