Kingsland.MofParser
Kingsland.MofParser copied to clipboard
A C# library for parsing the contents of Managed Object Format (MOF) files
There's a bunch of changes to the nuspce file format that need to be updated - e.g. project url / repo url, license, copyright.
Parsing currently results in a semantic AST model that represents the source MOF text, but that's not always very easy to work with if you just want to know, e.g....
Move the general lexing and parsing code into a separate project so it's easier to see what's, for example IO mechanics versus what's specific to the MOF syntax.
The section "7.6.3 Enum type value" of the [MOF spec 3.0.1](https://www.dmtf.org/sites/default/files/standards/documents/DSP0221_3.0.1.pdf) defines a syntax element "enumValueArray" as follows: **7.6.3 Enum type value** ```text 941 enumTypeValue = enumValue / enumValueArray 942...
The [MOF Spec 3.0.0](https://www.dmtf.org/sites/default/files/standards/documents/DSP0221_3.0.0.pdf) defines a rule for **complexValue** as follows: **A.1 Value definitions** ```text complexValue = ( INSTANCE / VALUE ) OF ( structureName / className / associationName )...
In section "D.5 GOLF_Professional" of the [MOF Spec 3.0.1](https://www.dmtf.org/sites/default/files/standards/documents/DSP0221_3.0.1.pdf) there's an example class with a number of propertyDeclarations and methodDeclaration: ```text class GOLF_Professional : GOLF_ClubMember { ... GOLF_ResultCodeEnum GetNumberOfProfessionals (...
The MOF 3.0.1 spec doesn't allow for empty qualifier value arrays like "{}" in this property from the "MSMCAEvent_InvalidError" class in WinXpProSp3WMI.mof: ```text [WmiDataId(3), ValueMap{}] uint32 Type; ``` The MOF...
At present, the parser removes all WhitespaceToken and CommentToken elements from the input stream before processing the syntax rules. ```csharp // remove all comments and whitespace var tokens = lexerTokens.Where(lt...