-
Notifications
You must be signed in to change notification settings - Fork 1
Tag Value Lexer
Ahmed Hisham Ismail edited this page Jun 27, 2014
·
2 revisions
The class spdx.parsers.lexers.tagvalue.Lexer is responsible for converting a Tag/Value format SPDX file to a stream of tokens to be parsed. It has a token for every valid Tag.
The Lexer by default ignores all empty lines and lines starting with a # character.
It's implemented using ply.lex
-
reservedA list of keyword, it contains all of the valid tags in addition to the special valuesUNKNOWN,NOASSERTION,NONE,SOURCE,BINARY,OTHERandARCHIVE. -
statesa tuple of states for the lexer.
There are two states INITIAL which is the default initial state and text which is the state for recognizing free form text between <text> and </text> tags. The rules for the text state are exclusive to it.