Skip to content

Dec parser

dec_parser

Code to help parse DEC files.

LibraryClassDeclarationEntry

Object representing a Library Class Declaration Entry.

__init__

__init__(
    packagename: str, rawtext: str = None
) -> LibraryClassDeclarationEntry

Init a library Class Declaration Entry.

GuidedDeclarationEntry

A baseclass for declaration types that have a name and guid.

Attributes:

Name Type Description
name str

name

guidstring str

guid

guid UUID

guid

package_name str

packagename

__init__

__init__(
    packagename: str, rawtext: str = None
) -> GuidedDeclarationEntry

Init a protocol/Ppi/or Guid declaration entry.

ProtocolDeclarationEntry

Object representing a Protocol Declaration Entry.

__init__

__init__(
    packagename: str, rawtext: str = None
) -> ProtocolDeclarationEntry

Init a protocol declaration entry.

PpiDeclarationEntry

Object representing a Ppi Declaration Entry.

__init__

__init__(
    packagename: str, rawtext: str = None
) -> GuidedDeclarationEntry

Init a Ppi declaration entry.

GuidDeclarationEntry

Object representing a Guid Declaration Entry.

__init__

__init__(
    packagename: str, rawtext: str = None
) -> GuidDeclarationEntry

Init a Ppi declaration entry.

PcdDeclarationEntry

Object representing a Pcd Delcaration Entry.

Attributes:

Name Type Description
token_space_name str

token space name

name str

name

default_value str

value

type str

type

id str

id

package_name

package name

__init__

__init__(
    packagename: str, rawtext: str = None
) -> PcdDeclarationEntry

Creates a PCD Declaration Entry for one PCD.

DecParser

Parses an EDK2 DEC file.

Attributes:

Name Type Description
Parsed bool

If a DEC file has been parsed or not

Lines list

order list of lines in the Dec file

Dict dict

Dict of variables set in the DEC file

LibraryClasses list

list of Library classes

PPIs list

list of PPIs

Protocols list

list of Protocols

Guids list

list of Guids

Pcds list

list of Pcds

IncludePaths list

list of IncludePaths

PackageName str

Package Name variable also found in Dict

Path str

path to the DEC file

__init__

__init__() -> DecParser

Init an empty Dec Parser.

ParseStream

ParseStream(stream: IO) -> None

Parse the supplied IO as a DEC file.

Parameters:

Name Type Description Default
stream IOBase

a file-like/stream object in which DEC file contents can be read

required

ParseFile

ParseFile(filepath: str) -> None

Parse the supplied file.

Parameters:

Name Type Description Default
filepath str

path to dec file to parse. Can be either an absolute path or relative to your CWD

required