parser.py (11062:262d8494b253) parser.py (11282:afdcebd314be)
1# Copyright (c) 2009 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 245 unchanged lines hidden (view full) ---

254 dirname = os.path.dirname(self.current_source)
255 if os.path.exists(os.path.join(dirname, p[2])):
256 filename = os.path.join(dirname, p[2])
257 else:
258 filename = os.path.join(self.base_dir, p[2])
259 p[0] = self.parse_file(filename)
260
261 def p_decl__machine0(self, p):
1# Copyright (c) 2009 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 245 unchanged lines hidden (view full) ---

254 dirname = os.path.dirname(self.current_source)
255 if os.path.exists(os.path.join(dirname, p[2])):
256 filename = os.path.join(dirname, p[2])
257 else:
258 filename = os.path.join(self.base_dir, p[2])
259 p[0] = self.parse_file(filename)
260
261 def p_decl__machine0(self, p):
262 "decl : MACHINE '(' idents ')' ':' obj_decls '{' decls '}'"
262 "decl : MACHINE '(' ident ')' ':' obj_decls '{' decls '}'"
263 p[0] = ast.MachineAST(self, p[3], [], p[7], p[9])
264
265 def p_decl__machine1(self, p):
263 p[0] = ast.MachineAST(self, p[3], [], p[7], p[9])
264
265 def p_decl__machine1(self, p):
266 "decl : MACHINE '(' idents pairs ')' ':' obj_decls '{' decls '}'"
266 "decl : MACHINE '(' ident pairs ')' ':' obj_decls '{' decls '}'"
267 p[0] = ast.MachineAST(self, p[3], p[4], p[7], p[9])
268
269 def p_decl__action(self, p):
270 "decl : ACTION '(' ident pairs ')' statements"
271 p[0] = ast.ActionDeclAST(self, p[3], p[4], p[6])
272
273 def p_decl__in_port(self, p):
274 "decl : IN_PORT '(' ident ',' type ',' var pairs ')' statements"

--- 474 unchanged lines hidden ---
267 p[0] = ast.MachineAST(self, p[3], p[4], p[7], p[9])
268
269 def p_decl__action(self, p):
270 "decl : ACTION '(' ident pairs ')' statements"
271 p[0] = ast.ActionDeclAST(self, p[3], p[4], p[6])
272
273 def p_decl__in_port(self, p):
274 "decl : IN_PORT '(' ident ',' type ',' var pairs ')' statements"

--- 474 unchanged lines hidden ---