/third_party/antlr4_fast/runtime/Python2/src/antlr4/atn/ATNDeserializationOptions.py

https://github.com/alainmarcel/Surelog
Python | 21 lines | 12 code | 6 blank | 3 comment | 6 complexity | 6b7e3e6e1fc80fcd23ef84cbf7bd75ab MD5 | raw file
  1. # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
  2. # Use of this file is governed by the BSD 3-clause license that
  3. # can be found in the LICENSE.txt file in the project root.
  4. class ATNDeserializationOptions(object):
  5. defaultOptions = None
  6. def __init__(self, copyFrom = None):
  7. self.readOnly = False
  8. self.verifyATN = True if copyFrom is None else copyFrom.verifyATN
  9. self.generateRuleBypassTransitions = False if copyFrom is None else copyFrom.generateRuleBypassTransitions
  10. def __setattr__(self, key, value):
  11. if key!="readOnly" and self.readOnly:
  12. raise Exception("The object is read only.")
  13. super(type(self), self).__setattr__(key,value)
  14. ATNDeserializationOptions.defaultOptions = ATNDeserializationOptions()
  15. ATNDeserializationOptions.defaultOptions.readOnly = True