Allow empty braces on sct vars and remove semicolons from python code
This commit is contained in:
@@ -365,9 +365,10 @@ def p_group_assignment(p):
|
|||||||
def p_variable(p):
|
def p_variable(p):
|
||||||
'''
|
'''
|
||||||
variable : VAR id_or_str EQUALS LBRACE variable_statement_list RBRACE
|
variable : VAR id_or_str EQUALS LBRACE variable_statement_list RBRACE
|
||||||
|
| VAR id_or_str EQUALS LBRACE RBRACE
|
||||||
| VAR id_or_str
|
| VAR id_or_str
|
||||||
'''
|
'''
|
||||||
if len(p) > 3:
|
if len(p) > 6:
|
||||||
p[0] = { 'Variable' : [{'name' : p[2]}] + p[5] }
|
p[0] = { 'Variable' : [{'name' : p[2]}] + p[5] }
|
||||||
else:
|
else:
|
||||||
p[0] = { 'Variable' : [{'name' : p[2]}] }
|
p[0] = { 'Variable' : [{'name' : p[2]}] }
|
||||||
@@ -680,8 +681,8 @@ def build_variable(MyDriver, p):
|
|||||||
if 'permlink' in MyVar:
|
if 'permlink' in MyVar:
|
||||||
device_type, node_type = MyVar['permlink'].split('.')
|
device_type, node_type = MyVar['permlink'].split('.')
|
||||||
if node_type not in MyDriver['Permlink']:
|
if node_type not in MyDriver['Permlink']:
|
||||||
MyDriver['Permlink'][node_type] = [];
|
MyDriver['Permlink'][node_type] = []
|
||||||
MyDriver['Permlink'][node_type] += [make_path(MyVar)];
|
MyDriver['Permlink'][node_type] += [make_path(MyVar)]
|
||||||
if Verbose:
|
if Verbose:
|
||||||
print '==>>MyVar:', MyVar
|
print '==>>MyVar:', MyVar
|
||||||
return MyVar
|
return MyVar
|
||||||
@@ -1478,23 +1479,23 @@ def put_standard_code(MyDriver):
|
|||||||
#if theFunc['reference_count'] == 0:
|
#if theFunc['reference_count'] == 0:
|
||||||
# continue
|
# continue
|
||||||
if theFunc['type'] == 'read_function':
|
if theFunc['type'] == 'read_function':
|
||||||
put_read_function(MyDriver, func);
|
put_read_function(MyDriver, func)
|
||||||
elif theFunc['type'] == 'write_function':
|
elif theFunc['type'] == 'write_function':
|
||||||
put_write_function(MyDriver, func);
|
put_write_function(MyDriver, func)
|
||||||
elif theFunc['type'] == 'fetch_function':
|
elif theFunc['type'] == 'fetch_function':
|
||||||
put_fetch_function(MyDriver, func);
|
put_fetch_function(MyDriver, func)
|
||||||
elif theFunc['type'] == 'check_function':
|
elif theFunc['type'] == 'check_function':
|
||||||
put_check_function(MyDriver, func);
|
put_check_function(MyDriver, func)
|
||||||
elif theFunc['type'] == 'checkrange_function':
|
elif theFunc['type'] == 'checkrange_function':
|
||||||
put_checkrange_function(MyDriver, func);
|
put_checkrange_function(MyDriver, func)
|
||||||
elif theFunc['type'] == 'checklimits_function':
|
elif theFunc['type'] == 'checklimits_function':
|
||||||
put_checklimits_function(MyDriver, func);
|
put_checklimits_function(MyDriver, func)
|
||||||
elif theFunc['type'] == 'checkstatus_function':
|
elif theFunc['type'] == 'checkstatus_function':
|
||||||
put_checkstatus_function(MyDriver, func);
|
put_checkstatus_function(MyDriver, func)
|
||||||
elif theFunc['type'] == 'halt_function':
|
elif theFunc['type'] == 'halt_function':
|
||||||
put_halt_function(MyDriver, func);
|
put_halt_function(MyDriver, func)
|
||||||
elif theFunc['type'] == 'pid_function':
|
elif theFunc['type'] == 'pid_function':
|
||||||
put_pid_function(MyDriver, func);
|
put_pid_function(MyDriver, func)
|
||||||
|
|
||||||
def generate_driver(MyDriver):
|
def generate_driver(MyDriver):
|
||||||
global NumberOfLinesOut
|
global NumberOfLinesOut
|
||||||
|
|||||||
Reference in New Issue
Block a user