Skip to content

Commit

Permalink
Added OpenName.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Aug 18, 2021
1 parent a51d0df commit 9907732
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions pyVHDLModel/SyntaxModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ class Name:

def __init__(self, identifier: str, prefix: 'Name' = None):
self._identifier = identifier
self._prefix = prefix
self._root = prefix._root
if prefix is None:
self._prefix = self
self._root = None
else:
self._prefix = prefix
self._root = prefix._root

@property
def Identifier(self) -> str:
Expand All @@ -133,25 +137,8 @@ def Has_Prefix(self) -> bool:

@export
class SimpleName(Name):
def __init__(self, identifier: str):
self._name = identifier
self._root = self
self._prefix = None

@property
def Root(self) -> 'Name':
return self

@property
def Prefix(self) -> Nullable['Name']:
return None

@property
def Has_Prefix(self) -> bool:
return False

def __str__(self):
return self._name
return self._identifier


@export
Expand Down Expand Up @@ -211,6 +198,15 @@ def __str__(self):
return str(self._prefix) + "." + "all"


@export
class OpenName(Name):
def __init__(self):
super().__init__("open")

def __str__(self):
return "open"


@export
class Symbol(ModelEntity):
_symbolName: Name
Expand Down

0 comments on commit 9907732

Please sign in to comment.