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 --- 107 unchanged lines hidden (view full) --- 116 'check_allocate' : 'CHECK_ALLOCATE', 117 'check_stop_slots' : 'CHECK_STOP_SLOTS', 118 'static_cast' : 'STATIC_CAST', 119 'if' : 'IF', 120 'is_valid' : 'IS_VALID', 121 'is_invalid' : 'IS_INVALID', 122 'else' : 'ELSE', 123 'return' : 'RETURN', |
124 'void' : 'VOID', 125 'new' : 'NEW', 126 'OOD' : 'OOD', 127 } 128 129 literals = ':[]{}(),=' 130 131 tokens = [ 'EQ', 'NE', 'LT', 'GT', 'LE', 'GE', --- 480 unchanged lines hidden (view full) --- 612 def p_expr__new(self, p): 613 "aexpr : NEW type" 614 p[0] = ast.NewExprAST(self, p[2]) 615 616 def p_expr__null(self, p): 617 "aexpr : OOD" 618 p[0] = ast.OodAST(self) 619 |
620 def p_expr__member(self, p): 621 "aexpr : aexpr DOT ident" 622 p[0] = ast.MemberExprAST(self, p[1], p[3]) 623 624 def p_expr__member_method_call(self, p): 625 "aexpr : aexpr DOT ident '(' exprs ')'" 626 p[0] = ast.MemberMethodCallExprAST(self, p[1], p[3], p[5]) 627 --- 62 unchanged lines hidden (view full) --- 690 691 def p_enumeration(self, p): 692 "enumeration : ident ':' ident" 693 p[0] = ast.EnumExprAST(self, ast.TypeAST(self, p[1]), p[3]) 694 695 def p_var(self, p): 696 "var : ident" 697 p[0] = ast.VarExprAST(self, p[1]) |