diff options
author | Keith Zantow <kzantow@gmail.com> | 2022-10-07 15:29:25 -0400 |
---|---|---|
committer | Keith Zantow <kzantow@gmail.com> | 2022-10-07 15:29:25 -0400 |
commit | be2eb824595afe28c87c9a33c2da565480d1eb54 (patch) | |
tree | 243550f594ace0770760900f8e4747487d672b01 /tvloader/parser2v3/types.go | |
parent | 066a798c363d64d11c5831c11c0aff4ce3eb286e (diff) | |
download | spdx-tools-be2eb824595afe28c87c9a33c2da565480d1eb54.tar.gz |
chore: add tag value reader and parser for v2.3
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Diffstat (limited to 'tvloader/parser2v3/types.go')
-rw-r--r-- | tvloader/parser2v3/types.go | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tvloader/parser2v3/types.go b/tvloader/parser2v3/types.go new file mode 100644 index 0000000..b6dc3ab --- /dev/null +++ b/tvloader/parser2v3/types.go @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later + +package parser2v3 + +import ( + "github.com/spdx/tools-golang/spdx/common" + "github.com/spdx/tools-golang/spdx/v2_3" +) + +type tvParser2_3 struct { + // document into which data is being parsed + doc *v2_3.Document + + // current parser state + st tvParserState2_3 + + // current SPDX item being filled in, if any + pkg *v2_3.Package + pkgExtRef *v2_3.PackageExternalReference + file *v2_3.File + fileAOP *v2_3.ArtifactOfProject + snippet *v2_3.Snippet + otherLic *v2_3.OtherLicense + rln *v2_3.Relationship + ann *v2_3.Annotation + rev *v2_3.Review + // don't need creation info pointer b/c only one, + // and we can get to it via doc.CreationInfo +} + +// parser state (SPDX document version 2.3) +type tvParserState2_3 int + +const ( + // at beginning of document + psStart2_3 tvParserState2_3 = iota + + // in document creation info section + psCreationInfo2_3 + + // in package data section + psPackage2_3 + + // in file data section (including "unpackaged" files) + psFile2_3 + + // in snippet data section (including "unpackaged" files) + psSnippet2_3 + + // in other license section + psOtherLicense2_3 + + // in review section + psReview2_3 +) + +const nullSpdxElementId2_3 = common.ElementID("") |