Add wrapper_property and mkWrapper code for SCT wrappers
This commit is contained in:
@ -80,6 +80,7 @@ reserved = {
|
|||||||
'DEVICE' : 'DEVICE',
|
'DEVICE' : 'DEVICE',
|
||||||
'PROTOCOL' : 'PROTOCOL',
|
'PROTOCOL' : 'PROTOCOL',
|
||||||
'DRIVER_PROPERTY' : 'DRIVER_PROPERTY',
|
'DRIVER_PROPERTY' : 'DRIVER_PROPERTY',
|
||||||
|
'WRAPPER_PROPERTY' : 'WRAPPER_PROPERTY',
|
||||||
'CLASS' : 'CLASS',
|
'CLASS' : 'CLASS',
|
||||||
'SIMULATION_GROUP' : 'SIMULATION_GROUP',
|
'SIMULATION_GROUP' : 'SIMULATION_GROUP',
|
||||||
'DEBUG_THRESHOLD' : 'DEBUG_THRESHOLD',
|
'DEBUG_THRESHOLD' : 'DEBUG_THRESHOLD',
|
||||||
@ -303,6 +304,7 @@ def p_driver_statement(p):
|
|||||||
| group
|
| group
|
||||||
| code
|
| code
|
||||||
| driver_property
|
| driver_property
|
||||||
|
| wrapper_property
|
||||||
'''
|
'''
|
||||||
p[0] = p[1]
|
p[0] = p[1]
|
||||||
|
|
||||||
@ -446,6 +448,12 @@ def p_driver_property(p):
|
|||||||
'''
|
'''
|
||||||
p[0] = { 'DriverProperty' : ( p[2], p[4] ) }
|
p[0] = { 'DriverProperty' : ( p[2], p[4] ) }
|
||||||
|
|
||||||
|
def p_wrapper_property(p):
|
||||||
|
'''
|
||||||
|
wrapper_property : WRAPPER_PROPERTY id_or_str EQUALS value
|
||||||
|
'''
|
||||||
|
p[0] = { 'WrapperProperty' : ( p[2], p[4] ) }
|
||||||
|
|
||||||
def p_group_property(p):
|
def p_group_property(p):
|
||||||
'''
|
'''
|
||||||
group_property : GROUP_PROPERTY id_or_str EQUALS value
|
group_property : GROUP_PROPERTY id_or_str EQUALS value
|
||||||
@ -794,6 +802,11 @@ def build_driver(MyDriver, TheTree):
|
|||||||
MyDriver['DriverProperty'] = {}
|
MyDriver['DriverProperty'] = {}
|
||||||
MyDriver['DriverProperty'][item['DriverProperty'][0]] = item['DriverProperty'][1]
|
MyDriver['DriverProperty'][item['DriverProperty'][0]] = item['DriverProperty'][1]
|
||||||
continue
|
continue
|
||||||
|
if 'WrapperProperty' in item:
|
||||||
|
if 'WrapperProperty' not in MyDriver:
|
||||||
|
MyDriver['WrapperProperty'] = {}
|
||||||
|
MyDriver['WrapperProperty'][item['WrapperProperty'][0]] = item['WrapperProperty'][1]
|
||||||
|
continue
|
||||||
for key in item:
|
for key in item:
|
||||||
MyDriver[key] = item[key]
|
MyDriver[key] = item[key]
|
||||||
for item in MyDriver['Permlink']:
|
for item in MyDriver['Permlink']:
|
||||||
@ -1368,6 +1381,12 @@ def put_mkDriver(MyDriver):
|
|||||||
txt += [' set ns "[namespace current]"']
|
txt += [' set ns "[namespace current]"']
|
||||||
txt += [' set catch_status [ catch {']
|
txt += [' set catch_status [ catch {']
|
||||||
txt += ['']
|
txt += ['']
|
||||||
|
func = 'mkWrapper'
|
||||||
|
if func in MyDriver['Funcs']:
|
||||||
|
txt += ['# %s hook code starts' % func]
|
||||||
|
txt += MyDriver['Funcs'][func]['text']
|
||||||
|
txt += ['# %s hook code ends' % func]
|
||||||
|
else:
|
||||||
if len(MyDriver['Permlink']) > 0:
|
if len(MyDriver['Permlink']) > 0:
|
||||||
if 'make_args' in MyDriver and 'id' in MyDriver['make_args'].split():
|
if 'make_args' in MyDriver and 'id' in MyDriver['make_args'].split():
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user