/third_party/antlr4_fast/runtime/Python3/src/antlr4/atn/ATNDeserializationOptions.py
https://github.com/alainmarcel/Surelog · Python · 24 lines · 14 code · 6 blank · 4 comment · 6 complexity · e6c1906ac77ec23997cb6aa2e00cdbb4 MD5 · raw file
- # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
- # Use of this file is governed by the BSD 3-clause license that
- # can be found in the LICENSE.txt file in the project root.
- # need a forward declaration
- ATNDeserializationOptions = None
- class ATNDeserializationOptions(object):
- __slots__ = ('readOnly', 'verifyATN', 'generateRuleBypassTransitions')
- defaultOptions = None
- def __init__(self, copyFrom:ATNDeserializationOptions = None):
- self.readOnly = False
- self.verifyATN = True if copyFrom is None else copyFrom.verifyATN
- self.generateRuleBypassTransitions = False if copyFrom is None else copyFrom.generateRuleBypassTransitions
- def __setattr__(self, key, value):
- if key!="readOnly" and self.readOnly:
- raise Exception("The object is read only.")
- super(type(self), self).__setattr__(key,value)
- ATNDeserializationOptions.defaultOptions = ATNDeserializationOptions()
- ATNDeserializationOptions.defaultOptions.readOnly = True