Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pysmi/lexer/smi.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ def tokens():
"lowcaseIdentifier": [],
"curlyBracesAroundEnterpriseInTrap": [],
"noCells": [],
"lowcaseTypeName": [],
}


Expand Down
1 change: 1 addition & 0 deletions pysmi/parser/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
lowcaseIdentifier=True,
curlyBracesAroundEnterpriseInTrap=True,
noCells=True,
lowcaseTypeName=True,
)

# Compatibility API
Expand Down
13 changes: 13 additions & 0 deletions pysmi/parser/smi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,17 @@ def p_CreationPart(self, p):
p[0] = (p[1], p[3])


# noinspection PyIncorrectDocstring
class LowcaseTypeName:
# tolerate lowercase type names in type declarations
@staticmethod
def p_typeName(self, p):
"""typeName : UPPERCASE_IDENTIFIER
| LOWERCASE_IDENTIFIER
| typeSMI"""
p[0] = p[1]


relaxedGrammar = {
"supportSmiV1Keywords": [
SupportSmiV1Keywords.p_importedKeyword,
Expand All @@ -1438,6 +1449,7 @@ def p_CreationPart(self, p):
CurlyBracesInEnterprises.p_EnterprisePart,
],
"noCells": [NoCells.p_CreationPart],
"lowcaseTypeName": [LowcaseTypeName.p_typeName],
}


Expand All @@ -1464,6 +1476,7 @@ def parserFactory(**grammarOptions):
* lowcaseIdentifier - tolerate lowercase MIB identifiers
* curlyBracesAroundEnterpriseInTrap - tolerate curly braces around enterprise ID in TRAP MACRO
* noCells - tolerate missing cells (XXX)
* lowcaseTypeName - tolerate lowercase type names in type declarations

Examples:

Expand Down