Make syntax error call yyerror() rather than raising a Python exception
[piyacc.git] / skel_t_def.py
1 # Copyright (C) 2019 Nick Downing <nick@ndcode.org>
2 # SPDX-License-Identifier: GPL-2.0-with-bison-exception
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the GNU General Public License as published by the Free Software
6 # Foundation; version 2.
7 #
8 # This program is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11 # details.
12 #
13 # You should have received a copy of the GNU General Public License along with
14 # this program; if not, write to the Free Software Foundation, Inc., 51
15 # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
16 #
17 # As a special exception, you may create a larger work that contains part or
18 # all of the pitree class definition skeleton and distribute that work under
19 # terms of your choice, so long as that work isn't itself a class definition
20 # generator using the skeleton or a modified version thereof as a class
21 # definition skeleton. Alternatively, if you modify or redistribute the class
22 # definition skeleton itself, you may (at your option) remove this special
23 # exception, which will cause the skeleton and the resulting pitree output
24 # files to be licensed under the GNU General Public License without this
25 # special exception.
26
27 import json
28 from ndcode.piyacc import element
29
30 # GENERATE SECTION1
31
32 # GENERATE SECTION2
33
34 def method(_class):
35   def decorator(func):
36     setattr(_class, func.__name__, func)
37     return func
38   return decorator
39
40 # GENERATE SECTION3