Skip to content

Commit

Permalink
Removed more unnused code
Browse files Browse the repository at this point in the history
  • Loading branch information
kraigher committed Jul 16, 2015
1 parent c8b7e60 commit f2c96d2
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions vunit/vhdl_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,46 +497,6 @@ def __str__(self):
return self.code


class VHDLConstantDeclaration(object):
"""
Represents a constant declaration
"""
def __init__(self, identifier, subtype_indication, expression):
self.identifier = identifier
self.subtype_indication = subtype_indication
self.expression = expression

@classmethod
def parse(cls, code):
"""
Returns a new instance from parsing the code
"""
# Extract identifier
re_flags = re.MULTILINE | re.IGNORECASE | re.VERBOSE
constant_start = re.compile(r"""
^ # Beginning of line
[\s]* # Potential whitespaces
constant # constant keyword
\s+ # At least one whitespace
(?P<id>[a-zA-Z][\w]*) # An identifier
[\s]* # Potential whitespaces
: # Colon
""", re_flags)
constant_declaration = constant_start.match(code)
identifier = constant_declaration.group('id')

# Extract subtype indication
sub_code = code[constant_declaration.end():]
expression_start = sub_code.find(':=')
subtype_indication = VHDLSubtypeIndication.parse(sub_code[:expression_start].strip())

# Extract expression
sub_code = sub_code[expression_start + 2:]
expression_end = sub_code.find(';')
expression = sub_code[: expression_end].strip()
return cls(identifier, subtype_indication, expression)


class VHDLInterfaceElement(object):
"""
Represents a VHDL interface element
Expand Down

0 comments on commit f2c96d2

Please sign in to comment.