AST.py (9171:ae88ecf37145) | AST.py (9205:cc41d310241f) |
---|---|
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 40 unchanged lines hidden (view full) --- 49 def error(self, message, *args): 50 self.location.error(message, *args) 51 52 def embedError(self, message, *args): 53 if args: 54 message = message % args 55 code = self.slicc.codeFormatter() 56 code(''' | 1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 40 unchanged lines hidden (view full) --- 49 def error(self, message, *args): 50 self.location.error(message, *args) 51 52 def embedError(self, message, *args): 53 if args: 54 message = message % args 55 code = self.slicc.codeFormatter() 56 code(''' |
57char c; 58cerr << "Runtime Error at ${{self.location}}, Ruby Time: " 59 << g_system_ptr->getTime() << ": " 60 << $message 61 << ", PID: " << getpid() << endl 62 << "press return to continue." << endl; 63cin.get(c); 64abort(); | 57panic("Runtime Error at ${{self.location}}, Ruby Time: %d, %s.\\n", 58 g_system_ptr->getTime(), $message); |
65''') | 59''') |
66 | |
67 return code | 60 return code |