parser.py (9692:67d9da312ef0) | parser.py (9773:915be89faf30) |
---|---|
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 --- 244 unchanged lines hidden (view full) --- 253 "decl : INCLUDE STRING SEMI" 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 | 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 --- 244 unchanged lines hidden (view full) --- 253 "decl : INCLUDE STRING SEMI" 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__machine(self, p): 262 "decl : MACHINE '(' ident pairs ')' ':' params '{' decls '}'" | 261 def p_decl__machine0(self, p): 262 "decl : MACHINE '(' idents ')' ':' params '{' decls '}'" 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 ')' ':' params '{' decls '}'" |
263 p[0] = ast.MachineAST(self, p[3], p[4], p[7], p[9]) 264 265 def p_decl__action(self, p): 266 "decl : ACTION '(' ident pairs ')' statements" 267 p[0] = ast.ActionDeclAST(self, p[3], p[4], p[6]) 268 269 def p_decl__in_port(self, p): 270 "decl : IN_PORT '(' ident ',' type ',' var pairs ')' statements" --- 446 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" --- 446 unchanged lines hidden --- |