parser.py (10308:8c0870dbae5c) | parser.py (10964:2b4fe083d17b) |
---|---|
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 --- 264 unchanged lines hidden (view full) --- 273 "decl : IN_PORT '(' ident ',' type ',' var pairs ')' statements" 274 p[0] = ast.InPortDeclAST(self, p[3], p[5], p[7], p[8], p[10]) 275 276 def p_decl__out_port(self, p): 277 "decl : OUT_PORT '(' ident ',' type ',' var pairs ')' SEMI" 278 p[0] = ast.OutPortDeclAST(self, p[3], p[5], p[7], p[8]) 279 280 def p_decl__trans0(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 --- 264 unchanged lines hidden (view full) --- 273 "decl : IN_PORT '(' ident ',' type ',' var pairs ')' statements" 274 p[0] = ast.InPortDeclAST(self, p[3], p[5], p[7], p[8], p[10]) 275 276 def p_decl__out_port(self, p): 277 "decl : OUT_PORT '(' ident ',' type ',' var pairs ')' SEMI" 278 p[0] = ast.OutPortDeclAST(self, p[3], p[5], p[7], p[8]) 279 280 def p_decl__trans0(self, p): |
281 "decl : TRANS '(' idents ',' idents ',' ident ')' idents" | 281 "decl : TRANS '(' idents ',' idents ',' ident_or_star ')' idents" |
282 p[0] = ast.TransitionDeclAST(self, [], p[3], p[5], p[7], p[9]) 283 284 def p_decl__trans1(self, p): 285 "decl : TRANS '(' idents ',' idents ')' idents" 286 p[0] = ast.TransitionDeclAST(self, [], p[3], p[5], None, p[7]) 287 288 def p_decl__trans2(self, p): | 282 p[0] = ast.TransitionDeclAST(self, [], p[3], p[5], p[7], p[9]) 283 284 def p_decl__trans1(self, p): 285 "decl : TRANS '(' idents ',' idents ')' idents" 286 p[0] = ast.TransitionDeclAST(self, [], p[3], p[5], None, p[7]) 287 288 def p_decl__trans2(self, p): |
289 "decl : TRANS '(' idents ',' idents ',' ident ')' idents idents" | 289 "decl : TRANS '(' idents ',' idents ',' ident_or_star ')' idents idents" |
290 p[0] = ast.TransitionDeclAST(self, p[9], p[3], p[5], p[7], p[10]) 291 292 def p_decl__trans3(self, p): 293 "decl : TRANS '(' idents ',' idents ')' idents idents" 294 p[0] = ast.TransitionDeclAST(self, p[7], p[3], p[5], None, p[8]) 295 296 def p_decl__extern0(self, p): 297 "decl : EXTERN_TYPE '(' type pairs ')' SEMI" --- 203 unchanged lines hidden (view full) --- 501 def p_identx__single(self, p): 502 "identx : empty" 503 p[0] = [ ] 504 505 def p_ident(self, p): 506 "ident : IDENT" 507 p[0] = p[1] 508 | 290 p[0] = ast.TransitionDeclAST(self, p[9], p[3], p[5], p[7], p[10]) 291 292 def p_decl__trans3(self, p): 293 "decl : TRANS '(' idents ',' idents ')' idents idents" 294 p[0] = ast.TransitionDeclAST(self, p[7], p[3], p[5], None, p[8]) 295 296 def p_decl__extern0(self, p): 297 "decl : EXTERN_TYPE '(' type pairs ')' SEMI" --- 203 unchanged lines hidden (view full) --- 501 def p_identx__single(self, p): 502 "identx : empty" 503 p[0] = [ ] 504 505 def p_ident(self, p): 506 "ident : IDENT" 507 p[0] = p[1] 508 |
509 def p_ident_or_star(self, p): 510 """ident_or_star : ident 511 | STAR""" 512 p[0] = p[1] 513 |
|
509 # Pair and pair lists 510 def p_pairs__list(self, p): 511 "pairs : ',' pairsx" 512 p[0] = p[2] 513 514 def p_pairs__empty(self, p): 515 "pairs : empty" 516 p[0] = ast.PairListAST(self) --- 219 unchanged lines hidden --- | 514 # Pair and pair lists 515 def p_pairs__list(self, p): 516 "pairs : ',' pairsx" 517 p[0] = p[2] 518 519 def p_pairs__empty(self, p): 520 "pairs : empty" 521 p[0] = ast.PairListAST(self) --- 219 unchanged lines hidden --- |