Exemple #1
0
    def __init__(self, version, scanner, showast=False,
                 debug_parser=PARSER_DEFAULT_DEBUG):
        GenericASTTraversal.__init__(self, ast=None)
        self.scanner = scanner
        params = {
            'f': StringIO(),
            'indent': '',
            }
        self.version = version
        self.p = get_python_parser(version, dict(debug_parser))
        self.showast = showast
        self.__params = params
        self.__param_stack = []
        self.ERROR = None
        self.prec = 100
        self.return_none = False
        self.mod_globs = set()
        self.currentclass = None
        self.classes = []
        self.pending_newlines = 0
        self.hide_internal = False

        self.offsets = {}
        self.last_finish = -1

        # Customize with our more-pervisive rules
        TABLE_DIRECT.update(TABLE_DIRECT_FRAGMENT)
Exemple #2
0
 def __init__(self):
     GenericASTTraversal.__init__(self, ast=None)
     params = {
         'indent': '',
         }
     self.params = params
     self.ERROR = None
     self.pending_newlines = 0
     self.hide_internal = True
     return
Exemple #3
0
 def __init__(self):
     GenericASTTraversal.__init__(self, ast=None)
     params = {
         'indent': '',
         }
     self.params = params
     self.ERROR = None
     self.pending_newlines = 0
     self.hide_internal = True
     return
Exemple #4
0
    def __init__(self, ast, debug=False):
        GenericASTTraversal.__init__(self, ast=None)
        params = {"f": StringIO(), "indent": ""}
        self.params = params
        self.param_stack = []
        self.debug = debug
        self.ERROR = None
        self.pending_newlines = 0
        self.indent_stack = [""]

        # A place to put the AST nodes for compuations pushed
        # on the evaluation stack
        self.eval_stack = []

        # By default symbols will be quoted. Rules like setq and
        # call change this and set True temporarily.
        self.noquote = False
        return
Exemple #5
0
    def __init__(self, ast):
        GenericASTTraversal.__init__(self, ast)
        self.Comp_set = ComponentSet()

        self.SignTable = SignTable()

        self.dictionary = {}  ## used in ident map

        self.cur_kind = ''
        self.cur_name = ''
        self.cur_module = ''
        self.cur_type = ''
        ##----used in range
        self.sb_flag = False
        self.cur_msb = 0
        self.cur_lsb = 0
        self.size = 0
        ##----------------
        ##------ used in port/normal_wire declaration
        self.wire_type = ''  # wire or reg   in the port/normal net

        self.dec_flag = False  # used in input and output declare
        self.reg_flag = False  # used in input and output declare
        ##----------------
        self.cur_num = 0

        ##------
        self.com_flag = False  # used in combine
        self.tmp_rv = []

        ##----- used in assign
        self.left_var = ''
        self.right_var = ''
        ##----- used in always ,containg enable bit ( if )
        ##----- now only support single_bit enable
        self.check_reg_flag = False
        self.alw_flag = False
        self.glo_trigger_flag = False
        self.trigger_rv = []
        self.glo_en_flag = False
        self.enable_rv = []
Exemple #6
0
 def __init__(self, ast):
     GenericASTTraversal.__init__(self, ast)
     self.postorder(ast)
     self.attr = int(ast.attr)
Exemple #7
0
 def __init__(self, ast):
     GenericASTTraversal.__init__(self, ast)
     self.postorder(ast)
     self.attr = int(ast.attr)
Exemple #8
0
 def __init__(self):
     GenericASTTraversal.__init__(self, ast=None)
     self.ERROR = None
     return
Exemple #9
0
 def __init__(self):
     GenericASTTraversal.__init__(self, ast=None)
     self.ERROR = None
     return
 def __init__(self, ast, debug=False):
     GenericASTTraversal.__init__(self, ast=None)
     self.traverse(ast)
     return
Exemple #11
0
 def __init__(self, text):
     GenericASTTraversal.__init__(self, None)
     self.text = text
     self.result = None
     return
 def __init__(self, ast, debug=False):
     self.debug = debug
     GenericASTTraversal.__init__(self, ast=None)
     return
Exemple #13
0
 def __init__(self, text):
     GenericASTTraversal.__init__(self, None)
     self.text = text
     self.result = None
     return